|
|
--- |
|
|
title: Image Blur Effects Demo |
|
|
emoji: ๐ |
|
|
colorFrom: blue |
|
|
colorTo: purple |
|
|
sdk: gradio |
|
|
sdk_version: 5.49.1 |
|
|
app_file: app.py |
|
|
pinned: false |
|
|
--- |
|
|
|
|
|
# Image Blur Effects Demo |
|
|
|
|
|
This application demonstrates two types of blur effects using deep learning: |
|
|
|
|
|
## Features |
|
|
|
|
|
### 1. Gaussian Blur |
|
|
- Automatically detects people in the image using **NVIDIA SegFormer** |
|
|
- Applies Gaussian blur to the background |
|
|
- Keeps the person sharp and in focus |
|
|
- Adjustable blur intensity |
|
|
|
|
|
### 2. Lens Blur (Depth-Based) |
|
|
- Uses **Depth Anything V2** to estimate scene depth |
|
|
- Simulates camera lens bokeh effect |
|
|
- Close objects (foreground) stay sharp |
|
|
- Far objects (background) progressively blur |
|
|
- Adjustable focus threshold and blur intensity |
|
|
|
|
|
## Models Used |
|
|
- **Segmentation**: `nvidia/segformer-b0-finetuned-ade-512-512` |
|
|
- **Depth Estimation**: `depth-anything/Depth-Anything-V2-Base-hf` |
|
|
|
|
|
## Usage |
|
|
1. Upload an image |
|
|
2. Choose between Gaussian Blur or Lens Blur tab |
|
|
3. Adjust parameters using the sliders |
|
|
4. Click the apply button to see results |
|
|
|
|
|
All images are processed at 512ร512 resolution for optimal performance. |