kevinbjl's picture
Update README.md
e6f12f8 verified

A newer version of the Gradio SDK is available: 5.29.0

Upgrade
metadata
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

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.