1

I would like to add a new class(example: Handgun) to the coco dataset(90 classes) so I would detect 91 different classes.

I have this:

dataset: 300 image about Handgun

labelmap.pbtxt:

item {
    id: 1
    name: 'Handgun'
}

pipeline.config:

num_classes: 1
fine_tune_checkpoint: "/media/Shared/faster_rcnn_resnet101_coco_2018_01_28/model.ckpt"
from_detection_checkpoint: true
load_all_detection_checkpoint_vars: true

Possible solution: Change num_classes: 1 to num_classes: 90+1?

Thank you so much for answer me.

Knowledge
  • 41
  • 2

2 Answers2

4

Unfortunately you cannot just add one class, retrain and able to recognize all 91 classes. If you want to have model trained for all 91 classes, download the coco dataset , add your own dataset with labels and then train the model. Other option is to retrain a second model only with one class and infer that one class using this newly trained second model. You will have to infer other 90 classes using the available model seperately. You can learn about doing custom object detection using response in following post Tensorflow real time object detection

Srinivas Bringu
  • 452
  • 3
  • 9
  • Hi, I don't know the reason, since the train starts from a Coco pretrained network. Could you explain more in depth such point? The new net "forget" coco classes? – unrue Sep 16 '22 at 11:02
0

The one way you can do it is to use the new dataset and the existing dataset like COCO and club them, create a new training record and then train it

Subham Tiwari
  • 450
  • 4
  • 14