重识别代码执行记录

Person reid代码记录

reid-strong-baseline

代码地址:https://github.com/michuanhaohao/reid-strong-baseline

服务器地址:/mnt/data/scm/reid/reid-strong-baseline

这个reid的代码有很强的参考性,中间提到了很多的tricks,可以使用到各种新的数据集上

Market1501训练,使用交叉熵损失和三元组损失

# 原始训练代码
python3 tools/train.py --config_file='configs/softmax_triplet.yml' MODEL.DEVICE_ID "('your device id')" DATASETS.NAMES "('market1501')" OUTPUT_DIR "('your path to save checkpoints and logs')"
# 我的代码
python tools/train.py --config_file='configs/softmax_triplet_supermicro.yml' MODEL.DEVICE_ID "('0')" DATASETS.NAMES "('market1501')" OUTPUT_DIR "/mnt/data/scm/reid/reid-strong-baseline/logs/mark1501"
id: 8571 0号卡

Duke训练,使用交叉熵损失、三元组损失和centerloss

python3 tools/train.py --config_file='configs/softmax_triplet_with_center.yml' MODEL.DEVICE_ID "('your device id')" DATASETS.NAMES "('dukemtmc')" OUTPUT_DIR "('your path to save checkpoints and logs')"

python tools/train.py --config_file='configs/softmax_triplet_with_center_supermicro.yml' MODEL.DEVICE_ID "('0')" DATASETS.NAMES "('dukemtmc')" OUTPUT_DIR "('/mnt/data/scm/reid/reid-strong-baseline/logs/duke')"
id: 8316 0号卡

reid代码执行流程

行人重识别的代码训练结束,代码保存在以下目录中

duke: /mnt/data/scm/reid/reid-strong-baseline/logs/duke

market1501:/mnt/data/scm/reid/reid-strong-baseline/logs/mark1501

以下是原文的内容:

You can test your model’s performance directly by running these commands in .shfiles after your custom modification. You can also change the configuration to determine which feature of BNNeck is used and whether the feature is normalized (equivalent to use Cosine distance or Euclidean distance) for testing.

Please replace the data path of the model and set the PRETRAIN_CHOICE as ‘self’ to avoid time consuming on loading ImageNet pretrained model.

  1. Test with Euclidean distance using feature before BN without re-ranking,.

    python3 tools/test.py --config_file='configs/softmax_triplet_with_center.yml' MODEL.DEVICE_ID "('your device id')" DATASETS.NAMES "('market1501')" TEST.NECK_FEAT "('before')" TEST.FEAT_NORM "('no')" MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('your path to trained checkpoints')"
    # 自己的测试代码
    CUDA_VISIBLE_DEVICES=1  python tools/test.py --config_file='configs/softmax_triplet_supermicro.yml' MODEL.DEVICE_ID "('0')" DATASETS.NAMES "('market1501')" TEST.NECK_FEAT "('before')" TEST.FEAT_NORM "('no')" MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('/mnt/data/scm/reid/reid-strong-baseline/logs/mark1501/resnet50_model_120.pth')"
    
    # 虚拟环境 reid
    python tools/test.py --config_file='configs/softmax_triplet_supermicro.yml' MODEL.DEVICE_ID "('0')" DATASETS.NAMES "('market1501')" TEST.NECK_FEAT "('before')" TEST.FEAT_NORM "('no')" MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('/mnt/data/scm/reid/reid-strong-baseline/logs/mark1501/resnet50_optimizer_120.pth')"
    
    成功执行!
    CUDA_VISIBLE_DEVICES=1  python tools/test.py --config_file='configs/softmax_triplet_supermicro.yml' MODEL.DEVICE_ID "('0')" DATASETS.NAMES "('market1501')" TEST.NECK_FEAT "('before')" TEST.FEAT_NORM "('no')" MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('/mnt/data/scm/reid/reid-strong-baseline/logs/mark1501/resnet50_model_120.pth')"
    
    CUDA_VISIBLE_DEVICES=1  python tools/test.py --config_file='configs/softmax_triplet_with_center_supermicro.yml' MODEL.DEVICE_ID "('0')" DATASETS.NAMES "('dukemtmc')" TEST.NECK_FEAT "('before')" TEST.FEAT_NORM "('no')" MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('/mnt/data/scm/reid/reid-strong-baseline/logs/duke/resnet50_model_120.pth')"
    
    
  2. Test with Cosine distance using feature after BN without re-ranking,.

    python3 tools/test.py --config_file='configs/softmax_triplet_with_center.yml' MODEL.DEVICE_ID "('your device id')" DATASETS.NAMES "('market1501')" TEST.NECK_FEAT "('after')" TEST.FEAT_NORM "('yes')" MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('your path to trained checkpoints')"
    
  3. Test with Cosine distance using feature after BN with re-ranking

    python3 tools/test.py --config_file='configs/softmax_triplet_with_center.yml' MODEL.DEVICE_ID "('your device id')" DATASETS.NAMES "('dukemtmc')" TEST.NECK_FEAT "('after')" TEST.FEAT_NORM "('yes')" MODEL.PRETRAIN_CHOICE "('self')" TEST.RE_RANKING "('yes')" TEST.WEIGHT "('your path to trained checkpoints')"
    

车辆重识别基线

https://github.com/DTennant/reid_baseline_with_syncbn

代码运行

由于服务器的卡比较少,这里只测试一个GPU下的效果,首先要进行编译,环境还是使用reid

cd evaluate/eval_cylib && make

数据集位置:

https://github.com/PKU-IMRE/VERI-Wild

https://github.com/JDAI-CV/VeRidataset

百度网盘地址

image-20201108161117998

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

肆十二

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值