You should download these datasets by yourself, and extract them into ${data_path} directory, make sure the dir names are
car, cub, sop and isc. Then run data_utils.py to preprocess them.
Usage
Train Model
python train.py --feature_dim 1024
optional arguments:
--data_path datasets path [default value is '/home/data']
--data_name dataset name [default value is 'car'](choices=['car', 'cub', 'sop', 'isc'])
--crop_type crop data or not, it only works for car or cub dataset [default value is 'uncropped'](choices=['uncropped', 'cropped'])
--lr learning rate [default value is 0.01]
--feature_dim feature dim [default value is 2048]
--temperature temperature used in softmax [default value is 0.05]
--recalls selected recall [default value is '1,2,4,8']
--batch_size train batch size [default value is 75]
--num_sample samples within each class [default value is 25]
--num_epochs train epoch number [default value is 30]
Test Model
python test.py --retrieval_num 10
optional arguments:
--query_img_name query image name [default value is '/home/data/car/uncropped/008055.jpg']
--data_base queried database [default value is 'car_uncropped_2048_data_base.pth']
--retrieval_num retrieval number [default value is 8]
Benchmarks
The models are trained on one NVIDIA Tesla V100 (32G) GPU, all the hyper-parameters are same with the paper.