enazoe / yolo-tensorrt

TensorRT8.Support Yolov5n,s,m,l,x .darknet -> tensorrt. Yolov4 Yolov3 use raw darknet *.weights and *.cfg fils. If the wrapper is useful to you,please Star it.
MIT License
1.18k stars 313 forks source link

How to use the trt engine for the folder with images? #71

Open Justin-king-de opened 3 years ago

Justin-king-de commented 3 years ago

@enazoe . First of all, thanks for sharing your wonderful work with us. I have a trained custom yolov4 model and I have created a trt engine file for that using your repo. Now in thesample_detector.cpp file, I see that the detections are being done for 2 images. However I want to run the inference process for many images that I have in a directory. I want to work on images directly which gets stored in a directory dynamically from a camera. Is there any function written for that in repo? Or any kind of idea or help in this regard will be much helpful to me. Thank you in advance.

enazoe commented 3 years ago

just read the sample_detector.cpp ,use opencv read camera and save image

Justin-king-de commented 3 years ago

@enazoe In my case, I don't have access to camera. I can only access images from a folder. In python it can be done easily. I was looking for a custom function in C++ which can do that.

Justin-king-de commented 3 years ago

Hello @enazoe .I have somehow figured out on how to run it on multiple images from directory. On the detected images, its writing the id of the class using cv::imwrite. But I want to put the classname instead of its id. How to do that in sample_detector.cpp. I have tried. But was unable to do. Any suggestion will be of great help to me. Thank you in advance.

SinGit1 commented 3 years ago

@Justin-king-de can you share how you managed to run it on multiple images from the directory. I am not managing it at all.