From 6ca36e13a321cf8a4460a2598cf8f1e6cf73c2c3 Mon Sep 17 00:00:00 2001 From: danellecline Date: Tue, 5 Mar 2024 12:37:58 -0800 Subject: [PATCH] fix: correct import paths --- sdcat/cluster/commands.py | 13 +++++++------ sdcat/detect/commands.py | 13 ++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sdcat/cluster/commands.py b/sdcat/cluster/commands.py index ba8482d..e896414 100644 --- a/sdcat/cluster/commands.py +++ b/sdcat/cluster/commands.py @@ -14,18 +14,18 @@ import pytz import torch -import common_args -from config import config as cfg -from logger import info, err, warn +from sdcat import common_args +from sdcat.config import config as cfg +from sdcat.logger import info, err, warn from sdcat.cluster.cluster import cluster_vits + @click.command('cluster', help='Cluster detections. See cluster --config-ini to override cluster defaults.') @common_args.config_ini @click.option('--det-dir', help='Input folder(s) with raw detection results', multiple=True) -@click.option('--save-dir', help='Output directory to save clustered detection results') +@click.option('--save-dir', help='Output directory to save clustered detection results') @click.option('--device', help='Device to use.', type=int) def run_cluster(det_dir, save_dir, device, config_ini): - config = cfg.Config(config_ini) max_area = int(config('cluster', 'max_area')) min_area = int(config('cluster', 'min_area')) @@ -219,7 +219,8 @@ def is_day(utc_dt): prefix = f'{model}_{datetime.now().strftime("%Y%m%d_%H%M%S")}' # Cluster the detections - df_cluster = cluster_vits(prefix, model, df, save_dir, alpha, cluster_selection_epsilon, min_similarity, min_cluster_size, min_samples) + df_cluster = cluster_vits(prefix, model, df, save_dir, alpha, cluster_selection_epsilon, min_similarity, + min_cluster_size, min_samples) # Merge the results with the original DataFrame df.update(df_cluster) diff --git a/sdcat/detect/commands.py b/sdcat/detect/commands.py index a57a1a8..295fcda 100644 --- a/sdcat/detect/commands.py +++ b/sdcat/detect/commands.py @@ -11,13 +11,12 @@ from sahi import AutoDetectionModel from sahi.postprocess.combine import nms -import logger -import common_args -from config import config as cfg -from config.config import default_config_ini -from detect.sahi_detector import run_sahi_detect_bulk, run_sahi_detect -from detect.saliency_detector import run_saliency_detect, run_saliency_detect_bulk -from logger import exception, info, warn +from sdcat import common_args +from sdcat.config import config as cfg +from sdcat.config.config import default_config_ini +from sdcat.detect.sahi_detector import run_sahi_detect_bulk, run_sahi_detect +from sdcat.detect.saliency_detector import run_saliency_detect, run_saliency_detect_bulk +from sdcat.logger import exception, info, warn default_model = 'MBARI/megamidwater'