Real-time abnormal behavior classification using AI-based CCTV
Clone the repository recursively.
$ git clone --recurse-submodules https://github.com/mikel-brostrom/Yolov5_DeepSort_Pytorch.git
Install dependencies for ai-cctv
.
pip install -r requirements.txt
cd Yolov5_DeepSort_Pytorch
python3 track.py --source <Path for the video file> --yolo_weights yolov5n6.pt --classes 0 --save-txt
or using script file.
./scripts/track.sh
if permission denied,
chmod 755 ./scripts/trach.sh
output text file will be generated at Yolov5_DeepSort_Pytorch/inference/output
.
About XML Meta data format: here
Parse XML file.
python3 utils/xml_parser.py <filename>
use image_getter.py
to get only images with abnormal action by using XML meta data.
python3 utils/image_getter.py <video name> Yolov5_DeepSort_Pytorch/inference/output/<result name> <output name>
with some restrictions,
- at abnormal actions.
- detect 2 people. (not 1 or 3)
API server for sending the detected abnormal actions.
uvicorn main:app --reload
Client for the abnormal detection.
npm i
npm run start