如何将暗网 YOLOv4 视频的输出保存在每帧的 txt 文件中? [英] How to save output of darknet YOLOv4 video in a txt file for each frame?
问题描述
我正在使用 darknet 在我的自定义数据集上使用 YOLOv4 检测对象.对于我使用的视频检测:
I am using darknet to detect objects with YOLOv4 on my custom made dataset. For this detection on videos I use:
./darknet 检测器演示数据/obj.data yolo-obj.cfg yolo-obj_best.weights -ext_output video.mp4 -out-filename video_results.mp4
这为我的视频提供了为每个检测打印的边界框.但是,我想为每个帧编号创建一个 .txt(或 .csv)文件.
This gives my the video with the bounding boxes printed for every detection. However, I want to create a .txt (or .csv) file with for each frame number the prediction(s).
我确实找到了 这个答案,但是这给出了一个 json 文件的输出,我需要一个 .txt 或 .csv 文件.我对 C 不太熟悉,所以我发现很难将这个答案修改为我需要的格式.
I did find this answer, but this gives the output in a json file and I need a .txt or .csv file. I am not so familiar with C so I find it hard to modify this answer into the format I need.
推荐答案
已经有关于如何使用命令行的说明,特别是将结果保存为.txt格式,链接:
there's already an explanation on how to use the command line, especially to save result in .txt format, the link:
https://github.com/AlexeyAB/darknet#how-to-use-on-the-command-line
为了节省时间,我将提供可能有帮助的观点:
to save time, i will provide the point which is might be helpful:
- 要处理图像列表 data/train.txt 并将检测结果保存到 result.txt,请使用:
- darknet.exe 检测器测试 cfg/coco.data cfg/yolov4.cfg yolov4.weights -dont_show -ext_output <数据/train.txt >结果.txt
可能会迟到但可能对其他人有帮助.
might be late but maybe helpful to the others.
这篇关于如何将暗网 YOLOv4 视频的输出保存在每帧的 txt 文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!