Spaces:
Sleeping
Sleeping
title: Anaglyph Image Generator | |
emoji: π | |
colorFrom: gray | |
colorTo: indigo | |
sdk: gradio | |
sdk_version: 5.5.0 | |
app_file: app.py | |
pinned: false | |
short_description: Generates an anaglyph image containing a person. | |
# Anaglyph Image Generator | |
This application is an anaglyph image generator. | |
It extracts the person from a user-uploaded image, blend the person with a background the user chooses, and creates the anaglyph image. | |
## Project Overview | |
- **Model**: Pre-trained DeepLabv3 model from torchvision. | |
- **Features**: | |
- Allows the user to upload any image that contains persons. | |
- Three different backgrounds for the user to choose from. | |
- Allows the user to adjust depth perception. | |
## Project Structure | |
```bash | |
lab4/ | |
βββ app.py # Main Gradio application script | |
βββ segmentation.py # Includes functions for extracting the person | |
βββ insert.py # Includes functions for inserting a person into a pair of stereoscopic images | |
βββ anaglpyh.py # Includes functions for creating an anaglyph image | |
βββ background # This folder includes the three backgrounds for the user to choose from | |
βββ test_img # This folder includes some test images for reference | |
βββ false_img # This folder cinludes images that do not contain a person | |
``` | |
## Running the Application | |
Launch the Gradio application using app.py: | |
gradio app.py | |
This will start a Gradio interface at a local address. | |
The user can upload an image using the image uplaod window on the left, and view the result via the display window on the right. | |
The user can also choose one of the three different backgrounds (nature scenery, NEU campus, gastown) by using the drop down menu, | |
located below the image upload window. Depth perception can also be adjusted by using the drop down menu below the background menu. | |
If there's no person to extract from the image, no output will be generated, and an error message will be displayed. | |