Code Monkey home page Code Monkey logo

camerapoller's Introduction

Litterbox Camera Poller

Overview

This project attempts to determine which of our cats is using the litterbox, if they were headed in our out of the box and record the event so that the cat's strange cat parents can keep track of litterbox habits.

How you might ask? The app attempts to capture a still photo of a cat headed into or out of the litterbox. It does this by snapping a photo when the camera detects motion. It then sends the image to an Azure Custom Vision service for classification.

Once the image is tagged with predictions the app attempts to decide what just happened. Was it a false motion event (Negative)? Flipping lights switches on and off cause motion events with no cat. Our litterbox is in the laundry room, so we humans use the room, which also cause (Negative) false motion events.

If there was a cat in the picture according to the Custom Vision Service, next we attempt to determine if the cat was headed into or out of he litterbox with another Azure Custom Vision Project. Once those results are in we send the best picture of the bunch (highest probability according to the Custom Vision service) to Firebase Storage, then write the rest of the details to a Firebase Firestore database.

Ultimately the cat parents can see in an iOS app which cat is using the litterbox and when. It's over the top, I know.

Slightly more detail

This particular project:

  1. Polls a local IP camera for motion once every n seconds
  2. If there is motion it saves an image locally
  3. If a pic is saved it sends it off to the Azure Custom Vision service for a Cat prediction
  4. If there was a cat in the pic, it tries to determine if the cat was headed into our out of the litterbox
  5. Once an image set is collected (arbitrary number probably between 3-5) or a timeout is reached:
  6. It picks the highest probability cat image from the bunch
  7. Saves the image to Firebase Storage
  8. Saves the "Trip" details to Firestore
  9. Goes back to polling the camera

Disclaimer

This system works for us and our situation. It is pretty neat but probably not useful to anyone else. Unless it sparks your creativity and curiosity, then it was plenty useful.

Why

Cat Parents, that's why. Well that and an incurable Geek who is a Cat Dad.

This started when we decided that our cats needed two litterboxes instead of one. This decision was based purely on our laziness; we wanted to change the litter less often. Once we had two litterboxes in place I became curious, as one does, whether the cats each used their own litterbox of if they alternated between the two. I had the brilliant idea to repurpose a "security" camera so I could determine if there was a pattern. Then our laziness vaulted to a new level when we purchased an automatic scooping litterbox.

Our LitterRobot replaced the two litterboxes before my little experiment took off. It seemed like an extravagant purchase but I will never go back to scooping, or let's face it tossing 20 pounds of litter a week because we were too lazy (busy! we are busy!) to scoop daily. I thought my geek dream was dead. One of the cool things about the LitterRobot is that, through the mobile app you can see how often your cats use the litterbox. The downside is that it can't tell which cat used the box so my dream was, once again, alive.

I wanted to know which cat was using the litterbox when I received that push notification from the LitterRobot app, duh!

I suppose I could make up some reasons like by seeing pattern changes in litter usage one could tell if a cat was sick. That is an excuse I came up with later. Although, I suppose this data could be used for that.

camerapoller's People

Contributors

stevebargelt avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

camerapoller's Issues

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

github.com/stevebargelt/cameraPoller/camera: cannot find module providing package github.com/stevebargelt/cameraPoller/camera
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/config: cannot find module providing package github.com/stevebargelt/cameraPoller/config
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/metrics: cannot find module providing package github.com/stevebargelt/cameraPoller/metrics
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/storage: cannot find module providing package github.com/stevebargelt/cameraPoller/storage
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/vision: cannot find module providing package github.com/stevebargelt/cameraPoller/vision
go: downloading firebase.google.com/go v1.0.2
go: downloading github.com/dgrijalva/jwt-go v1.0.2
go: downloading github.com/Azure/azure-sdk-for-go v0.2.0-beta

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't parse your go.mod

Dependabot couldn't parse the go.mod found at /go.mod.

The error Dependabot encountered was:

go: cloud.google.com/go/[email protected] requires
	golang.org/x/[email protected]: git init --bare in /opt/go/gopath/pkg/mod/cache/vcs/d7a72cb88b44c6f9a01cd83ccc1abffb1bb34c472a6bfd538fe8f953e0c108c9: exit status 128:
	error: copy-fd: write returned: No space left on device
	fatal: cannot copy '/usr/share/git-core/templates/description' to '/opt/go/gopath/pkg/mod/cache/vcs/d7a72cb88b44c6f9a01cd83ccc1abffb1bb34c472a6bfd538fe8f953e0c108c9/description': No space left on device

View the update logs.

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

go: github.com/Azure/[email protected]+incompatible: reading github.com/Azure/azure-sdk-for-go/go.mod at revision v42.2.0: unknown revision v42.2.0

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

github.com/stevebargelt/cameraPoller/camera: cannot find module providing package github.com/stevebargelt/cameraPoller/camera
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/config: cannot find module providing package github.com/stevebargelt/cameraPoller/config
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/metrics: cannot find module providing package github.com/stevebargelt/cameraPoller/metrics
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/storage: cannot find module providing package github.com/stevebargelt/cameraPoller/storage
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/vision: cannot find module providing package github.com/stevebargelt/cameraPoller/vision

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

github.com/stevebargelt/cameraPoller/camera: cannot find module providing package github.com/stevebargelt/cameraPoller/camera
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/config: cannot find module providing package github.com/stevebargelt/cameraPoller/config
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/metrics: cannot find module providing package github.com/stevebargelt/cameraPoller/metrics
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/storage: cannot find module providing package github.com/stevebargelt/cameraPoller/storage
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/vision: cannot find module providing package github.com/stevebargelt/cameraPoller/vision
go: downloading firebase.google.com/go v1.0.2
go: downloading github.com/dgrijalva/jwt-go v1.0.2
go: downloading github.com/Azure/azure-sdk-for-go v0.2.0-beta

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

github.com/stevebargelt/cameraPoller/camera: cannot find module providing package github.com/stevebargelt/cameraPoller/camera
	github.com/stevebargelt/cameraPoller/config: cannot find module providing package github.com/stevebargelt/cameraPoller/config
	github.com/stevebargelt/cameraPoller/metrics: cannot find module providing package github.com/stevebargelt/cameraPoller/metrics
	github.com/stevebargelt/cameraPoller/storage: cannot find module providing package github.com/stevebargelt/cameraPoller/storage
	github.com/stevebargelt/cameraPoller/vision: cannot find module providing package github.com/stevebargelt/cameraPoller/vision

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

github.com/stevebargelt/cameraPoller/camera: cannot find module providing package github.com/stevebargelt/cameraPoller/camera
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/config: cannot find module providing package github.com/stevebargelt/cameraPoller/config
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/metrics: cannot find module providing package github.com/stevebargelt/cameraPoller/metrics
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/storage: cannot find module providing package github.com/stevebargelt/cameraPoller/storage
github.com/stevebargelt/cameraPoller imports
	github.com/stevebargelt/cameraPoller/vision: cannot find module providing package github.com/stevebargelt/cameraPoller/vision
go: downloading github.com/Azure/azure-sdk-for-go v0.2.0-beta
go: downloading firebase.google.com/go v1.0.2
go: downloading github.com/dgrijalva/jwt-go v1.0.2

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

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.