From 1d2cf253cd10d472cad12b5b9280d9550cc68d71 Mon Sep 17 00:00:00 2001 From: Mert Cobanov Date: Mon, 11 Mar 2024 14:08:57 +0300 Subject: [PATCH] Refactor tasnif.py: Organize imports and update class attributes --- tasnif/tasnif.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tasnif/tasnif.py b/tasnif/tasnif.py index bd730cb..6de334c 100644 --- a/tasnif/tasnif.py +++ b/tasnif/tasnif.py @@ -6,8 +6,12 @@ from tqdm import tqdm from .calculations import calculate_kmeans, calculate_pca, get_embeddings -from .utils import (create_dir, create_image_grid, read_images_from_directory, - read_with_pil) +from .utils import ( + create_dir, + create_image_grid, + read_images_from_directory, + read_with_pil, +) warnings.filterwarnings("ignore") @@ -19,10 +23,12 @@ def __init__(self, num_classes, pca_dim=16, use_gpu=False): self.use_gpu = use_gpu self.embeddings = None self.pca_embeddings = None - self.centroids = None + self.centroid = None self.labels = None self.image_paths = None self.images = [] + self.project_name = None + self.counts = None def read(self, folder_path): """