Nvidia DLI Course Custom Yolo detection issues

Good evening,

I’ve been modifying Yolo example from Nvidia DLI Course (Lesson 5.0 Using Different Neural Networks) and decided to change default YoloV3-tiny model on my own custom trained.

Apparently I really strange results, like this:
https://imgur.com/a/4hXWPHa
No detections at all, except some random ‘motor’ objects.
My network has 4 classes (car, truck, bike, trailer), so I have no idea where ‘motor’ came from.

I’ve already tried to delete TRT engines and rebuild both yolo and deepstream app, but it didn’t gave any results. Please advice if I’ve missed something?

P.S. Yolo was configured properly (number of classes and links to weights)

Does it give correct result by Darknet inference?
Does mask/anchors of cfg match to the code which is hard code in NvDsInferParseCustomYoloV3Tiny()

Dear ChrisDing,
Actually original darknet weights/configs are giving absolutely similar results on my video file.
Still original weights are working well on Deepstream test video, this one:
https://imgur.com/a/5l9Aah3
So I believe there are some binaries which doesn’t rewrite itself when I perform ‘make’ command.

Masks and anchors are set up correct.

“Does it give correct result by Darknet inference?” ---- I mean to test if your trained model is correct.
config_infer_primary_yoloV3_tiny.txt should be modified, such as num-detected-classes

ChrisDing,

“Does it give correct result by Darknet inference?”
–model gives correct results when I’m running it using default deepstream-app, command looks like this:

deepstream-app -c deepstream_app_config_yoloV3_tiny_road_2.txt
But please note that I’m running it on a separate Jetson Nano device, OS version is the same.

I’ve reflashed OS image to try this on fresh system.
As you adviced I’ve double-checked and made following changes in files:

  1. sources/objectDetector_Yolo
    1.1. nvdsinfer_custom_impl_Yolo/nvdsparsebbox_Yolo.cpp
    -static const int NUM_CLASSES_YOLO = 4;
    -weights are similar to ones in .cfg file

    1.2 labels.txt
    - 4 classes: truck, car, bike,trailer

    1.3 Custom weights and config uploaded and saved as :
    - yolov3-tiny.cfg
    - yolov3-tiny.weights

    1.4 config_infer_primary_yoloV3_tiny.txt
    - num-detected-classes=4

  2. sources/apps/dli_apps/deepstream-test3-mp4_out-yolo
    2.1 deepstream_test3_app.c
    - gchar pgie_classes_str[4][32] = { “truck”, “car”, “bike”,“trailer”};

    2.2 dstest3_pgie_config_yolov3_tiny.txt
    - num-detected-classes=4

After all these changes, I still got this random boxes with ‘motor’ (https://imgur.com/a/4hXWPHa), but as you can see from above I don’t even have a class with this name.
Also I’ve tried to comment out model engine file:
#model-engine-file=model_b1_fp32.engine
Looks like engine is rebuilding but result stays the same.

Can you share the application logs and model config file with weights in order to debug it in my side?

Hi kutsenkoilya,

Have you managed to get issue resolved? Any result can be shared?

Dear kayccc and ChrisDing,

Yes, issue was resolved.
I haven’t touched the project for a while but I’ve runned it today and bounding boxes are shown and labelled correctly.
If I would find out what actually caused this issue and why it started wourking, I will reply in this thread (to be helpful for other devs).

Thank you for your help.