AlexeyAB / darknet

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

Way to save a frame of outputvideo with the corresponding .txt-file? #1978

Open Motch93 opened 5 years ago

Motch93 commented 5 years ago

I run the yolov3 as videodetection on my webcam and i want to save a jpg or png frame with the corresponding .txt file (class,coordinates). So i get the images with .txt-files while running the code. Is there already a solution or how do i have to modificate the code? Thanks for your help. (Yolov3 on Jetsontx2 ubuntu with GPU=1, CUDNN=1)

Zuo1ji commented 5 years ago

do you mean you want to know where to find the source code of the img?

if so,

there is a function in src/image.c called 'show_image_cv' may help you know where the img is,Suppose you have used opencv

if you donot have opencv, there is another function in src/image.c called ‘save_image_png’ shows where the data is

AlexeyAB commented 5 years ago

@Motch93

Do you get test.mp4 and do you want to get frame1.jpg, frame2.jpg,,, with correspond txt files for each jpg-image?

Then run command - to get list of all images in the train.txt file: ./yolo_mark /img train.txt coco.names

As result you will get txt-label files in the /img directory for each jpg-file. But you will get it in Yolo format: <class> <x_relative_center> <y_relative_center> <width_relative_center> <height_relative_center>