Andrew-Zhu / MSES

Emergency vehicle detection and tracking software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

This directory contains PyTorch YOLOv3 software developed by Ultralytics LLC, and is freely available for redistribution under the GPL-3.0 license. For more information please visit https://www.ultralytics.com.
YOLOv3 was taken from here, and was upgraded for the emergency venicle detection and tracking task.

Requirements

Python 3.7 or later with the following pip3 install -U -r requirements.txt packages:

  • cython
  • numpy
  • torch >= 1.1.0
  • opencv-python
  • tqdm
  • numba
  • scikit-learn
  • scikit-image
  • filterpy

And may be smth else :)

Docker

DockerHub repository

Image

Downloading docker image from dockerhub: docker pull morememes/emergency-tracker:latest

Building docker image from dockerfile: docker build -t morememes/emergency-tracker:latest .

Container

Run container: docker run --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all -v $(pwd)/weights:/MSES/weights -v $(pwd)/newData:/MSES/newData -it -p 8080:8080 -p 6006:6006 -p 8888:8888 morememes/emergency-tracker:latest

--runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all - gpu visibility in the container.

-v localDir:containerDir - mapping directories.

-p localPort:containerPort - mapping network ports.

Use bash create_dirs.sh for fast creating directories.

Fast install

bash create_dirs.sh && docker build -t morememes/emergency-tracker:latest . && docker run --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all -v $(pwd)/weights:/MSES/weights -v $(pwd)/newData:/MSES/newData -it -p 8080:8080 -p 6006:6006 -p 8888:8888 morememes/emergency-tracker:latest

Training

Any information that you may need to train placed also here as well as the way to use this software to transfer-learning, resume training etc.

Inference

detect.py runs inference on any sources:

python3 detect.py --source ...
  • Image: --source file.jpg
  • Video: --source file.mp4
  • Directory: --source dir/
  • Webcam: --source 0
  • RTSP stream: --source rtsp://170.93.143.139/rtplive/470011e600ef003a004ee33696235daa
  • HTTP stream: --source http://wmccpinetop.axiscam.net/mjpg/video.mjpg

To run a model with track objects you just need to add --track:

YOLOv3: python3 detect.py --cfg cfg/yolov3.cfg --weights weights/best.pt --source newData/inference/ --track

Pretrained Weights and Dataset

Download from:
Weights
Dataset

WEB-service:

Requrements: npm,angular

To run:

  1. in root: python flask_app.py

  2. in MSES-front:

       2.1) npm i           
       2.2) ng serve
    
  3. go to http://localhost:4200

Literature

About

Emergency vehicle detection and tracking software


Languages

Language:Python 85.1%Language:TypeScript 6.2%Language:Shell 5.3%Language:HTML 1.2%Language:CSS 1.1%Language:JavaScript 0.9%Language:Dockerfile 0.2%