Skip to content

galaxyofai/image_background_removal_python_fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Background Removal API Using Deep Learning Tool

  • Here i am creating a FastAPI for removes the Background of an Images using Python And pre-trained AI/ML models which accepts images with .jpg and .png extension.

Steps That I follow to develope this task.

  • There is a one python library or we can say a project or a tool that can help us to remove background of an image files

  • https://github.com/danielgatis/rembg

  • It uses the u2net: salienct object detection(SOD) a deep learning model

Download the model (Not Required - rembg automatically download it for us)

How to run the FastAPI

  1. Create a python virtual environment and activate it:

    • python3 -m venv venv
    • source venv/bin/activate
  2. install all the required libraries using requirements.txt

    • pip install -r requirements.txt
  3. run the API

    • python3 app.py
  4. open url in the browser

  5. upload the image (.jpg, .jpeg , .png) in FastAPI Swagger UI

  6. we get the output as dict with base64 of the image

For the demo purpose I create a Streamlit App

How to run the Streamlit app

  • go to the path where streamlit_app_demo.py is located and run the below command
  • streamlit run streamlit_app_demo.py

Other References

Reserch paper for the u2net

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages