Closed rsamvelyan closed 2 years ago
Hi @rsamvelyan, you can use the cudaFromNumpy()
and cudaToNumpy()
functions from jetson.utils to convert images to/from OpenCV: https://github.com/dusty-nv/jetson-inference/blob/master/docs/aux-image.md#converting-to-numpy-arrays
Ok great! Will give it a try. I have my custom trained PTH files which work very well with jetson-inference but so far I need to convert them to ONNX. Is there a way to run inference on the .pth files directly instead of heaving to convert them to .onnx?
Is there a way to run inference on the .pth files directly instead of heaving to convert them to .onnx?
No, because jetson-inference runtime library doesn't use PyTorch - it uses TensorRT, and TensorRT imports ONNX
OK I see. And if I wanted to use directly PHT files then I would have to write my own inference from scratch?
And if I wanted to use directly PHT files then I would have to write my own inference from scratch?
You would just use PyTorch to run PTH checkpoints...
And in that case would not be able to optimize it with TensroRT, correct?
Correct, although you can try use torch2trt which uses TensorRT and doesn't need ONNX: https://github.com/NVIDIA-AI-IOT/torch2trt
Thanks as always Dusty! Really appreciate your help. My projects would probably have stalled without your help!!
No problem @rsamvelyan, happy to help! Wish you the best of luck on your project!
I created the live webcam capture that uses OPEN CV. It works very well and the FPS is very high - over 30 FPS on Jetson Nano. I can share it if you want.
Hello
I need much more flexibility as far as the window with the webcam feed is concerned. I need to use OpenCV in order to draw my custom boxes and labels. Something that the jetson-inference doesn't allow me to do.
Where could I get examples of how to integrate OpenCV webcam with Pytorch SSD inference and TensorRT optimization?
In other words I'm looking for a reference that would allow me to re-create the same thing as jetson-inference does but in Python.
Thanks!