Git Product home page Git Product logo

genpicam's Introduction

GenPiCam

GenPiCam - a RaspberryPi based camera that re-imagines the world with GenAI.

Read the blog for more details

Setup virtual python environment

Create a virtual python environment to keep dependencies separate. The venv module is the preferred way to create and manage virtual environments.

python3 -m venv env

Before you can start installing or using packages in your virtual environment you’ll need to activate it.

source env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

Assumptions and setup

This code is definitely a rough, work-in-progress. You'll need to tinker with things to get it to work locally. Consider this code "inspiration" and not a complete solution.

  • Setup a discord_config.py file with with a Discord token which has enough scope to interact with messages (you can copy discord_config_EXAMPLE.py)
  • It is assumed you have a Discord channel setup, and have added a Midjourney bot (with appropriate subscription). You'll need to add your Discord bot to the same channel so the token has sufficient scope.
  • The Discord web page should be open - as GenPiCam will literally be controlling the mouse and keyboard to interact with Midjourney bot.
  • The describe mode requires some very ugly code to interact with the file browser icon (literally the button you press to open the file selection dialog). Depending on your screen size, you may need to adjust the location of the browse file mouse pointer location in midjourney.py

Usage

Basic usage; run interactive commands against Discord Midjourney bot to automatically chain actions. Does not require a RaspberryPi.

python generative_camera.py --auto

RaspberryPi usage; will dynamically import Raspberry Pi GPIO library

export DISPLAY=:0
python generative_camera.py  --enablePi --auto

Issues and work around

If you get an error import Raspberry Pi GPIO library import RPi.GPIO try the following package updates

sudo apt-get install python3-dev python3-rpi.gpio
pip install RPi.GPIO

Code credits & references

genpicam's People

Contributors

saubury 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.