All Projects → LeonLok → Deep Sort Yolov4

LeonLok / Deep Sort Yolov4

Licence: gpl-3.0
People detection and optional tracking with Tensorflow backend.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Deep Sort Yolov4

Yolov5
YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
Stars: ✭ 19,914 (+6407.84%)
Mutual labels:  object-detection, yolo, yolov3
Bmw Labeltool Lite
This repository provides you with a easy to use labeling tool for State-of-the-art Deep Learning training purposes.
Stars: ✭ 145 (-52.61%)
Mutual labels:  object-detection, yolo, yolov3
Mobilenet Yolo
MobileNetV2-YoloV3-Nano: 0.5BFlops 3MB HUAWEI P40: 6ms/img, YoloFace-500k:0.1Bflops 420KB🔥🔥🔥
Stars: ✭ 1,566 (+411.76%)
Mutual labels:  object-detection, yolo, yolov3
Yolov3
YOLOv3 in PyTorch > ONNX > CoreML > TFLite
Stars: ✭ 8,159 (+2566.34%)
Mutual labels:  object-detection, yolo, yolov3
Yolov3 Tf2
YoloV3 Implemented in Tensorflow 2.0
Stars: ✭ 2,327 (+660.46%)
Mutual labels:  object-detection, yolo, yolov3
Yolo Vehicle Counter
This project aims to count every vehicle (motorcycle, bus, car, cycle, truck, train) detected in the input video using YOLOv3 object-detection algorithm.
Stars: ✭ 28 (-90.85%)
Mutual labels:  object-detection, yolo, yolov3
Yolo label
GUI for marking bounded boxes of objects in images for training neural network Yolo v3 and v2 https://github.com/AlexeyAB/darknet, https://github.com/pjreddie/darknet
Stars: ✭ 128 (-58.17%)
Mutual labels:  object-detection, yolo, yolov3
Yolov3 pytorch
Full implementation of YOLOv3 in PyTorch
Stars: ✭ 570 (+86.27%)
Mutual labels:  object-detection, yolo, yolov3
Pytorch Yolo V3
A PyTorch implementation of the YOLO v3 object detection algorithm
Stars: ✭ 3,148 (+928.76%)
Mutual labels:  object-detection, yolo, yolov3
Object Detection Api
Yolov3 Object Detection implemented as APIs, using TensorFlow and Flask
Stars: ✭ 177 (-42.16%)
Mutual labels:  object-detection, yolo, yolov3
Tensorflow Yolo V3
Implementation of YOLO v3 object detector in Tensorflow (TF-Slim)
Stars: ✭ 862 (+181.7%)
Mutual labels:  object-detection, yolo, yolov3
Yolodet Pytorch
reproduce the YOLO series of papers in pytorch, including YOLOv4, PP-YOLO, YOLOv5,YOLOv3, etc.
Stars: ✭ 206 (-32.68%)
Mutual labels:  object-detection, yolo, yolov3
Yolo annotation tool
Annotation tool for YOLO in opencv
Stars: ✭ 17 (-94.44%)
Mutual labels:  object-detection, yolo, yolov3
Tensornets
High level network definitions with pre-trained weights in TensorFlow
Stars: ✭ 982 (+220.92%)
Mutual labels:  object-detection, yolo, yolov3
Yolo Tf2
yolo(all versions) implementation in keras and tensorflow 2.4
Stars: ✭ 695 (+127.12%)
Mutual labels:  object-detection, yolo, yolov3
Yolo V3 Iou
YOLO3 动漫人脸检测 (Based on keras and tensorflow) 2019-1-19
Stars: ✭ 116 (-62.09%)
Mutual labels:  object-detection, yolo, yolov3
Yolov5 ncnn
🍅 Deploy NCNN on mobile phones. Support Android and iOS. 移动端NCNN部署,支持Android与iOS。
Stars: ✭ 535 (+74.84%)
Mutual labels:  object-detection, yolo, yolov3
Keras Yolov3 Mobilenet
I transfer the backend of yolov3 into Mobilenetv1,VGG16,ResNet101 and ResNeXt101
Stars: ✭ 552 (+80.39%)
Mutual labels:  object-detection, yolo, yolov3
Yolo v3 tutorial from scratch
Accompanying code for Paperspace tutorial series "How to Implement YOLO v3 Object Detector from Scratch"
Stars: ✭ 2,192 (+616.34%)
Mutual labels:  object-detection, yolo, yolov3
Pine
🌲 Aimbot powered by real-time object detection with neural networks, GPU accelerated with Nvidia. Optimized for use with CS:GO.
Stars: ✭ 202 (-33.99%)
Mutual labels:  object-detection, yolo, yolov3

