Giter VIP home page Giter VIP logo

desk-cheese's Introduction


Logo

Desk Cheese

A tool to take periodic webcam photos, and filter humanless ones

About

I thought it would be interesting to get a timelapse of myself as I wrote my thesis, so I wrote this tool to do just that. It has a bash script (take_photo.sh) to take a photograph using the webcam, and saves it as a timestamped image. The script should be run as a cronjob, with an example of how to do that given in the script itself.

Then, there is then a Python script that runs the YOLOv3 object detection model on the images, to see which ones contain a human. The script saves lists of images that it thinks contains humans and those it doesn't, and caches the inference results so we don't need to repeat.

The final script generate_animated_gif.sh takes the images and turns them into an animated GIF. Alternatively, you can run generate_mp4.sh to make a video, which also optionally add an audio file.

Why the name?

The tool is intended to run while one is working at one's desk, and "cheese" is something people say in English to smile when they are being photographed.

Usage

As well as the Python dependencies tqdm opencv-python numpy, you also need the imagemagick and fswebcam packages.

Edit the take_photo.sh script to define where you want to save the files, as well as your working hours. Add the script as a cronjob. From that point on, you can just leave it to do its thing. There's a chance if you have multiple webcams it could take things from the wrong input, so it's worth keeping an eye on that.

Critique

Running YOLOv3 with opencv is not the fastest way to do DNN inference

Correct, but it was the quickest from a development perspective.

The class name you are detecting is person

Yeah, it only detects humans (and perhaps not all humans with equal accuracy). Are all humans persons and are all persons human? That ain't for this tool to decide.

If everything was in Python it would probably be more portable

Yeah, but I asked GPT-4 to generate a couple of GIF generation functions using Pillow and imageio and they just hung. imagemagick does the job for me.

License

Distributed under the MIT License. See LICENSE for more information.

Built With

desk-cheese's People

Contributors

wheest avatar

Stargazers

 avatar

Watchers

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