← 开源
GeekAlexis

FastMOT

High-performance multiple object tracking based on YOLO, Deep SORT, and KLT 🚀

ApplicationsObject detectionPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
1.22k
Star
253
Fork
+-2
本周
9
贡献者
创建于 2020-01-30 · 更新于 2026-10-15 · 今日第 11099 名
主要开发者
GeekAlexisWeiyunJiangFruchtzwerg94

GeekAlexis/FastMOT 排名第 11,099,有 1,219 个星标。

同类别比较

GeekAlexis/FastMOT 排名第 11,099,此处有 8 个同类条目;aTrainTranscription/aTrain 排名第 11,102。

同类别比较
名称排名指标
mcmonkeyprojects/sd-dynamic-thresholding11,079
语言:
Python
星标数:
1,224
分叉数:
108
简介:
Dynamic Thresholding (CFG Scale Fix) for Stable Diffusion (SwarmUI, ComfyUI, and Auto WebUI)
GoogleCloudPlatform/genmedia-creative-studio11,082
语言:
Jupyter Notebook
星标数:
1,223
分叉数:
376
简介:
GenMedia Creative Studio is a generative media user experience highlighting the use of Gemini, Gemini Omni, Veo, Gemini Image 🍌, Gemini TTS, Chirp 3, Lyria and other generative media APIs on Google Cloud.
ardha27/AI-Song-Cover-RVC11,089
语言:
Jupyter Notebook
星标数:
1,221
分叉数:
162
简介:
All-in-one RVC song cover toolkit for Google Colab: pull audio from YouTube, separate vocals, train a model, and run inference.
engcang/SLAM-application11,091
语言:
C++
星标数:
1,221
分叉数:
156
简介:
LeGO-LOAM, LIO-SAM, LVI-SAM, FAST-LIO2, Faster-LIO, VoxelMap, R3LIVE, Point-LIO, KISS-ICP, DLO, DLIO, Ada-LIO, PV-LIO, SLAMesh, ImMesh, FAST-LIO-MULTI, M-LOAM, LOCUS, SLICT, MA-LIO, CT-ICP, GenZ-ICP, iG-LIO, SR-LIO application and comparison on Gazebo and real-world datasets. Installation and config files are provided.
aTrainTranscription/aTrain11,102
语言:
Python
星标数:
1,218
分叉数:
93
简介:
A GUI tool for offline transcription of speech recordings, including speaker diarization, utilizing state-of-the-art machine learning models.
yuezk/chatgpt-mirror11,108
语言:
JavaScript
星标数:
1,217
分叉数:
308
简介:
A mirror of ChatGPT based on the gpt-3.5-turbo model.
farzaa/DeepLeague11,127
语言:
Python
星标数:
1,211
分叉数:
178
简介:
(Open Source) Computer Vision + Deep Learning + League of Legends
modal-labs/quillman11,130
语言:
Python
星标数:
1,211
分叉数:
160
简介:
A voice chat app
关键参数与规格
关键参数与规格
参数值
语言Python
类别Applications
子类别Object detection
关键词Computer vision
星标数1,219
分叉数253
贡献者9
创建日期2020-01-30
更新日期2026-10-15
1 天星标数0
7 天星标数-2
排名11,099
上次排名18,753
排名变化7,654
7 天星标排名18,336
上次 7 天星标排名18,286
7 天星标排名变化-50
总星标排名9,580
上次总星标排名9,576
总星标排名变化-4
README 摘录

4) Support yolov4-p5 and yolov4-p6 (2021. yolov4-csp/yolov4x-mish/yolov4-csp-swish) (2021. 3) Add DIoU-NMS for postprocessing (2020. 28) Docker container provided for x86 Ubuntu Description FastMOT is a custom multiple object tracker that implements: YOLO detector SSD detector Deep SORT + OSNet ReID KLT tracker Camera motion compensation Two-stage trackers like Deep SORT run detection and feature extraction sequentially, which often becomes a bottleneck. FastMOT significantly speeds up the entire system to run in

