NVIDIA-AI-IOT / CUDA-PointPillars

A project demonstrating how to use CUDA-PointPillars to deal with cloud points data from lidar.
Apache License 2.0
527 stars 155 forks source link

What should I do if I want more labels? #64

Open zexianghui opened 2 years ago

zexianghui commented 2 years ago

Hello, dear developer If the model I retrained contains more labels, how can I modify the original code? Please give me some advice For example, labels of my model are "car", "pedestrian","cyclist","indicator" and "truck", while the open source code is only "car", "pedestrian" and "cyclist". Thank you very much!

maayanYa commented 2 years ago

Hi @1301706592 , did you manage to solve this issue ?

liveforday commented 1 year ago

you do not need to modify any original code. All you need to do is executing exporter.py, it wll generate a new version param.h and pointpillar.onnx. replace param.h and pointpillar.onnx in the project. the labels depends on your model completely which trained by OpenPcdet @zexianghui @maayanYa

maayanYa commented 1 year ago

@liveforday Thank you for your response ! That's what I did and it worked good on OpenPCDet , but running with the ONNX file on your project - inference time increased significantly to an unreasonable time and I received a lot ( ~ thousands ) of false predictions , for example :

WhatsApp Image 2023-01-04 at 14 50 01

So I assumed changing only the params.h wasn't enough but couldn't figure out what else is needed

liveforday commented 1 year ago

@maayanYa I haved met similar problems before. In my case the programme is running ok when I used my own model with 5 label. But when I increased the number of label to 10, the number of predicted boxes exploded and the prediction took a long time. but it still worked good on OpenPCDet . Later, we found that this is not about the number of labels, it was about what parameters did you choose to save to the pth file. However, this part is not my responsibility in my team, so I will reply to you again when I figure it out.

maayanYa commented 1 year ago

@liveforday Thank you !! Looking forward for your reply :)

JiyuanWANG12138 commented 1 year ago

Hello, I have a question , can I print the predict label by this code ? After I simplify the model, the output is just the bbox, how can I add the object's own label? Looking forward for your reply.

liveforday commented 1 year ago

Yes, you can. The output has the label id, you could refer to SaveBoxPred function in the main.cpp file at 100 row. The last two value of output is id and score

JiyuanWANG12138 commented 1 year ago

Thank you very much, i'm so stupid I thought it was the number id...

Acuno41 commented 1 year ago

Hello eveyone, I met the same problem. Is there any update on this one ?

@maayanYa I haved met similar problems before. In my case the programme is running ok when I used my own model with 5 label. But when I increased the number of label to 10, the number of predicted boxes exploded and the prediction took a long time. but it still worked good on OpenPCDet . Later, we found that this is not about the number of labels, it was about what parameters did you choose to save to the pth file. However, this part is not my responsibility in my team, so I will reply to you again when I figure it out.

Acuno41 commented 1 year ago

Hello again, after updating the exporter code with below comment custom model training exported and worked fine for me.

https://github.com/NVIDIA-AI-IOT/CUDA-PointPillars/pull/77#issuecomment-1508276016

maayanYa commented 1 year ago

@Acuno41 It works for me as well ! Thank you !!

Acuno41 commented 1 year ago

Hello again everyone,

After sometime i was able to train my custom data with 3 classes with OpenPCDet and export it successfully. Both OpenPCDet and c++ side the model worked fine and generated OK results. Then i also trained same data with 12 classes with OpenPCDet and export it successfully. But this time c++ side generated completely random results while OpenPCDet side reuslts looking good.

Is anyone encountered this type of issue ? or is anyone can successfully export the model with much more classes ?

I would be glad if anyone can help. Thank you.

Acuno41 commented 1 year ago

I found out that the "MAX_POINTS_PER_VOXEL" parameter in the pointpillar.yaml file is the problem. When I change the parameter from the default 32 to something different, it causes the problem I described above. I am looking for solution.