Skip to content

YOLO-based API to train and run multiple segmentation and classification AIs, with stress testing, automatic logging, and support for creating segmentation datasets from bounding boxes

Notifications You must be signed in to change notification settings

alecremer/vision_api

Repository files navigation

Vision

Description

This API provides tools to simplify training and running multiple AI models, as well as performing hardware stress tests and automatic performance logging.

Features:

  • Train multiple AIs in a stack

  • Run multiple AI models simultaneously with different settings

  • Perform hardware stress tests

  • Generate detailed performance logs

  • Automate log processing and data visualization

How to use

  1. Configure the AI models in the configuration file

  2. Run in live or train

  3. (optional) Run data processing

How to run

python3 main.py [mode] [-args]

modes

1. Live

run real-time detection

python3 main.py live [-args]

args:

  • -nv no video

  • -cap capture objects (process image)

  • -pl create performance logs

  • -rtsp live from video of rtsp server

  • -sf [frame_number] skip frames for better performance

  • -rec [output_file_name] record

  • -f [file_path] live from file

2. Train:

run train :)

python3 main.py train

Note

If segmentation IA, run segmentation from boxes


3. Data processing:

Generate plots from logs, separating capture objects from non capture objects.

python3 data_processing.py

Processed logs are saved in the logs_processed folder

2. Annotation:

run annotation call:

python3 main.py annotate -p [path_to_images]

Performance Logs

Logs include time, ram usage, gpu usage, cpu usage, cycle time, active AIs and captre objects data.

Important

Logs are always saved on logs folder

Configuration file

All AI settings are defined in the config.yaml file.

Parameters:

  • dataset: dataset path

  • weights: weights path for detection

  • confidence: confidence for detection

  • label: class label

  • epochs: train epochs

  • device: cpu or gpu

  • result folder name: name of folder for train results

  • model: AI model

  • detect: true or false, activate detection for this AI

  • train: true or false, activate train for this AI

  • segmentation: true or false, set true if segmentation AI

Segmentation from boxes

Create segmentation dataset from bounding boxes dataset

  1. Configure paths in segmentation config file

  2. In seg_from_boxes folder, run python3 seg.py

Segmentation configuration file

parameters:

  • raw_path: path to folder containing raw images folder and labels folder

  • save_path: path to save segmentation dataset

  • save_path_prefix: create parent folder for save path, can be empty

  • epochs: train epochs

About

YOLO-based API to train and run multiple segmentation and classification AIs, with stress testing, automatic logging, and support for creating segmentation datasets from bounding boxes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages