BoT-SORT: 강력한 협회의 다중 보행자 추적
니르 아하론, 로이 오르페이그, 벤자이온 보브로프스키
https://arxiv.org/abs/2206.14651
다중 객체 추적(MOT)의 목표는 각 객체에 대한 고유 식별자를 유지하면서 장면의 모든 객체를 감지하고 추적하는 것입니다. 본 논문에서는 모션 및 외관 정보의 장점과 카메라 모션 보상, 보다 정확한 칼만 필터 상태 벡터를 결합할 수 있는 새롭고 강력한 최신 추적기를 제시합니다. 새로운 추적기인 BoT-SORT 및 BoT-SORT-ReID는 모든 주요 MOT 측정 항목인 MOTA, IDF1 및 HOTA 측면에서 MOT17 및 MOT20 테스트 세트 모두에서 MOTChallenge[29, 11] 데이터 세트에서 1위를 차지했습니다. MOT17의 경우: 80.5 MOTA, 80.2 IDF1 및 65.0 HOTA가 달성되었습니다.
트래커 | 모타 | IDF1 | 호타 |
---|---|---|---|
봇 정렬 | 80.6 | 79.5 | 64.6 |
BoT-SORT-ReID | 80.5 | 80.2 | 65.0 |
트래커 | 모타 | IDF1 | 호타 |
---|---|---|---|
봇 정렬 | 77.7 | 76.3 | 62.6 |
BoT-SORT-ReID | 77.8 | 77.5 | 63.3 |
코드는 Ubuntu 20.04에서 테스트되었습니다.
BoT-SORT 코드는 ByteTrack 및 FastReID를 기반으로 합니다.
더 많은 설정 옵션을 보려면 해당 설치 가이드를 방문하세요.
Step 1. Conda 환경을 생성하고 pytorch를 설치합니다.
conda create -n botsort_env python=3.7
conda activate botsort_env
2단계. pytorch.org에서 토치와 일치하는 torchvision을 설치합니다.
코드는 torch 1.11.0+cu113 및 torchvision==0.12.0을 사용하여 테스트되었습니다.
3단계. BoT-SORT를 설치합니다.
git clone https://github.com/NirAharon/BoT-SORT.git
cd BoT-SORT
pip3 install -r requirements.txt
python3 setup.py develop
4단계. pycocotools를 설치합니다.
pip3 install cython ; pip3 install ' git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI '
5단계. 기타
# Cython-bbox
pip3 install cython_bbox
# faiss cpu / gpu
pip3 install faiss-cpu
pip3 install faiss-gpu
공식 웹사이트에서 MOT17과 MOT20을 다운로드하세요. 그리고 이를 다음과 같은 구조로 배치합니다.
<dataets_dir>
│
├── MOT17
│ ├── train
│ └── test
│
└── MOT20
├── train
└── test
ReID를 교육하려면 다음과 같이 감지 패치를 생성해야 합니다.
cd < BoT-SORT_dir >
# For MOT17
python3 fast_reid/datasets/generate_mot_patches.py --data_path < dataets_dir > --mot 17
# For MOT20
python3 fast_reid/datasets/generate_mot_patches.py --data_path < dataets_dir > --mot 20
데이터 세트를 FastReID export FASTREID_DATASETS=<BoT-SORT_dir>/fast_reid/datasets
에 연결합니다. 설정하지 않은 경우 기본값은 fast_reid/datasets
입니다.
다음과 같이 학습된 모델을 다운로드하여 'pretrained' 폴더에 저장합니다.
<BoT-SORT_dir>/pretrained
우리는 YOLOX 객체 감지를 위한 MOT17, MOT20 및 절제 연구에 대해 교육된 공개적으로 사용 가능한 ByteTrack 모델 동물원을 사용했습니다.
훈련된 ReID 모델은 MOT17-SBS-S50, MOT20-SBS-S50에서 다운로드할 수 있습니다.
다중 클래스 MOT의 경우 COCO(또는 사용자 정의 가중치)에 대해 훈련된 YOLOX 또는 YOLOv7을 사용합니다.
'데이터 준비' 섹션에 설명된 대로 MOT ReID 데이터 세트를 생성한 후.
cd < BoT-SORT_dir >
# For training MOT17
python3 fast_reid/tools/train_net.py --config-file ./fast_reid/configs/MOT17/sbs_S50.yml MODEL.DEVICE " cuda:0 "
# For training MOT20
python3 fast_reid/tools/train_net.py --config-file ./fast_reid/configs/MOT20/sbs_S50.yml MODEL.DEVICE " cuda:0 "
추가 설명 및 옵션은 FastReID 저장소를 참조하세요.
이 부분에서 제작한 txt 파일을 MOTChallenge 홈페이지에 제출하시면 논문과 동일한 결과를 얻으실 수 있습니다.
추적 매개변수를 주의 깊게 조정하면 성능이 향상될 수 있습니다. 이 논문에서는 ByteTrack의 보정을 적용합니다.
cd < BoT-SORT_dir >
python3 tools/track.py < dataets_dir/MOT 17> --default-parameters --with-reid --benchmark " MOT17 " --eval " test " --fp16 --fuse
python3 tools/interpolation.py --txt_path < path_to_track_result >
cd < BoT-SORT_dir >
python3 tools/track.py < dataets_dir/MOT 20> --default-parameters --with-reid --benchmark " MOT20 " --eval " test " --fp16 --fuse
python3 tools/interpolation.py --txt_path < path_to_track_result >
cd < BoT-SORT_dir >
# BoT-SORT
python3 tools/track.py < dataets_dir/MOT 17> --default-parameters --benchmark " MOT17 " --eval " val " --fp16 --fuse
# BoT-SORT-ReID
python3 tools/track.py < dataets_dir/MOT 17> --default-parameters --with-reid --benchmark " MOT17 " --eval " val " --fp16 --fuse
--default-parameters 플래그를 전달 하지 않고도 다른 매개변수를 사용할 수 있습니다.
열차 및 검증 세트를 평가하려면 TrackEval의 공식 MOTChallenge 평가 코드를 사용하는 것이 좋습니다.
# For all the available tracking parameters, see:
python3 tools/track.py -h
--default-parameters 플래그를 전달 하지 않고도 다른 매개변수를 사용할 수 있습니다.
열차 및 검증 세트를 평가하려면 TrackEval의 공식 MOTChallenge 평가 코드를 사용하는 것이 좋습니다.
# For all the available tracking parameters, see:
python3 tools/track_yolov7.py -h
BoT-SORT(-ReID) 기반 YOLOX 및 다중 클래스를 사용한 데모입니다.
cd < BoT-SORT_dir >
# Original example
python3 tools/demo.py video --path < path_to_video > -f yolox/exps/example/mot/yolox_x_mix_det.py -c pretrained/bytetrack_x_mot17.pth.tar --with-reid --fuse-score --fp16 --fuse --save_result
# Multi-class example
python3 tools/mc_demo.py video --path < path_to_video > -f yolox/exps/example/mot/yolox_x_mix_det.py -c pretrained/bytetrack_x_mot17.pth.tar --with-reid --fuse-score --fp16 --fuse --save_result
BoT-SORT(-ReID) 기반 YOLOv7 및 다중 클래스를 사용한 데모입니다.
cd < BoT-SORT_dir >
python3 tools/mc_demo_yolov7.py --weights pretrained/yolov7-d6.pt --source < path_to_video/images > --fuse-score --agnostic-nms (--with-reid)
우리의 카메라 모션 보상 모듈은 현재 Python 버전이 없는 VideoStab Global Motion Estimation의 OpenCV contrib C++ 버전을 기반으로 합니다.
모션 파일은 GMC 폴더에 있는 'VideoCameraCorrection'이라는 C++ 프로젝트를 사용하여 생성할 수 있습니다.
생성된 파일은 추적기에서 사용할 수 있습니다.
또한, Python 기반의 움직임 추정 기술이 사용 가능하며 다음을 전달하여 선택할 수 있습니다.
'--cmc-방법' <파일 | 오브 | ecc>를 deco.py 또는 track.py로 변환합니다.
@article{aharon2022bot,
title={BoT-SORT: Robust Associations Multi-Pedestrian Tracking},
author={Aharon, Nir and Orfaig, Roy and Bobrovsky, Ben-Zion},
journal={arXiv preprint arXiv:2206.14651},
year={2022}
}
코드, 아이디어 및 결과의 상당 부분은 ByteTrack, StrongSORT, FastReID, YOLOX 및 YOLOv7에서 차용되었습니다. 그들의 훌륭한 작업에 감사드립니다!