AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.76k stars 7.96k forks source link

Execute Darknet Command from External Python Script #2991

Open amar-mustaqim opened 5 years ago

amar-mustaqim commented 5 years ago

Hi. Is it possible to execute darknet command from an external python script? I try to use subprocess module but it doesnt work. This is my code:

import subprocess subprocess.call("C:/Users/Admin/Desktop/CSP650/darknet-master (1)/darknet-master/build/darknet/x64/darknet.exe detector demo data/obj.data yolo-obj.cfg backup/yolo-obj_last.weights -c 0")

And it display "Couldn't open file: data/obj.data" error.

Any suggestion?

Arsiirasheed commented 5 years ago

yes its possible i having been doing it on google colab python colab notebook . make sure your obj.data file exists or try giving absolute path

LukeAI commented 5 years ago

If you are calling darknet from a different location but giving relative paths then it will fail.