Full Project with frontend backend
https://github.com/ShushanSS/TopK_Similar_Images_Retrieval
DeepFashion Retrieval โ Fine-tuned ResNet50 Embedder
Fine-tuned ResNet50 image embedder for fashion item retrieval, trained with batch-hard triplet loss and a category-aware PK sampler on the DeepFashion In-shop Clothes Retrieval dataset.
Contents
| File | Description |
|---|---|
embedder_full_train_epoch_6.pt |
Fine-tuned ResNet50 weights (epoch 6) |
faiss_index.bin |
FAISS index built over embedded gallery images (if included) |
metadata.json / config.json |
Embedding dim, class list, preprocessing params (if included) |
Setup
pip install -r requirements.txt
python download_weights.py
This downloads the files above into ./weights in your project root.
Generating metadata locally
The metadata CSVs are not included in this repo since they're derived from the raw DeepFashion images, which you need to download separately.
- Download the DeepFashion (In-shop Clothes Retrieval) high-res images.
- Update
DATASET_PATHinprepare_metadata.pyto point to your local copy, preserving the original folder structure:<DATASET_PATH>/<gender>/<clothing_category>/<item_id>/<image>.jpg - Run:
This producespython prepare_metadata.pyoriginal_metadata.csv,full_metadata.csv, andoriginal_metadata_filtered.csvin your working directory.
Model details
- Backbone: ResNet50, fine-tuned with batch-hard triplet loss
- Sampler: CategoryAwarePKSampler
- Retrieval baseline (CLIP zero-shot): Hit Rate@5 = 0.546
- Fine-tuned ResNet50: Hit Rate@5 = 0.819 on controlled test set
Usage
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="ShushanSS/DeepFashionRetrieval",
local_dir="./weights",
local_dir_use_symlinks=False,
)
License
MIT (update if different)
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support