You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/12/14 18:18:50 UTC

[GitHub] [incubator-mxnet] YCAyca commented on issue #5163: How to generate synset.txt files?

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:
users@infra.apache.org


With regards,
Apache Git Services