1. Problem
按照PySOT项目官方给出的测试指令执行:
cd experiments/siamrpn_r50_l234_dwxcorr
python -u ../../tools/test.py \
--snapshot model.pth \ # model path
--dataset VOT2018 \ # dataset name
--config config.yaml # config file
会因为路径问题而报错,例如:
AssertionError: /home/xxx/pysot/experiments/siamrpn_r50_l234_dwxcorr/Basketball/img/0001.jpg
2. Solution
- 修改源文件
pysot/toolkit/datasets/video.py
:
# 将第18行的:
self.img_names = [os.path.join(os.path.abspath(root), os.path.abspath(x)) for x in img_names]
# 修改为:
self.img_names = [os.path.join(os.path.abspath(root), x) for x in img_names]
- 修改之后,就可进行测试,例如:
cd experiments/siamrpn_r50_l234_dwxcorr
python -u ../../tools/test.py --snapshot model.pth --dataset OTB100 --config config.yaml --vis