Downloads · 30 days
0
huzaifanasirrr/ai-virtual-tryon
ai-virtual-tryon is a image-to-image model from huzaifanasirrr. Use it when you need one image transformed into another. It is set up for pytorch. The card lists the license as mit.
[](https://www.python.org/downloads/) [](https://pytorch.org/) [](https://opensource.org/licenses/MIT) [](https://doi.org/10.5281/zenodo.18058537)
Downloads · 30 days
0
Access
Public
Updated Jan 2, 2026
Repo size
485 MB
Likes
1
Public
Click a slice to open those files.
.pth479 MB · 99%
From the Hugging Face model README
A comprehensive deep learning-based virtual try-on system leveraging multi-modal feature fusion and Generative Adversarial Networks (GANs) to generate photorealistic garment transfer images. This implementation combines cloth-agnostic person representation, pose estimation, and human parsing for identity-preserving virtual try-on.
Key Features:
Person Image → [Human Parsing] → Cloth-Agnostic RGB (3 channels)
→ [Pose Estimation] → Gaussian Heatmaps (18 channels)
→ [LIP Segmentation] → Parsing Masks (20 channels)
↓
Multi-Modal Fusion (41 channels)
↓
U-Net Generator + Self-Attention
↓
Generated Try-On Image (3 RGB)
↓
PatchGAN Discriminator
↓
[Real/Fake Classification]
Generator Architecture:
Discriminator Architecture:
| Metric | Value | Description |
|---|---|---|
| SSIM | 0.6247 | Structural similarity index |
| PSNR | 15.23 dB | Peak signal-to-noise ratio |
| L1 Distance | 0.1152 | Pixel-level reconstruction error |
Loss Components:
Dataset:
Training Configuration:
Hardware Requirements:
git clone https://github.com/huzaifanasir95/AI-Virtual-TryOn.git
cd AI-Virtual-TryOn
pip install -r requirements.txt
from huggingface_hub import hf_hub_download
import torch
# Download model checkpoint
model_path = hf_hub_download(
repo_id="huzaifanasirrr/ai-virtual-tryon",
filename="best_model.pth"
)
# Load checkpoint
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
checkpoint = torch.load(model_path, map_location=device)
from src.preprocessing import MultiChannelInputGenerator
from src.models import Generator
import torch
from PIL import Image
# Initialize generator
generator = Generator(input_channels=41, output_channels=3)
generator.load_state_dict(checkpoint['generator_state_dict'])
generator.eval()
generator.to(device)
# Prepare multi-modal input
input_generator = MultiChannelInputGenerator(target_size=(512, 384))
multi_channel_input = input_generator.generate_input(
person_image_path="path/to/person.jpg",
parsing_mask_path="path/to/parsing.png",
keypoints_path="path/to/keypoints.json"
)
# Generate try-on image
with torch.no_grad():
input_tensor = torch.from_numpy(multi_channel_input).unsqueeze(0).to(device)
output = generator(input_tensor)
# Convert to image
output_image = (output.squeeze(0).cpu().numpy().transpose(1, 2, 0) + 1) / 2
output_image = (output_image * 255).astype('uint8')
Image.fromarray(output_image).save("tryon_result.jpg")
VITON-HD Dataset Structure:
data/zalando-hd-resized/
├── train/
│ ├── image/ # Person images (11,647 files)
│ ├── cloth/ # Garment images (11,647 files)
│ ├── image-parse-v3/ # LIP parsing masks (20 classes)
│ ├── openpose_json/ # Body25 keypoints (25 joints)
│ ├── openpose_img/ # Pose visualizations
│ └── agnostic-v3.2/ # Cloth-agnostic representations
└── test/
└── [same structure]
Modalities:
best_model.pth - Complete model checkpoint (457 MB)training_curves.png - Training dynamics visualizationcomparison_grid.png - Sample results (input/garment/output/ground truth)loss_comparison.png - Loss component analysisgarment_extraction.png - Human parsing examplespose_detailed_analysis.png - Pose estimation examplespreprocessing_config.yaml - Data preprocessing configurationrequirements.txt - Python dependenciesresearch_paper.pdf - Full research paper (Springer LNCS format)If you use this model in your research, please cite:
@article{nasir2025virtualtryon,
title={Deep Learning-Based Virtual Try-On System Using Multi-Modal Feature Fusion and Generative Adversarial Networks},
author={Nasir, Huzaifa},
year={2025},
publisher={Zenodo},
doi={10.5281/zenodo.18058537},
url={https://doi.org/10.5281/zenodo.18058537},
note={Hugging Face: https://huggingface.co/huzaifanasirrr/ai-virtual-tryon}
}
VITON-HD Dataset:
@inproceedings{choi2021viton,
title={VITON-HD: High-Resolution Virtual Try-On via Misalignment-Aware Normalization},
author={Choi, Seunghwan and Park, Sunghyun and Lee, Minsoo and Choo, Jaegul},
booktitle={CVPR},
year={2021}
}
Huzaifa Nasir
National University of Computer and Emerging Sciences (FAST-NUCES), Islamabad, Pakistan
📧 [email protected]
🔗 GitHub Repository
📄 Research Paper (Zenodo)
MIT License - See LICENSE file for details.
This project builds upon:
Research conducted at FAST-NUCES Islamabad. Special thanks to the open-source community for PyTorch and related libraries.