Skip to content

Repository files navigation

👗 Fashion Parser 🧥

PyTorch NVIDIA Triton uv License: MIT

Fashion segmentation based on Mask R-CNN (ResNet-50 FPN) using the imaterialist-fashion-2019-FGVC6 dataset.


🛠️ Technology Stack

Category Technology
Framework PyTorch 2.1+, Torchvision
Backbone ResNet-50 Feature Pyramid Network (FPN)
Package Management uv
Serving NVIDIA Triton Inference Server
Configuration python-dotenv
Visualization Matplotlib, OpenCV

🏁 Quick Start

1️⃣ Installation

Ensure you have uv installed, then run:

uv sync

2️⃣ Configuration

Copy the template and set your dataset paths:

cp .env.example .env

3️⃣ Start Training

uv run src/fashion_parser/scripts/train_torch.py

🚢 Production Deployment (Triton)

Export to TorchScript

Prepare your trained model for production:

uv run src/fashion_parser/scripts/export_triton.py --weights fashion_mrcnn_pytorch.pth

Launch Server

Deploy the model repository using Docker:

docker run --gpus=all --rm -p 8000:8000 \
  -v $(pwd)/model_repository:/models \
  nvcr.io/nvidia/tritonserver:24.01-py3 \
  tritonserver --model-repository=/models

Client Inference

uv run src/fashion_parser/scripts/triton_client.py path/to/image.jpg

📁 Project Map

fashion-parser/
├── src/fashion_parser/
│   ├── models/        # PyTorch model definitions & wrappers
│   ├── data/          # Torch Dataset & Loader engines
│   ├── config/        # Environment-driven settings
│   └── scripts/       # Training, Exporting & Triton clients
├── model_repository/  # Triton deployment configurations
├── scripts/           # Legacy entry points (for reference)
├── old_code/          # Backup of legacy TF/Keras implementation
└── pyproject.toml     # Modern project configuration

🖼️ Example Results


📑 Roadmap

  • Phase 1: Restructure & Modernize Codebase
  • Phase 2: Migrate to PyTorch & uv
  • Phase 3: Triton Inference Server Integration
  • Phase 4: Add Inference & Visualization Jupyter Notebooks

About

Fashion item segmentation with deep learning

Topics

Resources

Stars

24 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages