Darknet: How can I add custom new class labels, lets say-x classes to a Yolo trained model( which is already trained on y classes). So I do not replace those y classes and in total I have x+y class labels.

Created on 29 Aug 2018  Â·  6Comments  Â·  Source: pjreddie/darknet

Lets say:
Yolo model is trained to detect : dog and cat.
Custom object labels(to train): car, bike.
Final o/p: YoloV2 model detecting: dog, cat, car & bike.

Most helpful comment

@visshvesh Do we need to the train the old objects +new objects again?or is there a way to train for only new labels

All 6 comments

DOS command

cd /d <path>\darknet\alexey_darknet\darknet-master\build\darknet\x64
darknet.exe ^
detector train ^
obj.data ^
cfg\<structure>.cfg

obj.data

classes= 2
train  = train.txt  
valid  = test.txt  
names = obj.names
backup = cpos

obj.names

cat

You also need to change the number of classes and the filters in the cfg file. See https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects

These instructions are for yolov3.cfg, you'll need to do something similar, but not exactly the same if you're using a tiny variant.

@visshvesh Is this problem solved?

@Tuskio yup, turns out we need images of previous and new labels to train the model. Closing this issue.

please help me too.. i have this yolov3 model trained on coco dataset i want to detect more classes how should i go ahead?

@visshvesh Do we need to the train the old objects +new objects again?or is there a way to train for only new labels

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kthordarson picture kthordarson  Â·  3Comments

arianaa30 picture arianaa30  Â·  3Comments

gpsmit picture gpsmit  Â·  3Comments

bujingdexin picture bujingdexin  Â·  3Comments

HoracceFeng picture HoracceFeng  Â·  3Comments