Introduction

This project was inspired by:

I swapped out YOLO v3 for YOLO v4 and added the option for asynchronous processing, which significantly improves the FPS. However, FPS monitoring is disabled when asynchronous processing is used since it isn't accurate.

In addition, I took the algorithm from this paper and implemented it into deep_sort/track.py. The original method for confirming tracks was based simply on the number of times an object has been detected without considering detection confidence, leading to high tracking false positive rates when unreliable detections occur (i.e. low confidence true positives or high confidence false positives). The track filtering algorithm reduces this significantly by calculating the average detection confidence over a set number of detections before confirming a track.

See the comparison video below.

Low confidence track filtering

Comparison Video Link

Navigate to the appropriate folder to use low confidence track filtering. The above video demonstrates the difference.

See the settings section for parameter instructions.

YOLO v3 and YOLO v4 comparison video with Deep SORT

Comparison Video Link

With asynchronous processing

As you can see in the gif, asynchronous processing has better FPS but causes stuttering.

This code only detects and tracks people, but can be changed to detect other objects by changing lines 103 in yolo.py. For example, to detect people and cars, change

if predicted_class != 'person':
    continue

to

if predicted_class not in ('person', 'car'):
    continue

Performance

Real-time FPS with video writing:

  • ~4.3fps with YOLO v3
  • ~10.6fps with YOLO v4

Turning off tracking gave ~12.5fps with YOLO v4.

YOLO v4 performs much faster and appears to be more stable than YOLO v3. All tests were done using an Nvidia GTX 1070 8gb GPU and an i7-8700k CPU.

Quick start

Download and convert the Darknet YOLO v4 model to a Keras model by modifying convert.py accordingly and run:

python convert.py

Then run demo.py:

python demo.py

Settings

Normal Deep SORT

By default, tracking and video writing is on and asynchronous processing is off. These can be edited in demo.py by changing:

tracking = True
writeVideo_flag = True
asyncVideo_flag = False

To change target file in demo.py:

file_path = 'video.webm'

To change output settings in demo.py:

out = cv2.VideoWriter('output_yolov4.avi', fourcc, 30, (w, h))

Deep SORT with low confidence track filtering

This version has the option to hide object detections instead of tracking. The settings in demo.py are

show_detections = True
writeVideo_flag = True
asyncVideo_flag = False

Setting show_detections = False will hide object detections and show the average detection confidence and the most commonly detected class for each track.

To modify the average detection threshold, go to deep_sort/tracker.py and change the adc_threshold argument on line 40. You can also change the number of steps that the detection confidence will be averaged over by changing n_init here.

Training your own models

YOLO v4

See https://github.com/Ma-Dan/keras-yolo4.

Deep SORT

Please note that the tracking model used here is only trained on tracking people, so you'd need to train a model yourself for tracking other objects.

See https://github.com/nwojke/cosine_metric_learning for more details on training your own tracking model.

For those that want to train their own vehicle tracking model, I've created a tool for converting the DETRAC dataset into a trainable format for cosine metric learning and can be found in my object tracking repository here. The tool was created using the earlier mentioned paper as reference with the same parameters.

Dependencies

  • Tensorflow GPU 1.14
  • Keras 2.3.1
  • opencv-python 4.2.0
  • imutils 0.5.3
  • numpy 1.18.2
  • sklearn

Running with Tensorflow 1.14 vs 2.0

Navigate to the appropriate folder and run python scripts.

Conda environment used for Tensorflow 2.0

(see requirements.txt)

  • imutils 0.5.3
  • keras 2.3.1
  • matplotlib 3.2.1
  • numpy 1.18.4
  • opencv-python 4.2.0.34
  • pillow 7.1.2
  • python 3.6.10
  • scikit-learn 0.23.1
  • scipy 1.4.1
  • sklearn 0.19
  • tensorboard 2.2.1
  • tensorflow 2.0.0
  • tensorflow-estimator 2.1.0
  • tensorflow-gpu 2.2.0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].