Reputation: 91
Tendorflow object detection.
I know you can train new class with existed pre-trained models in here:
But I want to only detect 'person' and 'car',these two classes already existed,futher training is not neccessary.
However,model such as 'faster_rcnn_inception_v2_coco',It detect 90 classes,and runs too slowly for me.
Is there a way to cut down the classes,so the detection runs faster?
PS:I've filtered COCO dataset to one that only has 'person' and 'car',but following the common steps I googled,I got bad training result.I can only successfully detect 'person'.Wander what's the reason.
Upvotes: 5
Views: 2125
Reputation: 91
Solved myself.If you use 'person' or 'car' in coco,which id is 1 and 3 in pre-trained model,and that cannot be changed.
In .config,set 'num_classes'=3,although your classes num is 2.
The 3 is to fit 'car'-id.
(e.g.If you choose 2 classes,'person'=1,'truck'=8,your 'num_classes' should be 8)
Also,choose your epoch properly,you can see:http://neuralnetworksanddeeplearning.com/chap3.html
Upvotes: 1