experiencor / keras-yolo2

Easy training on custom dataset. Various backends (MobileNet and SqueezeNet) supported. A YOLO demo to detect raccoon run entirely in brower is accessible at https://git.io/vF7vI (not on Windows).
MIT License
1.73k stars 785 forks source link

Feeding in images with no object in it #347

Open fenilsuchak opened 6 years ago

fenilsuchak commented 6 years ago

How do I feed in images where in no object is present. I have an xml file with filename and size of image, but no "object" xml tag. Feeding in data with no objects is also important for my task. Any Idea how to do it?

Thanks

rodrigo2019 commented 6 years ago

You can use my fork, I already implemented this logic. But for now it is only avaliable to CSV parser, so you will need convert your xml files into CSV file, and for add images without objects write like this in CSV file:

filePath,,,,,,

fenilsuchak commented 6 years ago

@rodrigo2019 alright I'll try your fork. But isn't this some very basic thing?. There must be a way do to do so, in here, right?

rodrigo2019 commented 6 years ago

I think so, I don't remeber exactly what I changed

jzx-gooner commented 5 years ago

In preprocessing.py line55: if len(img['object']) > 0: #disable the checking

jzx-gooner commented 5 years ago

You can use my fork, I already implemented this logic. But for now it is only avaliable to CSV parser, so you will need convert your xml files into CSV file, and for add images without objects write like this in CSV file:

filePath,,,,,,

@rodrigo2019 how to transfer the xml to csv file?

rodrigo2019 commented 5 years ago

I didn't any kind of script to do this job, sorry

jzx-gooner commented 5 years ago

I didn't any kind of script to do this job, sorry

@rodrigo2019 i write a script transfer xml to csv and use your fork,feed the image as the csv file,first line is picture with object and secondly is a picture without object `1.jpg,74,117,14,57,dog

2.jpg,,,,,`

However,i got this error: File "/home/new_yolo/keras-yolo/frontend.py", line 492, in evaluate all_annotations[i][label] = annotations[annotations[:, 4] == label, :4].copy() IndexError: index 4 is out of bounds for axis 1 with size 0 thank you for your fork and thank you for your help

rodrigo2019 commented 5 years ago

Looks you are using a older version from my fork, because this line actually is the line 500

jzx-gooner commented 5 years ago

Looks you are using a older version from my fork, because this line actually is the line 500

@rodrigo2019 i use the new master,the same error for me