**real-time** even on Jetson. Motion compensation improves tracking for scenes with moving camera, where Deep SORT and FairMOT fail. To achieve faster processing, FastMOT only runs the detector and feature extractor every N frames, while KLT fills in the gaps efficiently. FastMOT also re-identifies objects that moved out of frame to keep the same IDs. YOLOv4 was trained on CrowdHuman (82% mAP@0. 5) and SSD's are pretrained COCO models from TensorFlow. Both detection and feature extraction use

the **TensorRT** backend and perform asynchronous inference. In addition, most algorithms, including KLT, Kalman filter, and data association, are optimized using Numba. Note that neither YOLOv4 nor OSNet was trained or finetuned on the MOT20 dataset, so train set results should generalize well. FPS results are obtained on Jetson Xavier NX (20W 2core mode). FastMOT has MOTA scores close to **state-of-the-art** trackers from the MOT Challenge. Increasing N shows small impact on MOTA. Tracking speed can reach

up to **42 FPS** depending on the number of objects. YOLOv4-tiny) are recommended for a more constrained device like Jetson Nano. FPS is expected to be in the range of **50 - 150** on desktop CPU/GPU. Requirements CUDA >= 10 cuDNN >= 7 TensorRT >= 7 OpenCV >= 3. Build and run the docker image: Install for Jetson Nano/TX2/Xavier NX/Xavier Make sure to have JetPack >= 4. 4 installed and run the script: Download models Pretrained OSNet, SSD, and my YOLOv4

ONNX model are included. Build YOLOv4 TensorRT plugin Download VOC dataset for INT8 calibration Only required for SSD (not supported on Ubuntu 20. 04) Usage Image sequence: Video file: USB webcam: MIPI CSI camera: RTSP stream: HTTP stream: Use to visualize, to save output, and for MOT compliant results. Show help message for all options: Note that the first run will be slow due to Numba compilation. To use the FFMPEG backend on x86, set here More options can be

configured in cfg/mot. json Set and that corresponds to the source data or camera configuration (optional). They are required for image sequence, camera sources, and saving txt results. List all configurations for a USB/CSI camera: To swap network, modify under a detector. For example, you can choose from , , or for SSD. If more accuracy is desired and FPS is not an issue, lower . Similarly, raise to speed up tracking at the cost of accuracy. You may also want

to change such that × ≈ 30 Modify to toggle drawing options. All parameters are documented in the API. Track custom classes

常见问题

记录了多少星标和分叉?

GeekAlexis/FastMOT 有 1,219 个星标和 253 个分叉。

仓库排名是多少?

GeekAlexis/FastMOT 排名第 11,099。

记录的语言和类别是什么?

GeekAlexis/FastMOT 有 1,219 个星标,语言为 Python,类别为 Applications。

哪个仓库排名最接近?

GeekAlexis/FastMOT 与 aTrainTranscription/aTrain 比较,后者排名第 11,102,有 1,218 个星标。

README

FastMOT

News

  • (2021.8.17) Support multi-class tracking
  • (2021.7.4) Support yolov4-p5 and yolov4-p6
  • (2021.2.13) Support Scaled-YOLOv4 (i.e. yolov4-csp/yolov4x-mish/yolov4-csp-swish)
  • (2021.1.3) Add DIoU-NMS for postprocessing
  • (2020.11.28) Docker container provided for x86 Ubuntu

Description

FastMOT is a custom multiple object tracker that implements:

  • YOLO detector
  • SSD detector
  • Deep SORT + OSNet ReID
  • KLT tracker
  • Camera motion compensation

Two-stage trackers like Deep SORT run detection and feature extraction sequentially, which often becomes a bottleneck. FastMOT significantly speeds up the entire system to run in real-time even on Jetson. Motion compensation improves tracking for scenes with moving camera, where Deep SORT and FairMOT fail.

To achieve faster processing, FastMOT only runs the detector and feature extractor every N frames, while KLT fills in the gaps efficiently. FastMOT also re-identifies objects that moved out of frame to keep the same IDs.

