A newer version of the Gradio SDK is available:
6.1.0
metadata
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
- Upload an image
- Choose between Gaussian Blur or Lens Blur tab
- Adjust parameters using the sliders
- Click the apply button to see results
All images are processed at 512Γ512 resolution for optimal performance.