LoginSignup
1
3

More than 1 year has passed since last update.

オブジェクトトラッキング(DeepSORT)をJetson Nanoで動かす

Last updated at Posted at 2021-10-11

Jetson Nano2Gを使って、オブジェクトトラッキング(DeepSORT)ができるように実装していきます
Jetson Nano4Gでも同様の手順で実装できます

環境

・YOLOv5 https://github.com/ultralytics/yolov5
・Jetson Nano2G(4G) SWAPファイル設定と冷却ファン必須
・JetPack 4.6
・OpenCV 4.5.1
・PyTorch 1.9.0
・TorchVision 0.10.0

更新履歴

2021年10月 初版

このシリーズのゴール

Jetson Nano2G(4G) でUSBカメラを使って
オブジェクトトラッキング(DeepSORT)を動かします

DeepSORTの論文こちら
https://arxiv.org/pdf/1703.07402v1.pdf

1.準備

Jetson Nano2G(4G)でYOLOv5が動く環境が構築されていること
環境構築ができていれば簡単です

環境構築ができてない場合はこのシリーズを参照
YOLOv5をJetson Nano2G(4G)で動かして、物体を検知するから応用まで その1
YOLOv5をJetson Nano2G(4G)で動かして、物体を検知するから応用まで その2
YOLOv5をJetson Nano2G(4G)で動かして、物体を検知するから応用まで その3
YOLOv5をJetson Nano2G(4G)で動かして、物体を検知するから応用まで その4

2.実装

クローンします

git clone --recurse-submodules https://github.com/mikel-brostrom/Yolov5_DeepSort_Pytorch.git

環境が崩れてしまわないように
requirements.txtをコメントアウトします

# pip install -r requirements.txt

# base ----------------------------------------

#matplotlib>=3.2.2
#numpy>=1.18.5
#opencv-python>=4.1.2
#Pillow
#PyYAML>=5.3.1
#scipy>=1.4.1
#torch>=1.7.0
#torchvision>=0.8.1
#tqdm>=4.41.0

# plotting ------------------------------------

#seaborn>=0.11.0
#pandas

# deep_sort -----------------------------------

easydict

とりあえず動かしてみます

python3 track.py --source 0 --show-vid

ここからは特定の対象物だけで動かしてみます
YOLOv5 と同じように --class で指定できます
人の場合は

python3 track.py --source 0 --show-vid --class 0

実行結果です

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3