YOLOv4 was trained on CrowdHuman (82% mAP@0.5) and SSD's are pretrained COCO models from TensorFlow. Both detection and feature extraction use the TensorRT backend and perform asynchronous inference. In addition, most algorithms, including KLT, Kalman filter, and data association, are optimized using Numba.

Performance

Results on MOT20 train set

Detector Skip MOTA IDF1 HOTA MOTP MT ML
N = 1 66.8% 56.4% 45.0% 79.3% 912 274
N = 5 65.1% 57.1% 44.3% 77.9% 860 317

FPS on MOT17 sequences

Sequence Density FPS
MOT17-13 5 - 30 42
MOT17-04 30 - 50 26
MOT17-03 50 - 80 18

Performance is evaluated with YOLOv4 using TrackEval. Note that neither YOLOv4 nor OSNet was trained or finetuned on the MOT20 dataset, so train set results should generalize well. FPS results are obtained on Jetson Xavier NX (20W 2core mode).

FastMOT has MOTA scores close to state-of-the-art trackers from the MOT Challenge. Increasing N shows small impact on MOTA. Tracking speed can reach up to 42 FPS depending on the number of objects. Lighter models (e.g. YOLOv4-tiny) are recommended for a more constrained device like Jetson Nano. FPS is expected to be in the range of 50 - 150 on desktop CPU/GPU.

Requirements

  • CUDA >= 10
  • cuDNN >= 7
  • TensorRT >= 7
  • OpenCV >= 3.3
  • Numpy >= 1.17
  • Scipy >= 1.5
  • Numba == 0.48
  • CuPy == 9.2
  • TensorFlow < 2.0 (for SSD support)

Install for x86 Ubuntu

Make sure to have nvidia-docker installed. The image requires NVIDIA Driver version >= 450 for Ubuntu 18.04 and >= 465.19.01 for Ubuntu 20.04. Build and run the docker image:

# Add --build-arg TRT_IMAGE_VERSION=21.05 for Ubuntu 20.04
# Add --build-arg CUPY_NVCC_GENERATE_CODE=... to speed up build for your GPU, e.g. "arch=compute_75,code=sm_75"
docker build -t fastmot:latest .

# Run xhost local:root first if you cannot visualize inside the container
docker run --gpus all --rm -it -v $(pwd):/usr/src/app/FastMOT -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -e TZ=$(cat /etc/timezone) fastmot:latest

Install for Jetson Nano/TX2/Xavier NX/Xavier

Make sure to have JetPack >= 4.4 installed and run the script:

./scripts/install_jetson.sh

Download models

Pretrained OSNet, SSD, and my YOLOv4 ONNX model are included.

./scripts/download_models.sh

Build YOLOv4 TensorRT plugin

cd fastmot/plugins
make

Download VOC dataset for INT8 calibration

Only required for SSD (not supported on Ubuntu 20.04)

./scripts/download_data.sh

Usage

  python3 app.py --input-uri ... --mot
  • Image sequence: --input-uri %06d.jpg
  • Video file: --input-uri file.mp4
  • USB webcam: --input-uri /dev/video0
  • MIPI CSI camera: --input-uri csi://0
  • RTSP stream: --input-uri rtsp://:@:/
  • HTTP stream: --input-uri http://:@:/

Use --show to visualize, --output-uri to save output, and --txt for MOT compliant results.

Show help message for all options:

  python3 app.py -h

Note that the first run will be slow due to Numba compilation. To use the FFMPEG backend on x86, set WITH_GSTREAMER = False here

More options can be configured in cfg/mot.json

  • Set resolution and frame_rate that corresponds to the source data or camera configuration (optional). They are required for image sequence, camera sources, and saving txt results. List all configurations for a USB/CSI camera:
    v4l2-ctl -d /dev/video0 --list-formats-ext
    
  • To swap network, modify model under a detector. For example, you can choose from SSDInceptionV2, SSDMobileNetV1, or SSDMobileNetV2 for SSD.
  • If more accuracy is desired and FPS is not an issue, lower detector_frame_skip. Similarly, raise detector_frame_skip to speed up tracking at the cost of accuracy. You may also want to change max_age such that max_age × detector_frame_skip ≈ 30
  • Modify visualizer_cfg to toggle drawing options.
  • All parameters are documented in the API.

