Code Monkey home page Code Monkey logo

ai-photobox's Introduction

AI PhotoBox

Build a photobox without a greenscreen! This project uses the amazing Backgroundremover tool to allow for easy photo boxes without a greenscreen. Simply setup a camera connected with gphoto2 and create fun photos with your friends!

This script uses:

  • Gphoto2 to capture images from a connected DSLR camera
  • Backgroundremover to remove the background of the captured image
  • Imagemagick to create variants of the source image
  • mutt to send emails

Example

Open the webinterface and enter information. The photo will be taken and the background will be removed

Webinterface

Photo taken:

Photo

Foreground:

Foreground

Combined image:

Combined

The photo will be saved in the 'done' folder and sent to the entered email adress.

Installation

Install gphoto2, imagemagick and mutt using your package manager. Ensure that gphoto2 and mutt work correctly. Then run:

pip install -r requirements.txt

Usage

python webserver.py This starts a webserver on port 5000, which shows the last captured image and an interface to enter information. Images are saved within subfolders in the 'done' folder, using the selected name. When mutt is configured and an email adress is entered, the image will also be sent to the entered email adress.

All photos in the background folder will be used as backgrounds.

Configuration

In greenscreen.sh you can configure the following variables:

  • do_resize: If set to true, the image will be resized. Use this, if background removal takes a long time and you want faster (but worse) results.
  • resize_target: Target width of the resized image

Image credits

Thanks to Prisicilla Du Preez for the photo: https://unsplash.com/photos/three-women-walking-on-brown-wooden-dock-near-high-rise-building-during-daytime-mKJUoZPy70I

Also thanks thanks to Pablo Heimplatz for the background: https://unsplash.com/de/fotos/menschen-die-mit-konfetti-feiern-ZODcBkEohk8

ai-photobox's People

Contributors

a-wels avatar dependabot[bot] avatar

Watchers

 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.