# Prepare dataset For MOT17 

# python3 fast_reid/datasets/generate_mot_patches.py --data_path /data/cvprw/AIC23/dataset --mot 17

# Train re-id

# python3 fast_reid/tools/train_net.py --config-file ./fast_reid/configs/MOT17/sbs_S50.yml MODEL.DEVICE "cuda:0"

# python3 fast_reid/tools/train_net.py --config-file ./fast_reid/configs/AIC23/sbs_S50.yml MODEL.DEVICE "cuda:0"

# python fast_reid/tools/train_net.py --config-file ./fast_reid/configs/AIC23/sbs_S50.yml --num-gpus 2


# Tracking
# -c : ckpt for detection
# ReID
    # parser.add_argument("--with-reid", dest="with_reid", default=False, action="store_true", help="test mot20.")
    # parser.add_argument("--fast-reid-config", dest="fast_reid_config", default=r"fast_reid/configs/MOT17/sbs_S50.yml", type=str, help="reid config file path")
    # parser.add_argument("--fast-reid-weights", dest="fast_reid_weights", default=r"pretrained/mot17_sbs_S50.pth", type=str,help="reid config file path")
    # parser.add_argument('--proximity_thresh', type=float, default=0.5, help='threshold for rejecting low overlap reid matches')
    # parser.add_argument('--appearance_thresh', type=float, default=0.25, help='threshold for rejecting low appearance similarity reid matches')


# Detection using json

# python3 tools/detection.py json --path /data/cvprw/AIC23/dataset/coco_AIC23/val/val.json -f /data/cvprw/AIC23/detect/ByteTrack/exps/example/mot/yolox_x_mot17_half.py -c bytetrack_x_mot17.pth.tar --with-reid --fast-reid-config /data/cvprw/AIC23/BoT-SORT/fast_reid/configs/AIC23/sbs_S50.yml --fast-reid-weights mot17_sbs_S50.pth --fuse-score --fp16 --fuse --save_result --track_buffer 120


# Demo - origin

# python3 tools/demo.py video --path ./test.mp4 -f /data/cvprw/AIC23/detect/ByteTrack/exps/example/mot/yolox_x_mot17_half.py -c /data/cvprw/AIC23/BoT-SORT/bytetrack_x_mot17.pth.tar --with-reid --fast-reid-config /data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S50/config.yaml --fast-reid-weights /data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S50/model_0058.pth --fuse-score --fp16 --fuse --save_result --track_buffer 120

# Demo - only re-id origin

# python3 tools/demo.py test.mp4 /data/cvprw/AIC23/detect/experiments/yolox/yolox_x.py /data/cvprw/AIC23/detect/experiments/yolox/epoch_300.pth --with-reid --fast-reid-config /data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S50/config.yaml --fast-reid-weights /data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S50/model_0058.pth --fuse-score --out ./run_demo

# Demo - ours

# python3 tools/demo.py ./test.mp4 /data/cvprw/AIC23/detect/experiments/yolox/yolox_x.py /data/cvprw/AIC23/detect/experiments/yolox/epoch_300.pth --with-reid --fast-reid-config /data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S50_seg/config.yaml --fast-reid-weights /data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S50_seg/model_0058.pth --fuse-score --track_buffer 900 --out ./run_demo


# interpolation

# python3 tools/interpolation.py --txt_path /data/cvprw/AIC23/tracking/segsort/run_demo/track_vis/2023_03_02_17_01_56.txt --save_path ./interpolated --n_dti 1000



# Demo_multicam - only re-id origin


python3 tools/demo_multicam.py \
/data/cvprw/AIC23/dataset/RAW_VID/val/S005_small \
/data/cvprw/AIC23/detect/experiments/yolox/yolox_x.py \
/data/cvprw/AIC23/detect/experiments/yolox/epoch_300.pth \
--with-reid --fast-reid-config \
/data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S101/config.yaml \
--fast-reid-weights \
/data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S101/model_0099.pth \
--fuse-score --out ./run_demo

# python3 tools/demo_multicam_ensemble.py \
# /data/cvprw/AIC23/dataset/RAW_VID/val/S005_small \
# /data/cvprw/AIC23/detect/experiments/yolox/yolox_x.py \
# /data/cvprw/AIC23/detect/experiments/yolox/epoch_300.pth \
# --with-reid --fast-reid-config \
# /data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S101/config.yaml \
# --fast-reid-weights \
# /data/cvprw/AIC23/BoT-SORT/logs/AIC23/sbs_S101/model_0118.pth \
# --fuse-score --out ./run_demo