Code Monkey home page Code Monkey logo

image-background-remove-tool's Introduction

๐Ÿฅง Image Background Remove Tool ๐Ÿฅง

Tool for removing background from image using neural networks


๐Ÿ“„ Description:

The program removes the background from photos


๐ŸŽ† Features:

  • Added support for new neural networks (U^2-NET) on PyTorch
  • Significantly improved output image quality
  • Tensorflow 2.0 compatible
  • All models support processing both on the video card and on the processor.
  • tqdm progress bar.
  • Removes background from image without loss of image resolution.
  • The script not only processes a single file, but can also process all images from the input folder and save them in the output folder with the same name.
  • Implemented support for the neural network from this script and improved the result of its work

๐Ÿงท Dependencies:

gdown for setup.py!
tensorflow, torch, Pillow, tqdm, numpy, scipy, scikit_image for main.py!

Note: You can choose what to install PyTorch or TensorFlow, based on which model you want to use.
PyTorch for u2net, u2netp
TensorFlow for xception_model, mobile_net_model
TensorFlow models are not recommended for use, since these models have much worse quality and lower image processing speed, also these models are designed solely to remove the background from portrait photos and photos with animals.


๐Ÿท Setup for Windows:

  • Clone this repository
  • Install all the dependencies from requirements.txt via pip3 install -r requirements.txt
  • Run ./setup.bat
    This setup.bat script loads the trained model.

๐Ÿท Setup for Linux:

  • Clone repository: git clone https://github.com/OPHoperHPO/image-background-remove-tool
  • Install all the dependencies from requirements.txt: pip3 install -r requirements.txt
  • Run ./setup.sh and select the model you need.
    This setup.sh script loads the trained model.

๐Ÿงฐ Running the script:

  • python3 main.py -i <input_path> -o <output_path> -m <model_type>

Explanation of args:

  • -i <input_path> - path to input file or dir.
  • -o <output_path> - path to output file or dir.
  • -m <model_type> - can be u2net or u2netp or xception_model or mobile_net_model. u2net is better to use. DeepLab models (xception_model or mobile_net_model) are outdated and designed to remove the background from PORTRAIT photos or PHOTOS WITH ANIMALS!
    More info about models.

Note: See example scripts for more information on using the program.


โณ TODO:

1) Add a graphical interface. (0% done)

๐Ÿ’ต Support me:

You can thank me for developing this project, provide financial support for the development of new projects and buy me a small cup of coffee.โ˜•
Just support me on these platforms:
โญBoostyโญ
โญDonationAlertsโญ

๐Ÿ˜€ Sample Result:


image-background-remove-tool's People

Contributors

ophoperhpo avatar susheelsk avatar

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.