I added csv tracking logging using Pandas in DeepSort Yolo v4. The csv tracking is very useful if you want to train the csv inside GRU neural network or other kind of deep learning train. I also added person cropping so we could get each person tracked and each person frames picture one by one. This frames picture will be very useful if you want to train for example inside FlowNet.
If you use conda, you can use my "requirement.txt" by type:
conda create --name <env> --file requirements.txt
Go to tensorflow2.0-> deep-sort-yolov4
cd tensorflow2.0/deep-sort-yolov4/
└── tensorflow2.0 ├── deep-sort-yolov4 │ ├── convert.py │ ├── deep_sort │ │ ├── detection.py │ │ ├── detection_yolo.py │ │ ├── __init__.py │ │ ├── iou_matching.py │ │ ├── kalman_filter.py │ │ ├── linear_assignment.py │ │ ├── nn_matching.py │ │ ├── preprocessing.py │ │ ├── __pycache__ │ │ │ ├── detection.cpython-36.pyc │ │ │ ├── detection_yolo.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── iou_matching.cpython-36.pyc │ │ │ ├── kalman_filter.cpython-36.pyc │ │ │ ├── linear_assignment.cpython-36.pyc │ │ │ ├── nn_matching.cpython-36.pyc │ │ │ ├── preprocessing.cpython-36.pyc │ │ │ ├── track.cpython-36.pyc │ │ │ └── tracker.cpython-36.pyc │ │ ├── tracker.py │ │ └── track.py │ ├── demo_csv_crop.py │ ├── demo_csv.py │ ├── demo-csv.zip │ ├── demo.py │ ├── IMG_3326.MOV │ ├── jpg2png.zip │ ├── model_data │ │ ├── coco_classes.txt │ │ ├── mars-small128.pb │ │ ├── voc_classes.txt │ │ ├── yolo4.h5 │ │ ├── yolo_anchors.txt │ │ └── yolov4.weights │ ├── output_crop │ │ ├── 1 │ │ │ ├── frame_100.png │ │ │ ├── frame_101.png
You should replace the path of the video with path of your video in Line 44 of code you want to run: Line 44 of demo.py or demo_csv.py or demo_csv_crop.py
44| file_path = 'IMG_3326.MOV'
Make sure you already run convert.py before:
python convert.py
After you Go to tensorflow2.0-> deep-sort-yolov4, :
I already put pretrained yolov4.weight, you just need to type this code after doing convert:
python demo.py
You will get visualization of your video tracking in .avi format in "deep-sort-yolov4" folder:
Run demo_csv.py:
python demo_csv.py
You will get CSV files "result_tracking.csv" something like this:
Run demo_csv_crop.py:
python demo_csv_crop.py
You will get cropped result in "output_crop" folder something like this: