diff --git a/src/data_processing/ml_processing/annotation_analysis.py b/src/data_processing/ml_processing/annotation_analysis.py index edc5a76..eb71bdc 100644 --- a/src/data_processing/ml_processing/annotation_analysis.py +++ b/src/data_processing/ml_processing/annotation_analysis.py @@ -3,6 +3,9 @@ from tqdm import tqdm from pathlib import Path from collections import defaultdict +file = Path(__file__).resolve() +project_dir = os.path.dirname(os.path.abspath(__file__)) +sys.path.append(os.path.dirname(os.path.dirname(project_dir))) from src.data_processing.data_utils.utils import load_class_names from src.data_processing.ml_processing.plots import plot_class_balance import numpy as np diff --git a/src/data_processing/ml_processing/dataset_processing_module.py b/src/data_processing/ml_processing/dataset_processing_module.py index 66d307a..9297e9e 100644 --- a/src/data_processing/ml_processing/dataset_processing_module.py +++ b/src/data_processing/ml_processing/dataset_processing_module.py @@ -9,7 +9,10 @@ import csv import yaml from collections import Counter + file = Path(__file__).resolve() +project_dir = os.path.dirname(os.path.abspath(__file__)) +sys.path.append(os.path.dirname(os.path.dirname(project_dir))) from src.data_processing.ml_processing.plots import plot_class_balance from src.data_processing.ml_processing.annotation_analysis import analysis_yolo_annotations, analysis_stats diff --git a/src/data_processing/ml_processing/recommendation_module.py b/src/data_processing/ml_processing/recommendation_module.py index ca3ebca..abbc450 100644 --- a/src/data_processing/ml_processing/recommendation_module.py +++ b/src/data_processing/ml_processing/recommendation_module.py @@ -1,11 +1,16 @@ +import os +import sys import pandas as pd import catboost as cat from pathlib import Path import umap.umap_ as umap import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler, LabelEncoder -from src.data_processing.ml_processing.plots import plot_with_lines_and_predictions file = Path(__file__).resolve() +project_dir = os.path.dirname(os.path.abspath(__file__)) +sys.path.append(os.path.dirname(os.path.dirname(project_dir))) + +from src.data_processing.ml_processing.plots import plot_with_lines_and_predictions def ml_predict(df_rules, df_dataset_features, run_path):