In Yolov7, I use this code to test entire folder images:
python test.py --save-txt --data data/coco.yaml --save-conf --conf 0.1 --weights yolov7_20240316best.pt --task test --name 0316conf01
Now I need to predict test.txt (include all image path) in yolov4.
I tried this command but did not work:
darknet detector test data/obj.data cfg/yolo-obj.cfg backup/yolo-obj_best.weights -thresh 0.9 -dont_show data/test.txt result.txt
Make sure you're using the most up-to-date repo for Darknet. The new repo is this one: https://github.com/hank-ai/darknet#table-of-contents
The question you ask is addressed in the FAQ. See the question "How to run against multiple images" here: https://www.ccoderun.ca/programming/yolo_faq/#json_output The command that used to be recommended was:
To process a list of images data/train.txt and save results of detection to result.json file use:
darknet detector test coco.data yolov4.cfg yolov4.weights -ext_output -dont_show -out result.json < test.txt
DarkHelp --json --threshold 0.9 yolo-obj.cfg yolo-obj_best.weights yolo-obj.names --list test.txt
Make sure you read the whole FAQ: https://www.ccoderun.ca/programming/yolo_faq/
Join the Darknet/YOLO discord server if you have more questions: https://discord.gg/zSq8rtW