Coder Social home page Coder Social logo

kcuric / surveillance-system Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 553 KB

DIY surveillance system with a face detection implemented with Python, OpenCV and Flask. Made as a team project for a System Security course at the Faculty of Organization and Informatics, Varaždin, Croatia.

Python 72.09% HTML 8.68% CSS 8.38% JavaScript 10.86%
diy-surveillance opencv udp flask detect-faces

surveillance-system's Introduction

DIY Surveillance System 👁️

DIY surveillance system. Made as a team project for Information Systems Security course at the Faculty of Organization and Informatics, Varaždin, Croatia.

📕 Description

🇬🇧 ENG: "Do it yourself" surveillance system with face detection implemented with Python and mostly OpenCV was a team project for a "Information Systems Security" course at the Faculty of Organization. In short, the client script rapidly records images and sends them via the UDP to the server. The server scripts receives the images, detects the faces inside them using OpenCV and notifies the user with an email if any faces were detected in the images. Camera stream can be observed in real time inside a simple Flask web app. There is still a lot room for improvement, because the development so far was a sort of "proof of concept" so some of the code wasn't quite written with PIP-8 in mind etc.. Development is still taking place, on the weekends of course - so this will get better as time goes by (hopefully)!

🇭🇷 CRO: "Učini sam" nadzorni sustav s detekcijom lica implementiran pomoću programskog jezika Python i u velikoj većini uz pomoć OpenCV-a bio je timski projekt za kolegij "Sigurnost informacijskih sustava" na Fakultetu organizacije i informatike u Varaždinu. Ukratko, klijentska skripta učestalo snima fotografije te iste šalje UDP protokolom do servera. Serverska skripta detektira lica u zaprimljenim fotografijama pomoću OpenCV-a te obavještava korisnika elektroničkom poštom ukoliko detektira lice/a u nekoj od zaprimljenih fotografija. Fotografije pristižu zaista učestalo te se dobiva dojam strujanja videa koji se može gledati u pravome vremenu pomoću jednostavne Flaskom pogonjene web aplikacije. Postoji još poprilično mnogo mjesta za poboljšanja s obzirom da je cijeli projekt bio izrađen samo kao "dokaz konceptom", dijelovi koda tako nisu pisani u skladu s PIP-8 standardom i sl.. Razvoj je još u tijeku i to isključivo vikendima - tako da će sam projekt postati bolji s vremenom! (nadamo se)!

How to run this? 🏁

Dependencies

Install all the dependencies with pipenv. A list of dependencies can be found inside the Pipfile.

pipenv install
pipenv shell

Server

python -m flask run --host=0.0.0.0

Client

python app.py port --cam cam_num
ex. python app.py 5005 --cam 0

Currently only available ports (hardcoded in the server script) for UDP are: 5005, 5006. Of course you can change this in the code. To check available connected camera devices with Linux use:

v4l2-ctl --list-devices

Contributors 👥

  • Maja Benkus
  • Krešimir Ćurić
  • Igor Košmerl
  • Miro Krištofić

A huge thanks to our mentors Doc. dr. sc. Petra Grd, Doc. dr. sc. Igor Tomičić and the FOI Centre for Forensic, Biometry and Privacy, for all the guidelines, equipment, etc..

surveillance-system's People

Contributors

kcuric avatar mkristofic avatar ygoro avatar

Stargazers

 avatar  avatar

Watchers

 avatar

surveillance-system's Issues

Implement signal handling

Implement signal handling for the client and the server side. Stopping the execution should free all used resources (ports, objects, etc.).

Implement image transfer

Implement a class that enables sending images from the client (Raspberry PI) to the server (GCP VM Instance).
Class name: "Streamer".
Store the class source code inside the "modules" folder.

User notification mail

On the server side implement email sending to the user if detection has occurred on the camera. User should get the following info:

  • date and time when did the detection occurred
  • picture in which the face was detected

Send the email to your own email address or make a new email address for this purpose.

Implement face detection

Implement a face detection class via OpenCV in Python.
Class name: "Detector"
Store the class source code inside the "modules" folder.

Install server dependencies

Install dependencies on the GCP VM Instance. Python, Python modules, etc..
Dependencies of the GCP VM Instance (known for now):

  • Flask

pipenv

Create the pipenv files so the virtual environment can be used.
Needed dependencies on the client side:

  • OpenCV
  • ...

Implement video capture

Implement video capture via OpenCV.
Class name: "Recorder".
Store the class source code inside the "modules" folder.

Implement the client class

Implement a class whose methods will be running on the Raspberry PI devices. Class should be "plug n' play" meaning user should be able to instantiate the user class and call the run() method - class should do all the rest.

Client class should use the following developed modules:

  • Recorder (class for recording video)
  • Streamer (class for transferring the footage)
  • Detector (class for motion detection)

Separate the Recorder from the Streamer

Streamer is currently dependent on the Recorder class - this should not be the case. Both Recorder and Streamer should be instantiated inside the client script.

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.