mikwieczorek/centroids-reid

why deepfashion Retrieval top-50 acc just 41% for 120 epoch train

Opened this issue · 3 comments

I use 320-320 images and resnet50-ibn-a train the model for 120 epoch ,use 320-res50-ibn-a config.But the top-50 acc just 41%.And in data preprocessing deep_fashion2reid.py line 145 low_res_source_filepath = os.path.join(
str(dir_path).replace(
str(image_root_dir_split), str(low_res_image_root)
),file,) replace temp image path with low_res_image_root. But there is no image in low_res_image_root, so an error is reported in the image.open operation on line 151. And low_res_source_filepath is only used for image.open operation, what is the meaning of this replace? In order to run deep_fashion2reid.py, I stop the replace, use low_res_source_filepath = os.path.join( str(image_root_dir_split), file, ). Is there something I do and settings that cause this low accuracy?

I faced the same error. The problem is that bboxes in Anno/list_bbox_consumer2shop.txt are related to low resolution images. As you changed the low_res_source_filepath to the high resolution path, you are cropping the high resolution images with the low resolution bbox coordinates, obtaining inconsistent crops for training.

The most straightforward solution would be creating the low resolution train/val/test split, repeating the lines 376-379 (where scatter_images_to_folders is applied) and changing IMAGES_ORG_PATH and IMAGES_ROOT_DIR_SPLIT by two new constants with paths pointing to low res image folders.

`
IMAGES_LOW_RES_ORG_PATH = ROOT_DIR / "img"
IMAGES_LOW_RES_ROOT_DIR_SPLIT = ROOT_DIR / "img_low_res_tmp"
IMAGES_LOW_RES_ROOT_DIR_SPLIT.mkdir(exist_ok=True)

...

for subset_name, subset in split_dict.items():
scatter_images_to_folders(
ROOT_DIR, IMAGES_LOW_RES_ORG_PATH, IMAGES_LOW_RES_ROOT_DIR_SPLIT, subset_name, subset
)

`

Also replace LOW_RES_IMAGES_ROOT from "img_low_res" to "img_low_res_tmp" and delete the generated 320_320_cropped_images folder, otherwise it won't generate the correct new crops.

Hi @yuyuzah , do you have a repo regarding this modified version of centroids-Reid? I had some problems in the training process while using deepfashion dataset even though I followed the readme instruction clearly.