Track custom classes

FastMOT can be easily extended to a custom class (e.g. vehicle). You need to train both YOLO and a ReID network on your object class. Check Darknet for training YOLO and fast-reid for training ReID. After training, convert weights to ONNX format. The TensorRT plugin adapted from tensorrt_demos is only compatible with Darknet.

FastMOT also supports multi-class tracking. It is recommended to train a ReID network for each class to extract features separately.

Convert YOLO to ONNX

  1. Install ONNX version 1.4.1 (not the latest version)
    pip3 install onnx==1.4.1
    
  2. Convert using your custom cfg and weights
    ./scripts/yolo2onnx.py --config yolov4.cfg --weights yolov4.weights
    

Add custom YOLOv3/v4

  1. Subclass fastmot.models.YOLO like here: https://github.com/GeekAlexis/FastMOT/blob/32c217a7d289f15a3bb0c1820982df947c82a650/fastmot/models/yolo.py#L100-L109
    ENGINE_PATH : Path
        Path to TensorRT engine.
        If not found, TensorRT engine will be converted from the ONNX model
        at runtime and cached for later use.
    MODEL_PATH : Path
        Path to ONNX model.
    NUM_CLASSES : int
        Total number of trained classes.
    LETTERBOX : bool
        Keep aspect ratio when resizing.
    NEW_COORDS : bool
        new_coords Darknet parameter for each yolo layer.
    INPUT_SHAPE : tuple
        Input size in the format `(channel, height, width)`.
    LAYER_FACTORS : List[int]
        Scale factors with respect to the input size for each yolo layer.
    SCALES : List[float]
        scale_x_y Darknet parameter for each yolo layer.
    ANCHORS : List[List[int]]
        Anchors grouped by each yolo layer.
    
    Note anchors may not follow the same order in the Darknet cfg file. You need to mask out the anchors for each yolo layer using the indices in mask in Darknet cfg. Unlike YOLOv4, the anchors are usually in reverse for YOLOv3 and YOLOv3/v4-tiny
  2. Set class labels to your object classes with fastmot.models.set_label_map
  3. Modify cfg/mot.json: set model in yolo_detector_cfg to the added Python class name and set class_ids of interest. You may want to play with conf_thresh based on model performance

Add custom ReID

  1. Subclass fastmot.models.ReID like here: https://github.com/GeekAlexis/FastMOT/blob/32c217a7d289f15a3bb0c1820982df947c82a650/fastmot/models/reid.py#L50-L55
    ENGINE_PATH : Path
        Path to TensorRT engine.
        If not found, TensorRT engine will be converted from the ONNX model
        at runtime and cached for later use.
    MODEL_PATH : Path
        Path to ONNX model.
    INPUT_SHAPE : tuple
        Input size in the format `(channel, height, width)`.
    OUTPUT_LAYOUT : int
        Feature dimension output by the model.
    METRIC : {'euclidean', 'cosine'}
        Distance metric used to match features.
    
  2. Modify cfg/mot.json: set model in feature_extractor_cfgs to the added Python class name. For more than one class, add more feature extractor configurations to the list feature_extractor_cfgs. You may want to play with max_assoc_cost and max_reid_cost based on model performance

Citation

If you find this repo useful in your project or research, please star and consider citing it:

@software{yukai_yang_2020_4294717,
 author       = {Yukai Yang},
 title        = {{FastMOT: High-Performance Multiple Object Tracking Based on Deep SORT and KLT}},
 month        = nov,
 year         = 2020,
 publisher    = {Zenodo},
 version      = {v1.0.0},
 doi          = {10.5281/zenodo.4294717},
 url          = {https://doi.org/10.5281/zenodo.4294717}
}
排名相邻
同类项目