I am new about YOLO Algorithms, I trained my datasets, how can I save those images who detected in prediction part in format image in a folder, after detecting?(yolov4 and yolov5- Googlecolab)
Asked
Active
Viewed 3,140 times
1 Answers
0
You got x,y,w,h and confidence
for detected objects. Use these results and crop detected objects from original images. Run prediction phase on test data, if confidence
is bigger than a threshold save input image in a directory in your google drive(connect your google drive to google colab account. Check these links: Colaboratory: Can I access to my Google drive folder and file?, How to connect google drive folder to google colab and Is there a way to connect google colab to my google drive for good?).

BarzanHayati
- 637
- 2
- 9
- 22
-
Thanks a lot, those links were very useful. I tried some codes but it was not working properly to save output image. Can you help please? How to save images which are detected in prediction phase in a directory in my google drive or any other folder in yolov4 and yolov5? – work business Apr 17 '22 at 13:00
-
Yolov4 or Yolov5 is not a great matter. Did you check last link? It was not useful? and why? – BarzanHayati Apr 17 '22 at 13:23
-
yes. I did. but i can not save the results in my google drive . I mean after detecting, how should I save it. I know with below code I can copy , but is there any other way to save? – work business Apr 19 '22 at 14:55
-
!./darknet detector test data/obj.data cfg/yolov4-custom.cfg /mydrive/YOLOV4/training/yolov4-custom_best.weights /mydrive/images/Pic 1.jpg -thresh 0.3 .......................................... imShow('predictions.jpg') .......................................... import shutil .......................................... drive_path = '/content/gdrive/MyDrive/YOLOV4/' ............................................ shutil.copy2('predictions.jpg', drive_path+'Pic 1.jpg') – work business Apr 19 '22 at 14:59
-
**Darknet** has an api `darknet help`. you could call it in python and give it a list of images and you receive a text file that has location on objects in it. – BarzanHayati Apr 19 '22 at 15:09
-
Also, you could run **opencv dnn module** in `python` or `C++` for detecting objects. – BarzanHayati Apr 19 '22 at 15:12