object-detection-inference icon indicating copy to clipboard operation
object-detection-inference copied to clipboard

Inference on custom RTDETR network

Open immohan6598 opened this issue 1 year ago • 8 comments

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

immohan6598 avatar Jan 30 '24 21:01 immohan6598

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?

olibartfast avatar Jan 30 '24 22:01 olibartfast

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.

mohanrobro avatar Jan 31 '24 05:01 mohanrobro

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

olibartfast avatar Jan 31 '24 09:01 olibartfast

image

output layer dimension

immohan6598 avatar Jan 31 '24 15:01 immohan6598

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

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

olibartfast avatar Jan 31 '24 18:01 olibartfast

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

immohan6598 avatar Feb 01 '24 16:02 immohan6598

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 avatar Feb 01 '24 17:02 olibartfast

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

olibartfast avatar Apr 22 '24 08:04 olibartfast