endernewton / tf-faster-rcnn

Tensorflow Faster RCNN for Object Detection
https://arxiv.org/pdf/1702.02138.pdf
MIT License
3.65k stars 1.58k forks source link

When I use one category to train, I got a wrong result #484

Open unuan12 opened 4 years ago

unuan12 commented 4 years ago

I wanna use just one categrty(perosn) from COCO dataset for training a model, The bakebone is vgg16, I change four places in coco.py

  1. line 39 cats = self._COCO.loadCats(self._COCO.getCatIds()) to cats = self._COCO.loadCats(self._COCO.getCatIds(catIds=[1]))

  2. line 42 self._class_to_coco_cat_id = dict(list(zip([c['name'] for c in cats], self._COCO.getCatIds()))) to self._class_to_coco_cat_id = dict(list(zip([c['name'] for c in cats], self._COCO.getCatIds(catId=[1]))))

  3. line 75 image_ids = self._COCO.getImgIds() to image_ids = self._COCO.getImgIds(catIds=[1])

  4. line 133 annIds = self._COCO.getAnnIds(imgIds=index, iscrowd=None) to annIds = self._COCO.getAnnIds(imgIds=index, catIds=[1], iscrowd=None)

And then I start to train the model, when I use demp.py to test the model, I got the result like this. A dog has also detected to the person.

Is there somrthing wrong with my input data? Thank you.

image

devendraswamy commented 4 years ago

Are you solve this problem ? i am also getting same error . please help me , in my model i am using pascal voc dataset. thanking you !