Project OverWatch aims at providing realtime detection of accident from live CCTV footage. This project aims at helping government identify accidents in public roads and alert the police and concerend authorities, so that the medical care can be provided,if needed. It also aims at helping out solving hit-and-run cases,as it will record every accident scenerio.
This Project is made with the help of Microsoft Lobe. [Lobe](http://lobe.ai/) is a free, easy to use app that has everything you need to bring your machine learning ideas to life.
Web Bootstrap takes the machine learning model created in Lobe, and adds it to a project in the browser that uses [React](https://reactjs.org), [Create React App](https://github.com/facebook/create-react-app), [TypeScript](https://www.typescriptlang.org/), and [TensorFlow.js](https://www.tensorflow.org/js).This project is currently work in progress.
Achieved features are :
- Accident Detection using ML
- Integration of tensorflow code with React
Features need to be developed:
- A UI for easy navigation
- An overlay system for statistics
-
Clone or download the project on your computer and install Yarn. Yarn is the software package that will install all the dependencies and make sure the code automatically reloads when changes are made.
-
Run
yarn install
to install required dependencies and runyarn start
to start the server in development mode. This will open a web browser tolocalhost:3000
. By default, this project is using the TensorFlow.js exported model from Lobe found in thepublic/model/
folder. -
To use your own model file, open your Lobe project, go to the Use tab, select Export, and click on the TensorFlow.js model file. When exported, drag the
model.json
,signature.json
, and all the*.bin
files to thepublic/model/
folder.
Check out the Create React App documentation for more information on React and the project structure.
There are three main components for the ML part : Camera, Prediction, and StaticImage.
- The Camera, which runs in
components/camera/Camera.tsx
is responsible for displaying a live full screen view of the user's selected webcam. - The Prediction component
components/prediction/Prediction.tsx
is the box in the lower left hand corner, and is responsible for displaying the top prediction results and their confidences. - The StaticImage component
components/staticImage/StaticImage.tsx
displays an image selected from the file picker and runs it through the model from a canvas element.
TensorFlow.js on Safari may have problems initializing the WebGL backend for acceleration and will fall back to the CPU. You can use the WebAssembly (wasm) backend as an alternative to WebGL: https://www.tensorflow.org/js/guide/platform_environment#wasm_backend