Giter Site home page Giter Site logo

liyinggang6 / yolov7-tracker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jackwoo0831/yolov7-tracker

0.0 0.0 0.0 98.65 MB

Yolo v7 and several Multi-Object Tracker(SORT, DeepSORT, ByteTrack, BoT-SORT, etc.) in VisDrone2019 Dataset. It uses a unified style and integrated tracker for easy embedding in your own projects.

License: GNU General Public License v3.0

Shell 0.43% Python 95.09% Jupyter Notebook 4.36% Dockerfile 0.12%

yolov7-tracker's Introduction

YOLO v7 + 各种tracker实现多目标跟踪

亮点

  1. 统一代码风格, 对多种tracker重新整理, 详细注释, 方便阅读, 适合初学者
  2. 多类多目标跟踪
  3. 各种tracker集成在一个文件夹"./tracker/"内, 方便移植到其他detector.

集成的tracker:

SORT,
DeepSORT,
ByteTrack(ECCV2022),
DeepMOT(CVPR2020),
BoT-SORT(arxiv2206),
UAVMOT(CVPR2022)

TODO

  • 集成UAVMOT(CVPR2022)
  • 达到更好的结果(缓解类别不平衡, 小目标等等)...
  • MOT challenge数据集
  • 更换Re-ID模型

效果

在VisDrone2019-MOT train训练约10 epochs, 采用YOLO v7 w6结构, COCO预训练模型基础上训练. GPU: single Tesla A100, 每个epoch约40min.
在VisDrone2019-MOT test dev测试, 跟踪所有的类别.

YOLO v7 VisDrone训练完模型:

链接:https://pan.baidu.com/s/1m13Q8Lx_hrPVFZI6lLDrWQ 提取码:ndkf

Tracker MOTA IDF1 IDS fps
SORT 26.4 36.4 3264 12.2
DeepSORT 12.1 26.9 3860 12.4
ByteTrack 25.1 40.8 1590 14.32
DeepMOT 15.0 24.8 3666 7.64
BoT-SORT 23.0 41.4 1014 5.41
UAVMOT 25.0 40.5 1644 18.56

fps具有一定的随机性

gif

环境配置

  • python=3.7.0 pytorch=1.7.0 torchvision=0.8.0 cudatoolkit=11.0
  • py-motmetrics (pip install motmetrics)
  • cython-bbox (pip install cython_bbox)
  • opencv

训练

训练遵循YOLO v7的训练方式, 数据集格式可以参照YOLO v5 train custom data
即数据集文件遵循

class x_center y_center width height

其中x_center y_center width height必须是归一化的.
如果您训练VisDrone数据集, 可以直接调用:

python tools/convert_VisDrone_to_yolov2.py --split_name VisDrone2019-MOT-train --generate_imgs

需要您修改一些路径变量.

准备好数据集后, 假如训练YOLO v7-w6模型(single GPU):

python train_aux.py --dataset visdrone --workers 8 --device <$GPU_id$> --batch-size 16 --data data/visdrone_all.yaml --img 1280 1280 --cfg cfg/training/yolov7-w6.yaml --weights <$YOLO v7 pretrained model path$> --name yolov7-w6-custom --hyp data/hyp.scratch.custom.yaml

更多训练信息参考YOLO v7

跟踪

model_path 参数为训练后的detector model, 假设路径为 runs/train/yolov7-w6-custom4/weights/best.pt

SORT :

python tracker/track.py --dataset visdrone --data_format origin --tracker sort --model_path runs/train/yolov7-w6-custom4/weights/best.pt

DeepSORT:

python tracker/track.py --dataset visdrone --data_format origin --tracker deepsort --model_path runs/train/yolov7-w6-custom4/weights/best.pt

ByteTrack:

python tracker/track.py --dataset visdrone --data_format origin --tracker bytetrack --model_path runs/train/yolov7-w6-custom4/weights/best.pt 

DeepMOT:

python tracker/track.py --dataset visdrone --data_format origin --tracker deepmot --model_path runs/train/yolov7-w6-custom4/weights/best.pt

BoT-SORT:

python tracker/track.py --dataset visdrone --data_format origin --tracker botsort --model_path runs/train/yolov7-w6-custom4/weights/best.pt

UAVMOT

python tracker/track.py --dataset visdrone --data_format origin --tracker uavmot --model_path runs/train/yolov7-w6-custom4/weights/best.pt

您也可以通过增加

--save_images --save_videos

来控制保存跟踪结果的图片与视频.

将./tracker应用于其他detector

只需保证detector的输出格式为

(batch_size, num_objects, x_center, y_center, width, height, obj_conf, category)

或经典的yolo格式

(batch_size, num_objects, x_center, y_center, width, height, obj_conf, category_conf0, category_conf1, category_conf2, ...)

注意: 推理的时候batch_size要求为1.

更多运行命令参考 run_yolov7.txt文件

yolov7-tracker's People

Contributors

jackwoo0831 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.