GithubHelp home page GithubHelp logo

abhijit-code / pr430_pipinstall Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mandar-18/pr430_pipinstall

1.0 0.0 0.0 100.35 MB

GitHub repository of team pip_install for Smart India Hackathon, 2020

Python 38.48% HTML 61.52%

pr430_pipinstall's Introduction

**Readme.md

Repository to share source code of team pip_install for Smart India Hackathon, 2020

Objective:

Detect any unusual activity in a given video, or through the live stream from a camera. Report start and end time of the unusual event in video or clock timings in case of real time detection.

Approach?

We collected video data of various normal as well as abnormal events from internet. Extracted frames from data manually associated hand-picked of these frames to certain labels, say accident, fire and normal event. Except the 'NormalEvent' label, we treated every other label as an label which would contain all the frames of associated unusual or anomolous behaviour. Then we built a convolutional neural network which takes every frame from the input video and associates the frame to a label with largest corresponding probability. If labels associated with certain series of frames turns to be abnormal, the video associated with is termed as abnormal.

How did we do it?

For training, we built a head layer over pre-trained CNN using ImageNet weights, Resnet50, which is a famous CNN in image classification. The head layer helped us achieve labelling frames with their largest corresponding probabilities. Though it gives each frame an annotation, it's not enough due to temporal nature of video frames as opposite to spatial-only nature of training images (Note that training images are discrete and have no interrelation at all). We may face flickering since continuous frames in a video may not have same label. Some of them may have other labels, which hampers overall prediction. To overcome, we apply rolling averaging over the predictions, which takes average prediction values of n previous values, the value of n being defined manually on trial and error basis.

What does it achieve?

Predicts if events happening in given videos or streams are normal or abnormal. If abnormal, it is monitored until it gets finished. Once finished, authorized personnel would get an email alerting him/her regarding the anomaly. The email would also contain starting and ending timings of anomaliy/ies.

What's next?

More research to be done on the labels, as very it can detect presently. More data has to be generated in order to predict more accurately. A distributed architechture can be designed to overcome computing power scarcity.

How to run this code?

  • Run predict_videos.py.
  • A Flask server will run. Type 127.0.0.1:5000 in your browser.
  • Type in the name of video you want to give input to the system. The video to be saved in example_clips folder in your project root. A sample video has been included in the same.
  • The process will start and another window will open which will show video footage along with on screen messages if unusual event occurs.
  • For storing the output, just create an output folder in project root.

Requirements

  • Python 3
  • Tensorflow 2
  • Other module requirements are included in requirements.txt

pr430_pipinstall's People

Contributors

mandar-18 avatar

Stargazers

Abhijit Patil 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.