olibartfast / object-detection-inference

C++ object detection inference from video or image input source
MIT License
53 stars 10 forks source link

Inference on custom RTDETR network #8

Closed immohan6598 closed 1 week ago

immohan6598 commented 5 months ago

Hi,

Thanks for sharing a work!

I have trained a custom model using https://github.com/lyuwenyu/RT-DETR/tree/main/rtdetr_pytorch

network dimension is 1024 x 1024 and converted the .pt to tensorrt engine.

when i inference i get segmentation fault in the postprocessing

image

i only have 15 classes

please help me figure out this

olibartfast commented 5 months ago

Hi there, In my project I used a pre-trained RT-DETR from ultralytics so the network output layer might be different from your model. Also I used 640x640 hardcoded input, I should modify my project to make it work for any size (maybe specifying it from cli).

Which RT-DETR did you use from lyuwenyu model zoo?

What did you use to convert the binary to tensorrt engine, trtexec after onnx conversion or torch2trt?

mohanrobro commented 5 months ago

Hi, Thanks for the answer. I used this official repo https://github.com/lyuwenyu/RT-DETR/tree/main/rtdetr_pytorch Guideline is also available to convert a model to tensor-rt

I changed the hard-coded network dimension values.

I used this mode rtdetr_r18vd

I visualized the onnx model the output. I don't have that deep understanding on infer() function that updates ouputs and shapes so just want to understand.

I assume the infer will give the final output layer data.

Thanks in Advance.

olibartfast commented 5 months ago

Thanks all right, I'll take a look at it as soon as I can 👍

immohan6598 commented 5 months ago

image

output layer dimension

olibartfast commented 5 months ago

Yes is a completely different input/output format to the model I used for this project.

Screenshot from 2024-01-31 19-52-41

immohan6598 commented 5 months ago

will you be able to support? do you work on freelancing projects? I am working with freelancers to finish projects

olibartfast commented 5 months ago

Yes but not too soon, I have a full-time job so I can work on my GitHub projects only in my spare time.

olibartfast commented 2 months ago

Sorry a bit late :smile: , I currently wrote the code to infer this model here