Repository
DeepSort-Yolo-V4-with-CSV-Logging-and-Picture-Cropping
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.
README
Deep Sort Yolo V4 with CSV Logging and Picture Cropping
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.
Original Repository
LeonLok Deep-SORT-Yolov4
How to use
If you use conda, you can use my "requirement.txt" by type:
conda create --name --file requirements.txt
Go to tensorflow2.0-> deep-sort-yolov4
cd tensorflow2.0/deep-sort-yolov4/
Directory Trees of the Project
└── 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
If you want to try with your own video:
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
How to Visualize Tracking and have video output
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:

How to Visualize Tracking and Output CSV Tracking Files
Run demo_csv.py:
python demo_csv.py
You will get CSV files "result_tracking.csv" something like this:

How to Output CSV Files and Get the Cropped Tracking Result
Run demo_csv_crop.py:
python demo_csv_crop.py
You will get cropped result in "output_crop" folder something like this:

