{"id":16359341,"url":"https://github.com/gaborvecsei/home-security","last_synced_at":"2025-03-23T01:32:19.620Z","repository":{"id":84266139,"uuid":"82722256","full_name":"gaborvecsei/Home-Security","owner":"gaborvecsei","description":"Home Security System with motion detector, what you can control from a website.","archived":false,"fork":false,"pushed_at":"2017-03-10T15:19:34.000Z","size":377,"stargazers_count":21,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T16:40:23.753Z","etag":null,"topics":["computer-vision","firebase","opencv","python","raspberry-pi"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaborvecsei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-21T20:09:28.000Z","updated_at":"2024-09-05T11:31:00.000Z","dependencies_parsed_at":"2023-06-25T22:46:53.391Z","dependency_job_id":null,"html_url":"https://github.com/gaborvecsei/Home-Security","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FHome-Security","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FHome-Security/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FHome-Security/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FHome-Security/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaborvecsei","download_url":"https://codeload.github.com/gaborvecsei/Home-Security/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245044105,"owners_count":20551878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","firebase","opencv","python","raspberry-pi"],"created_at":"2024-10-11T02:08:09.103Z","updated_at":"2025-03-23T01:32:19.610Z","avatar_url":"https://github.com/gaborvecsei.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Home Security System - Motion Detector\n\nHome Security System what you can control from a website.\n\nDetects motion with a simple (and cheap) webcamera connected to a Raspberry Pi,\nand if it detects motion, the pictures are uploaded to a Firebase project storage.\n\n[Read more about the project here](https://gaborvecsei.wordpress.com/2017/03/07/home-security-system-with-computer-vision/)\n\n-------------------------\n\n## Setup\n\nWhat you will need:\n\n- Raspberry Pi (but you can test it on your laptop/PC,\nor any other device which can run Python scripts and the hardware is enough for image processing tasks)\n- Webcamera (simple and cheap)\n- Firebase Project\n\n### Setup Firebase Project\n\nWe need to setup a Firebase project. This is a simple way to authenticate users and store captured images.\n\n1. Go to [https://console.firebase.google.com/](https://console.firebase.google.com/)\n2. Create a new Project (I named it `Home Security`)\n3. Setup Authentication:\n    1. Enable Email/Password user authentication\n    2. Add users (for yourself, your mom, dad, etc...) - They will be able to start or stop the security system\n4. Save `apiKey, authDomain, databaseURL, storageBucket, messagingSenderId` and fill out `config.ini`\n\n\u003cimg  height=250 src=\"https://github.com/gaborvecsei/Home-Security/blob/master/images/create_firebase_project.jpg\" /\u003e\n\u003cimg  height=250 src=\"https://github.com/gaborvecsei/Home-Security/blob/master/images/firebase_authentication.jpg\" /\u003e\n\n### Install\n\nYou can use Anaconda to simplify the steps\n\n- Python 3 (but it works with Python 2 too)\n- [OpenCV 3 (better) or OpenCV 2](http://opencv.org/)\n- [Pyrebase](https://github.com/thisbejim/Pyrebase) - `pip install pyrebase`\n- Flask - `pip install flask`\n\nAfter these steps, you are ready to run the code!\n\n--------------------------\n\n## Test\n\nYou just have to run `app_home_security.py` -\u003e `python app_home_security.py`.\n\nNow, find out the *local ip address* of your device which runs the Home Security System (for example `192.168.0.12`).\nWith another device like your smartphone, laptop, etc... open your browser and go to `192.168.0.12:5000` to see the welcome page.\n\nGo to `192.168.0.12:5000/login` or navigate there from the homepage and you can start the fun with your own Home Security system!\n\n* Enter your *email* and *password*\n* Enter the *minimum detection area* (the smaller the value the more it is sensitive for movements, changes on the captured image)\n* Choose to *start* or *stop* the system\n\nIf the System detects movement it will snap a picture and upload to your Firebase project.\n\n\u003cimg  height=250 src=\"https://github.com/gaborvecsei/Home-Security/blob/master/images/firebase_storage.jpg\" /\u003e\n\n--------------------------\n\n## Extend Home Security\n\nIf you would like to make other things happen when it detects motion than you can edit\n`home_security.py` which you can find at:\n\n```\nHomeSecurityModules/\n    HomeSecurity/\n        home_security.py\n        __init__.py\n```\n\nFor example you can create a method which not just uploads the image to the Firebase project storage,\nbut it sends you a message, email, notification.\n\nI provided a simple notification class with *Slack*. This sends you a message after motion is detected. You only have to\ninstall the `slackclient` package and put the necessary code to `home_security.py`.\n\n--------------------------\n\n## Computer Vision\n\nHere you can see the main steps of the motion detector. You can read more about this part at [this blog post](https://gaborvecsei.wordpress.com/2017/03/07/home-security-system-with-computer-vision/)\n\n\u003cimg  width=400 src=\"https://github.com/gaborvecsei/Home-Security/blob/master/images/preprocessing.jpg\" /\u003e\n\n\u003cimg  width=200 src=\"https://github.com/gaborvecsei/Home-Security/blob/master/images/previous_image.jpg\" /\u003e\n\n\u003cimg  width=400 src=\"https://github.com/gaborvecsei/Home-Security/blob/master/images/difference_binary.jpg\" /\u003e\n\n--------------------------\n\n## Images\n\n\u003cimg  height=350 src=\"https://github.com/gaborvecsei/Home-Security/blob/master/images/index_page.jpg\" /\u003e\n\u003cimg  height=350 src=\"https://github.com/gaborvecsei/Home-Security/blob/master/images/login_form.jpg\" /\u003e\n\n\u003cimg  height=350 src=\"https://github.com/gaborvecsei/Home-Security/blob/master/images/raspberry_pi.jpg\" /\u003e\n\n--------------------------\n\n## About\n\nGábor Vecsei\n\n- [Personal Blog](https://gaborvecsei.wordpress.com/)\n- [LinkedIn](https://www.linkedin.com/in/gaborvecsei)\n- [Twitter](https://twitter.com/GAwesomeBE)\n- [Github](https://github.com/gaborvecsei)\n- vecseigabor.x@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaborvecsei%2Fhome-security","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaborvecsei%2Fhome-security","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaborvecsei%2Fhome-security/lists"}