- 配置环境
Linux系统
Python3
pytorch >=1.2.0
torchvision >= 0.4.0
numpy
sklearn
yacs
tqdm
git clone https://github.com/PyRetri/PyRetri.git
cd PyRetri
python setup.py
-
准备数据集
Oxford
CUB-200-2011
indoor
caltech101
Market1501
DukeMTMC-reID -
切割数据集
python main/split_dataset.py -d ./data/caltech101/ -sf main/split_file/caltech_split.txt
python main/split_dataset.py -d ./data/cbir/ -sf main/split_file/oxford_split.txt
python main/split_dataset.py -d ./data/cub_200_2011/ -sf main/split_file/cub_split.txt
python main/split_dataset.py -d ./data/indoor/ -sf main/split_file/indoor_split.txt
- 生成json文件
caltech101_gallery
python main/make_data_json.py -d ./data/caltech101/gallery/ -sp data_jsons/caltech_gallery.json -t general
caltech101_query
python main/make_data_json.py -d ./data/caltech101/query/ -sp data_jsons/caltech_query.json -t general
indoor gallery
python main/make_data_json.py -d ./data/indoor/gallery/ -sp data_jsons/indoor_gallery.json -t general
indoor query
python main/make_data_json.py -d ./data/indoor/query/ -sp data_jsons/indoor_query.json -t general
cub_200_2011 gallery
python main/make_data_json.py -d ./data/cub_200_2011/gallery/ -sp data_jsons/cub_200_2011_gallery.json -t general
cub_200_2011 query
python main/make_data_json.py -d ./data/cub_200_2011/query/ -sp data_jsons/cub_200_2011_query.json -t general
oxford gallery
python main/make_data_json.py -d ./data/cbir/oxford/gallery/ -sp data_jsons/oxford_gallery.json -t oxford -gt /data/cbir/oxford/gt/
oxford query
python main/make_data_json.py -d ./data/cbir/oxford/query/ -sp data_jsons/oxford_query.json -t oxford -gt /data/cbir/oxford/gt/
market1501 bounding_box_test
python main/make_data_json.py -d ./data/market1501/bounding_box_test -sp data_jsons/market_gallery.json -t reid
market1501 query
python main/make_data_json.py -d ./data/market1501/query -sp data_jsons/market_query.json -t reid
杜克bounding_box_test
python main/make_data_json.py -d ./data/dukememc/bounding_box_test -sp data_jsons/dukemtmc_gallery.json -t reid
杜克query
python main/make_data_json.py -d ./data/dukememc/query -sp data_jsons/dukemtmc_query.json -t reid
- 特征提取
python3 main/extract_feature.py -dj data_jsons/caltech_gallery.json -sp /data/features/caltech/gallery/ -cfg configs/caltech.yaml
- index