Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with a custom Yolo #5

Closed
elementdl opened this issue Jul 16, 2020 · 11 comments
Closed

Problem with a custom Yolo #5

elementdl opened this issue Jul 16, 2020 · 11 comments

Comments

@elementdl
Copy link

Hi,

I have some trouble with deepstream.

I trained a Yolov3-tiny on darknet with specific classes :

person
wheelchair
bicycle
motorcycle
car
bus
truck
ambulance
traffic light
stop sign
cedez le passage
shoes
sports ball
traffic cones

As you can see it contains some classes of the COCO dataset but not only them, and not in the same order.

I trained on darknet, and It worked : I took somes pictures to verify it :
pre_velo2

Then I took the .cfg .weight and .names for deepstream (I uses deepstream 4.0).

I changed the number of classes in nvdsparsebbox_Yolo.cpp, and I compiled it.

I also created a config_infer_primary... and deepstream_app_config... and configure it well (right number of classes, right sources)

I changed my .names for labels.txt

And I tried Yolo_Deepstream

I don't understand my results :

For now The video I used let me saw theses objects :

person
car
bicycle
wheelchair

but i detect this :

person is detected as person
car is detected as bicycle
bicycle is detected as wheelchair
wheelchair is detected as...wheelchair.

I really don't know where is the problem, It works on darknet, and I didn't modify the order.
Plus, first I thought that some classes were inversed, with car->bicycle and bicycle->wheelchair, but wheelchair->wheelchair!

Do you know where the problem can be in deepstream?

Sincerely,

@elementdl
Copy link
Author

Hi @marcoslucianops, I ask again if you can help me about this problem?

@marcoslucianops
Copy link
Owner

Hi @elementdl ,

Can you send me your configs files, nvdsparsebbox_Yolo.cpp and yolo.cfg file?

@elementdl
Copy link
Author

Hi @marcoslucianops,

I followed this manual :
https://docs.nvidia.com/metropolis/deepstream/Custom_YOLO_Model_in_the_DeepStream_YOLO_App.pdf

For the cfg i didn"t change much, only the number of filter (57) in [convutional], just before [yolo] and (14) on [yolo]

For the cpp I only changed the number of classes : 14

here :

yolov3-tiny-obj.txt

nvdsparsebbox_Yolo.txt

@marcoslucianops
Copy link
Owner

Do you changed label.txt file to your classes?

@marcoslucianops
Copy link
Owner

If you trained with 0, 1, 2 masks, you need change in nvdsparsebbox_Yolo file

        {3, 4, 5},
        //{0, 1, 2}}; // as per output result, select {1,2,3}
        {1, 2, 3}};

to

        {3, 4, 5},
        {0, 1, 2}};

@elementdl
Copy link
Author

Hi @marcoslucianops, thank you for your response.
I changed the label.txt, instead 80 classes there are my 14 classes, in the right order.

I just changed this line in nvdsparsebbox_Yolo.cpp, and I compiled it with the makefile, but nothing changed (car are still labeled as bicycle).

Do I have to do something after "make"? maybe transfer a file in the right place for deepstream?

@marcoslucianops
Copy link
Owner

marcoslucianops commented Aug 1, 2020

I changed the label.txt, instead 80 classes there are my 14 classes, in the right order.

You need put in the same order of obj.names file.

Do I have to do something after "make"? maybe transfer a file in the right place for deepstream?

Isn’t needed. The configs files needs have correct path of your files. You need only and run deepstream-app in config.txt file location.

@elementdl
Copy link
Author

elementdl commented Aug 1, 2020

You need put in the same order of obj.names file.

Yes I did it.

Isn’t needed. The configs files needs have correct path of your files. You need only and run deepstream-app in config.txt file location.

I also did this, I still don't know why it is not working.

@marcoslucianops
Copy link
Owner

Try change

    static const float kNMS_THRESH = 0.45;
    static const float kPROB_THRESH = 0.25;

To default

    static const float kNMS_THRESH = 0.3f;
    static const float kPROB_THRESH = 0.7f;

And recompile

@elementdl
Copy link
Author

Hi @marcoslucianops it only changed the rate of detection, I've got the same errors about the labels.
To be clear, it's not an error of detection, it's really an error about the names : my program know how to detect a car, but for some reasons, he changed the name of the label car => bicycle. In darknet the detection works.

@marcoslucianops
Copy link
Owner

Hi @marcoslucianops it only changed the rate of detection, I've got the same errors about the labels.
To be clear, it's not an error of detection, it's really an error about the names : my program know how to detect a car, but for some reasons, he changed the name of the label car => bicycle. In darknet the detection works.

In this case, unfortunately, I don't know how to solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants