YCAyca commented on issue #5163: How to generate synset.txt files?
URL: 
https://github.com/apache/incubator-mxnet/issues/5163#issuecomment-565740027
 
 
   Hi! I was stucking with the same problem and solved with this way : creating 
a .lst file from my dataset. Convering the .lst file to the synset file with 
this python code : 
   
   f= open("C:/Users/SAHINA/Desktop/mxnet_sample/mxnet_sample/OKNOK.lst","r")
   
   f2 = 
open("C:/Users/SAHINA/Desktop/mxnet_sample/mxnet_sample/OKNOKsynset.txt", "w")
   
   for line in f:
       line = line[line.find("\t")+1:len(line)]
       line = line[line.find("c"):len(line)-5] + " " + 
line[line.find("\t")+1:line.find("\\")]
       f2.write(line)
       f2.write("\n")
       
   f.close()
   f2.close()  
   
   So you just need to change the file path and the characters to find and move 
for having the synset order. An example line from my .lst file to synset file 
is :
    315 0.000000        NOK\crop53_3906_2.jpg   ---> crop53_3906_2 NOK

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to