-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
aimspot edited this page Aug 21, 2023
·
11 revisions
Illustrative example: Example API
- Download the repository and install dependencies
!git clone https://github.com/saaresearch/ODRS.git
%cd ODRS/
!pip install -r requirements.txt
%cd ..
- To use our recommender system, run the following code:
- job - current task (ml_recommend / object_detection);
- path - Path to a set of images in yolo format;
- classes - The name of the txt file containing the name of the classes;
- gpu - The model will be used on GPU or CPU (True / False);
- accuracy - If you want max accuracy choose 10. For lower accuracy 1 (1 - 10);
- speed - If you want max speed choose 5. For lower speed 1 (1 - 5);
from ODRS.ODRS.api.odrs import ODRS
odrs = ODRS(job="ml_recommend", data_path='/media/farm/ssd_1_tb_evo_sumsung/ODRS/user_datasets/yolo/Aerial_Maritime', classes="classes.txt",
gpu=True, accuracy=10, speed=1)
odrs.fit()
- Use the following code to train models:
- job - current task (ml_recommend / object_detection);
- path - Path to a set of images in yolo format;
- classes - The name of the txt file containing the name of the classes;
- model - The name of the model you want to train ("yolov5l", "yolov5m", "yolov5n", "yolov5s", "yolov5x","yolov7x", "yolov7", "yolov7-tiny", #"yolov8x6", "yolov8x", "yolov8s", "yolov8n", "yolov8m", "faster-rcnn", "ssd");
- gpu-count - Number of video cards involved in training;
- select_gpu - Numbers of selected video cards("0,1,2" / "cpu" if gpu-count == 0);
- config_path - The name of the configuration that will be generated automatically;
from ODRS.ODRS.api.odrs import ODRS
#init object with parameters
odrs_1 = ODRS(job="object_detection", data_path = '/media/farm/ssd_1_tb_evo_sumsung/ODRS/user_datasets/yolo/Aerial_Maritime', classes = "classes.txt",
img_size = "256", batch_size = "18", epochs = "3",
model = 'yolov5l', gpu_count = 1, select_gpu = "0", config_path = "dataset.yaml",
split_train_value = 0.6, split_test_value = 0.35, split_val_value = 0.05)
# start tranning
odrs_1.fit()
- Download the repository and install dependencies
!git clone https://github.com/saaresearch/ODRS.git
cd ODRS/
!pip install -r requirements.txt
Illustrative example: Example
-
cd ODRS/
; - Put your dataset in yolo format in the user_datasets/yolo directory;
- Add to the root directory of the project .txt a file containing the names of all classes in your set of images;
-
cd ODRS/ml_utils/config/
, open file ml_config.yaml and set your parameters; -
cd ..
; - Run script:
python3 ml_model_optimizer.py
.
Illustrative example: Example
-
cd ODRS/
; - Put your dataset in yolo format in the user_datasets/yolo directory;
- Add to the root directory of the project .txt a file containing the names of all classes in your set of images;
-
cd ODRS/train_utils/config/
, open file ml_config.yaml and set your parameters; -
cd ..
; - Run script:
python3 custom_train_all.py
.