Skip to content

Backend app for create traffic accident forecast via ready ML model on the weather conditions at Moscow north

License

Notifications You must be signed in to change notification settings

jsinkx/traffic-accident-backend-ml

Repository files navigation

Traffic accident backend ML app

Create traffic accident forecast wia weather conditions in Moscow at north


Documentation

Simple markdown documentation

Stack

  • Flask
  • joblib

Configuration

An example of the config is in .env.example, but to use it you need to use .env

The integration of the config from env into python variables is in ./shared/config.py

Before using it, it is necessary to load the .pkl of trained models in ./models and register them in ./models.json.

You can get models in the traffic-accident-ml repository or download from Google Drive

Production mode

By docker

Way without create .env

docker build -t traffic-accident-backend-ml --build-arg SERVER_HOST=<SERVER_HOST> --build-arg SERVER_PORT=<SERVER_PORT> --build-arg IS_PROD=<IS_PROD> .

Warning: don't forget to create .env and add pkl models

docker build -t traffic-accident-backend-ml .

Run build container

docker run --name traffic-accident-backend-ml --restart=always -d -p 5000:5000 traffic-accident-backend-ml

Dev mode & installation

  1. > Python 3.10
  2. Install all libs from requirements.txt

Install all dependencies

cd traffic-accident-backend-ml
pip install --no-cache-dir -r requirements.txt

Run python3 -m flask run --host=0.0.0.0

About

Backend app for create traffic accident forecast via ready ML model on the weather conditions at Moscow north

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published