Skip to content

Runs YOLOv3 in Python on a video file and creates a CSV with all detections per frame

Notifications You must be signed in to change notification settings

csiebler/yolo3-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLOv3 Python to CSV

A simple tool for running video or camera data through YOLOv3 and outputting predictions to a CSV file.

Usage

Firstly, load weights for YOLO:

$ ./prepare.sh

Next, feed your data into the script using regular YOLOv3:

python3 detect_to_json.py \
  --model yolov3.weights \
  --config model/yolov3.cfg \
  --classes model/coco_classes.txt \
  --input_video test.mp4 \
  --output_video out/sample_output.mp4 \
  --output_csv test.csv

Alternatively you can use YOLOv3-tiny:

python3 detect_to_json.py \
  --model yolov3-tiny.weights \
  --config model/yolov3-tiny.cfg \
  --classes model/coco_classes.txt \
  --input_video test.mp4 \
  --output_video out/sample_output.mp4 \
  --output_csv test.csv

If output to CSV is set, the following format will be outputted:

# frame,label,confidence,x,y,w,h
0,person,0.734311044216156,858,311,18,29
0,person,0.7461023330688477,714,355,17,26
0,person,0.46452274918556213,960,349,19,34
...

About

Runs YOLOv3 in Python on a video file and creates a CSV with all detections per frame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published