https://github.com/trongkhanh083/virtual-try-on-ring
Virtual Ring Try-On using AI
https://github.com/trongkhanh083/virtual-try-on-ring
computer-vision controlnet mediapipe realesrgan segment-anything stable-diffusion virtual-try-on
Last synced: 2 months ago
JSON representation
Virtual Ring Try-On using AI
- Host: GitHub
- URL: https://github.com/trongkhanh083/virtual-try-on-ring
- Owner: trongkhanh083
- Created: 2025-09-30T07:35:09.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-06T08:50:35.000Z (9 months ago)
- Last Synced: 2025-10-06T10:35:31.753Z (9 months ago)
- Topics: computer-vision, controlnet, mediapipe, realesrgan, segment-anything, stable-diffusion, virtual-try-on
- Language: Python
- Homepage:
- Size: 4.74 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
💍 Virtual Ring Try-On
An AI-powered Virtual Ring Try-On system that lets users visualize how a ring looks on their hand.
The pipeline combines computer vision and generative AI techniques:
Mediapipe Hand Detection – detect and localize hand.
Segment Anything (SAM) – isolate the ring region.
Traditional Compositing – place the ring onto bare hand templates.
Stable Diffusion 1.5 + ControlNet (Inpainting) – refine compositing with realistic shadows, reflections, and lighting.
Real-ESRGAN – upscale the final output for sharp, high-quality results.
✨ Features
- Upload a hand wearing a ring → the system extracts the ring and transfers it to a bare hand.
- Users can upload their own bare hand for try-on.
- Outputs high-resolution, photo-realistic results thanks to ESRGAN enhancement.
- Gradio-powered interactive web UI.
🖼️ Demo
🚀 Installation
Clone this repo:
```
git clone https://github.com/trongkhanh083/virtual-try-on-ring.git
cd virtual-try-on-ring
```
Create a conda or venv environment:
```
conda create -n ringvton python=3.10 -y
conda activate ringvton
```
Install dependencies:
```
pip install -r requirements.txt
```
Download Real-ESRGAN checkpoint
```
git clone https://github.com/xinntao/Real-ESRGAN.git
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P Real-ESRGAN/weights
```
⚙️ Usage
Run the Gradio app
```
python app.py
```
🖥️ Hardware Requirements
GPU strongly recommended
At least 8GB VRAM for Stable Diffusion + Controlnet.