ryouchinsa / Rectlabel-support

RectLabel is an offline image annotation tool for object detection and segmentation.
https://rectlabel.com
511 stars 73 forks source link

Convert csv to SFrame not working #38

Closed KevinHuyskens closed 6 years ago

KevinHuyskens commented 6 years ago

When I run the script I run into the error shown in the picture

screen shot 2018-05-04 at 11 18 20
ryouchinsa commented 6 years ago

Thanks for writing the issue.

Could you show us the RectBoundsData.csv for debugging?

Best regards, Ryo

KevinHuyskens commented 6 years ago

can't attach a .csv file so here are the first lines: annotation,folder,filename,path,source,database,size,width,height,depth,segmented,object,name,pose,truncated,difficult,bndbox,xmin,ymin,xmax,ymax ,"Thermostat off","IMG_0073.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat off/IMG_0073.jpg",,"Unknown",,"3024","3024","3","0",,"off","Unspecified","0","0",,"1082","1150","1906","1831" ,"Thermostat off","IMG_0001.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat off/IMG_0001.jpg",,"Unknown",,"3024","3024","3","0",,"off","Unspecified","0","0",,"987","1105","1769","1776" ,"Thermostat on","IMG_0179.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat on/IMG_0179.jpg",,"Unknown",,"3024","3024","3","0",,"on","Unspecified","0","0",,"1022","1156","1563","1624" ,"Thermostat off","IMG_0011.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat off/IMG_0011.jpg",,"Unknown",,"3024","3024","3","0",,"off","Unspecified","0","0",,"1298","1140","2036","1796" ,"Thermostat on","IMG_0169.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat on/IMG_0169.jpg",,"Unknown",,"3024","3024","3","0",,"on","Unspecified","0","0",,"1006","1150","1514","1568" ,"Thermostat off","IMG_0087.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat off/IMG_0087.jpg",,"Unknown",,"3024","3024","3","0",,"off","Unspecified","0","0",,"1008","907","1793","1563" ,"Thermostat on","IMG_0220.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat on/IMG_0220.jpg",,"Unknown",,"3024","3024","3","0",,"on","Unspecified","0","0",,"893","1386","1490","1905" ,"Thermostat on","IMG_0230.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat on/IMG_0230.jpg",,"Unknown",,"3024","3024","3","0",,"on","Unspecified","0","0",,"1006","1308","1625","1800" ,"Thermostat off","IMG_0018.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat off/IMG_0018.jpg",,"Unknown",,"3024","3024","3","0",,"off","Unspecified","0","0",,"1372","1029","2077","1713" ,"Thermostat off","IMG_0008.jpg","/Users/Kevin/MLClassifier/Non active datasets/Thermostat off/IMG_0008.jpg",,"Unknown",,"3024","3024","3","0",,"off","Unspecified","0","0",,"1174","1144","1953","1842"

ryouchinsa commented 6 years ago

Our feature "Convert XML to CSV in the folder" saves the CSV file in the format below. https://github.com/ryouchinsa/Rectlabel-support/blob/master/example.csv

path,annotations
/Users/ryo/Desktop/test_data_small/1.jpg,"[{'label':'shoes','type':'rectangle','coordinates':{'height':56,'width':26,'x':14,'y':779}},{'label':'shoes','type':'rectangle','coordinates':{'height':83,'width':35,'x':444,'y':812}},{'label':'shoes','type':'rectangle','coordinates':{'height':80,'width':41,'x':352,'y':837}},{'label':'shoes','type':'rectangle','coordinates':{'height':100,'width':49,'x':293,'y':855}},{'label':'shoes','type':'rectangle','coordinates':{'height':116,'width':48,'x':228,'y':896}}]"
/Users/ryo/Desktop/test_data_small/2.jpg,"[{'label':'bare feet','type':'rectangle','coordinates':{'height':138,'width':60,'x':437,'y':832}},{'label':'bare feet','type':'rectangle','coordinates':{'height':145,'width':71,'x':483,'y':854}}]"

dbgkzfxvqaabh2h

Could you tell us which tool saved the CSV file?

KevinHuyskens commented 6 years ago

Aaah ok so it's the CSV files fault. I've purchased the tool now but I already had 100 images labeled with labelimg.py (a free visual python image labeler) so I merged the 100 xml files and then converted it to csv with an online converter. Came a cross many converters that didn't work at all but this one seemed to be ok. Apparently it was not. Well time to re label 100 images I guess :')

ryouchinsa commented 6 years ago

LabelImg saves label files in the PASCAL VOC xml format. RectLabel can read and write in the same format. We think you can continue using the same xml files on RectLabel, too. RectLabel assumes that annotations folder is in the image folder.

image folder/
 image1.jpg
 image2.jpg
 annotations/
  image1.xml
  image2.xml
KevinHuyskens commented 6 years ago

Possibly, tho they are both using VOC they are a little different but it might work, will try monday. Don't have access to the program at home, only at work, will let you know if it works. Thanks for the help :)

KevinHuyskens commented 6 years ago

It works with my xmls but for the record if anyone else wants to try this: You need to put a folder in the folder with your pictures called "annotations" and you have to have you pictures in the folder you open in RectLabel (it looks for the names of the pictures to create the csv from the xmls with the same name)