I am looking at the recently uploaded pretained model peoplenet model
Q) Would it be possible to add another class to detect such as helmets for example? When retraining it I want to keep the original class of people detection, but want to add another class such as helmets
Q) One of the usecases mentions social distancing; is there any pointers to understanding how that can be done with this model ?
It is possible for you to train your own data with the unpruned peoplenet model as pretrained weight. You need to prepare the helmets’ images/labels, resize to 960x544, and set the training spec accordingly. That’s for one class. If you want to train a 4-classes detector, you also need to add some images/labels for person/bags/faces.
PeopleNet can be used to accurately count people in a crowded environment for security
So, is my understanding correct to train a 4-class detector - hypothetically - I can add 5 images for training for each of those classes; but the accuracy will still be high because of the original weights?
My end goal is to add a class to peoplenet - retrain with the 4 classes - but I won’t have all the data you used when training the original peoplenet - I will have a much smaller version. Will the accuracy of the retrained model with the classes of person/bag/faces be essentially the same of the original model?
Is my understanding correct? I am assuming that I have to explicitly mention the classes the exact same as “person” “bags” “faces” so the model knows?
Firstly, please prepare your own dataset for 3 classes: Person, Bag, Face. The quantity of data depends on you. Smaller is ok.
And set the correct class name in the training spec accordingly.
The class name is as below.
nvidia@nvidia:/opt/nvidia/deepstream/deepstream-5.0/samples/configs/tlt_pretrained_models$ cat labels_peoplenet.txt
Then you can use “tlt-evaulate” to check if the peoplenet pretrained model “resnet34_peoplenet.tlt” has a good mAP.
I want to keep the ability to track people from people net, but i want to add another class. I am not interested in bags or faces, but if it means sacrificing the people class I am ok with training on 4 classes (3 original classes + 1 my new class).
If i want to add a 4 th class to people net - is that possible?
For your case, actually it is a new training. The peoplenet model contains pretrained weights that may be used as a better starting point for people class.
I also do similar experiment on my side. I train the “People” class and a new class “cart”.
Prepare some data for both classes. All the data are 960x544.
Then set the training spec and also tune the class_weight.
The unpruned peoplenet pretrianed model works as a good pretrained weight.
Actually it is a new training because a new class is added.
I prepare 14k person data and 3.7k cart data, run totaly 10 epochs, 40 minutes. The AP for Person is about 60%.
I did not finetune any hyper-parameters a lot.
So, after finetune or run longer, I believe the mAP can still improve further.
Dark-lighting, Monochrome or Infrared Camera Images
The PeopleNet model was trained on RGB images in good lighting conditions. Therefore, images captured in dark lighting conditions or a monochrome image or IR camera image may not provide good detection results.
For training on gray scale images only, please consider to set
No, you need not a similar number of images. That is why unpruned peoplenet model is provided in ngc. User can set it as pretrained model and train their own data. If your data are colour images, the transfer learning should run smoothly. But as the link said, “monochrome image or IR camera image may not provide good detection results”, that is the known limitation.