GithubHelp home page GithubHelp logo

eljandoubi / ai-photo-editing-with-inpainting Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 11.16 MB

A web app that allows you to select a subject and then change its background, OR keep the background and change the subject.

License: MIT License

Python 0.38% Jupyter Notebook 99.62%
bitsandbytes gradio-interface huggingface-accelerate huggingface-diffusers huggingface-transformers pytroch

ai-photo-editing-with-inpainting's Introduction

AI-Photo-Editing-with-Inpainting

About

In this project I build a little app that allows you to select a subject and then change its background, OR keep the background and change the subject.

The process involves a user uploading an image and selecting the main object by clicking on it. The Segment Anything Model (SAM) is activated to create a mask around the selected object, choosing the most accurate mask generated. The user is shown this result to either accept it or refine the mask further with additional points. Once the mask is finalized, the user gives a text description (and possibly a negative prompt) to specify a new background for the selected object. An infill model then creates this new background, and the final image is displayed. Optionally, the user can choose to invert the mask and substitute the subject while keeping the background, as in the example above.

This little app can be used to swap backgrounds, swap subjects, remove objects, and more!

Installation

If you are trying this locally, follow these instructions first:

conda create -n "impating" python=3.11

conda activate impating

git clone https://github.com/eljandoubi/AI-Photo-Editing-with-Inpainting.git

cd AI-Photo-Editing-with-Inpainting

pip install -r requirements.txt

jupyter notebook

Samples

Car

Dragon

Monalisa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.