daita-technologies / ai-tools

AI-based tools for the DAITA platform.
http://app.daita.tech
GNU Affero General Public License v3.0
1 stars 0 forks source link
ai-tools augmentation preprocessing python

AI Tools for the DAITA Platform

👮‍♂️ Sanity checks

Preprocessing and Augmentation

Preprocessing Methods

List of preprocessing methods:

Augmentation Methods

List of augmentation methods:

Installation

We recommend using Python versions 3.8 or 3.9. First, create a virtual environment:

virtualenv venv

The virtualenv package is required to create virtual environments; you can install it with pip: pip install virtualenv.

Now, activate the virtual environment:

Eventually, install all dependencies:

pip install -r AI/requirements.txt --find-links=https://download.pytorch.org/whl/torch_stable.html

Deployment via Rest API on Endpoint 0.0.0.0:8000/ai

OMP_NUM_THREADS=12 ray start --head; python AI/deploy.py

How to Use

Preprocessing Methods

import requests

# Send HTTP POST request
response = requests.post(
    "http://0.0.0.0:8000/ai",
    json={
        "images_paths": [
            "AI/data/sample/images/20180810150607_camera_frontcenter_000000083.png",
            "AI/data/sample/images/20181016125231_camera_frontcenter_000183553.png",
            "AI/data/sample/images/20181108084007_camera_frontcenter_000029570.png",
            "AI/data/sample/images/20181108123750_camera_frontcenter_000004559.png",
            "AI/data/sample/images/20190401145936_camera_frontcenter_000017970.png"
        ],
        "output_folder": "AI/data/sample/output/",
        "type": "preprocessing",
        "codes": [],
    }
)
print(response.json())

Augmentation Methods

import requests

# Send HTTP POST request
response = requests.post(
    "http://0.0.0.0:8000/ai",
    json={
        "images_paths": [
            "AI/data/sample/images/20180810150607_camera_frontcenter_000000083.png",
            "AI/data/sample/images/20181016125231_camera_frontcenter_000183553.png",
            "AI/data/sample/images/20181108084007_camera_frontcenter_000029570.png",
            "AI/data/sample/images/20181108123750_camera_frontcenter_000004559.png",
            "AI/data/sample/images/20190401145936_camera_frontcenter_000017970.png"
        ],
        "output_folder": "AI/data/sample/output/",
        "type": "augmentation",
        "num_augments_per_image": 2,
        "codes": [],
    }
)
print(response.json())

Libraries


A Note on Releases

The repository should be setup in the future in such a way that changes to the branch release-staging and release-production will trigger a rebuild of the Staging and the Production application, respectively.

The merge flow for changes should be as follows:

<feature_branch> -> <develop> -> <main> -> <release-staging> -> <release-production>

Git Merge Flow