Closed kyakuno closed 3 years ago
付属のツールでonnxエクスポート可能
python3 tools/export_onnx.py --output-name bytetrack_x_mot17.onnx -f exps/example/mot/yolox_x_mix_det.py -c pretrained/bytetrack_x_mot17.pth.tar
python3 tools/export_onnx.py --output-name bytetrack_x_mot20.onnx -f exps/example/mot/yolox_x_mix_mot20_ch.py -c pretrained/bytetrack_x_mot20.tar
○ Train
公式の手順に従い、mix_data_xxx.py 実行後、ディレクトリ構成を以下のように設定する。
cd datasets/mix_det
ln -s ../mot/train/ mot_train
ln -s ../crowdhuman/CrowdHuman_train/ crowdhuman_train
ln -s ../crowdhuman/CrowdHuman_val/ crowdhuman_val
ln -s ../Cityscapes cp_train
ln -s ../ETHZ/ ethz_train
experimentファイルを、yolox_s_mix_det.pyを参考にして、以下の内容でyolox_tiny_mix_det.pyを準備
$ cat exps/example/mot/yolox_tiny_mix_det.py
# encoding: utf-8
import os
import random
import torch
import torch.nn as nn
import torch.distributed as dist
from yolox.exp import Exp as MyExp from yolox.data import get_yolox_datadir
class Exp(MyExp): def init(self): super(Exp, self).init() self.num_classes = 1 self.depth = 0.33 self.width = 0.375 # -- 変更 self.scale = (0.5, 1.5) # -- 変更 self.exp_name = os.path.split(os.path.realpath(file))[1].split(".")[0] self.enable_mixup = False # -- 追加 self.train_ann = "train.json" self.val_ann = "train.json" self.input_size = (416, 416) # -- 変更 self.test_size = (416, 416) # -- 変更 self.random_size = (10, 20) # -- 変更 self.max_epoch = 80 self.print_interval = 20 self.eval_interval = 5 self.test_conf = 0.001 self.nmsthre = 0.7 self.no_aug_epochs = 10 self.basic_lr_per_img = 0.001 / 64.0 self.warmup_epochs = 1
- Train実行
python3 tools/train.py -f exps/example/mot/yolox_tiny_mix_det.py -d 0 -b 48 --fp16 -o -c pretrained/yolox_tiny_32dot8.pth
- Resume時
python3 tools/train.py -f exps/example/mot/yolox_tiny_mix_det.py -d 0 -b 48 --fp16 -o -c ./YOLOX_outputs/yolox_tiny_mix_det/latest_ckpt.pth.tar --resume
https://github.com/ifzhang/ByteTrack