Git Product home page Git Product logo

naic2020_reid's Introduction

naic2020_reid

naic 2020 AI+ 行人重识别项目

方案说明

建立验证集

使用 ./divided_dataset.py 统计NAIC2020 reid的数据集,包括train, test/gallery, test/query中的green以及normal image 数量

normal image

green image

green image

normal2 image

gallery_green_num gallery_normal_num query_green_num query_normal_num train_green_num train_normal_num
4149 36317 1376 1524 39446 33378

其中,gallery_normal_num > train_normal_num, 因此不能从train 数据集中提取 normal image来建立 val 数据集。我们从测试集中提取 normal image 放入 val 的 gallery中充当干扰数据。具体code在./mics/make_eval_dataset.py

具体策略

naic2020示例程序 的基础上, 我们从以下几个方面进行了测试

数据处理 数据增强 backbone loss solver attention
去除长尾数据 Mixup se-resnet101-a CurricularFace SGD selective kernel
naic mean std 替换imagenet mean std random patch efficientnet TripletLoss with margin centralized_gradient_SGD cbam
big size 384 * 192 densenet AMSoftmax centralized_gradient_Ranger non_local
AutoAugment inceptionv4

其中比较多无效的尝试,下面我们仅列出有效的方法在A榜中的得分比较。(其中baseline 代表naic2020示例程序中的参数配置)

  • baseline 0.468
  • 加入niac 2019 数据集到train数据集,且去掉center loss 0.558
  • 替换baseline中的数据增广策略为AutoAugment 0.598
  • reranking parameter使用粒子群优化搜索超参数 0.611

最终,在B榜采用的方案为上述三种方法的综合: 即加入2019数据集 + AutoAugment + PSO reranking, 模型存放在./ckpt/resnet101_ibn_a.pth, 使用的参数配置文件./configs/naic_round2_model_a.yml

复现

1.下载repo以及安装requirement

git clone https://github.com/ZhuangLii/naic2020_reid.git
pip install -r requirement.txt

2.下载模型

百度云盘

链接: https://pan.baidu.com/s/1vTDhroD66HeJ8AvBbyzwMw 提取码: 7p6y

md5码:bc2ace16845f002660350daff8d6e517

链接: https://pan.baidu.com/s/1-Rya\_lTaGrTgMbTxA4Vr6w 提取码: pb6c

md5码:04dfefbc4f0b6955fac932b85e13d9f1

将两个 model放在 repo 的 ./ckpt 文件夹下。

3.处理数据 在repo下,建立如下结构的data文件夹

data
|
|-----train
	|-------label.txt
	|-------images
|-----test
	|-------gallery_a
	|-------query_a

参考以下代码,将train-images folder中加入naic2019 和naic2020的train数据,2019数据为2019_xxxxxx.png, 2020数据为2020_xxxxxx.png

cd /path/to/naic2020/train_dataset/images/
ls | awk '{print "mv "$1" 2020_"$1}' | sh
mv *.png /path/to/repo/data/train/images
cd /path/to/naic2019/train_dataset/images/
ls | awk '{print "mv "$1" 2019_"$1}' | sh
mv *.png /path/to/repo/data/train/images/
mv /path/to/naic2020/test/query/*.png /path/to/data/test/query_a/
mv /path/to/naic2020/test/gallery/*.png /path/to/data/test/gallery_a/
cd /path/to/repo/
mv ./mics/2019_2020_merge_label.txt ./data/train/label.txt
  1. train + test 复现
sh run.sh

训练log位置./log/train_log.txt

测试log位置./log/test_log.txt

  1. 仅 test 复现
sh run_sh_local.sh

naic2020_reid's People

Contributors

zhuanglii avatar zhuangjunfei avatar

Stargazers

PuF avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.