-
Notifications
You must be signed in to change notification settings - Fork 0
/
fabfile.py
31 lines (24 loc) · 1.3 KB
/
fabfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Libraries
import os
from pathlib import Path
from fabric import task
# Source Modules
from src.computer_vision import cv
from src import model_predict
from src import model_train
@task
def TrainModel(c):
dataset_folder_path = "/home/lucas/Documentos/Universidade/Disciplinas/MC886/ProjetoFinal/TrashDetection/Datasets/TrashDetectionDataset"
output_model_path = "runs"
dataset_folder_path = cv.read_folder_path(dataset_folder_path)
output_model_path = cv.read_folder_path(output_model_path)
model_train.run_training(dataset_folder_path, output_model_path)
@task
def PredictImages(c):
images_folder_path = "/home/lucas/Documentos/Universidade/Disciplinas/MC886/ProjetoFinal/TrashDetection/Datasets/TrashDetectionDataset/test/images"
output_folder_path = "/home/lucas/Documentos/Universidade/Disciplinas/MC886/ProjetoFinal/TrashDetection/results/test1"
model_path = "/home/lucas/Documentos/Universidade/Disciplinas/MC886/ProjetoFinal/TrashDetection/runs/segment/train5/weights/best.pt"
images_folder_path = cv.read_folder_path(images_folder_path)
output_folder_path = cv.read_folder_path(output_folder_path)
model_path = cv.read_file_path(model_path)
model_predict.run_prediction(images_folder_path, output_folder_path, model_path, show=False)