Closed wulele2 closed 4 years ago
@wulele2 Thank you for this bug, In voc dataset I didn't meet this problem and ignored it, you can in init remove the no objects' img_id by judging the correspond xml. I will fix this bug soon.
Thanks for your reply! Half of my tasks now include only background images, and I don't know what to do with them. According to voc_dataset. Py, just read in the picture, the tag is empty. Could you give me some advice? Thank you very much.
I tried tagging images that only included backgrounds: classes=[0],boxes=[0,0,0,0]. Do you think that would work?
@wulele2 if you would like to train these images with no objects, I think you can use this and in the loss func, for every image in a loop, remove the class id = 0, if the gt num is 0, you can only compute it's focal loss. You can refer to https://github.com/yhenon/pytorch-retinanet/blob/master/retinanet/losses.py .
really appreciate your help!
Hi, If an image has no objects, the corresponding tag file is empty .In the preprocess_img_boxes function, boxes=array([]). In the later collect_fn function, an error is reported. Because it's an empty array. How to modify this bug? Or how to tag background images, including classes and boxes. I look forward to hearing from you soon.