Skip to content

Commit

Permalink
fix uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
shamspias committed Sep 8, 2024
1 parent 3752fb3 commit 101bea2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/sahi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self, debug, model_path, model_type='yolov8', device='cpu', slice_s
self.model = self.load_model(model_path)
self.slice_size = slice_size
self.overlap_ratio = overlap_ratio
self.debug_annotated_directory = 0
self.debug_annotated_directory = str(uuid.uuid4())

def load_model(self, model_path):
"""Loads a detection model based on the specified type and path."""
Expand Down Expand Up @@ -63,10 +63,10 @@ def perform_sliced_inference(self, image):
if self.debug:
random_value = str(uuid.uuid4())
# Start exporting the image
results.export_visuals(export_dir=f"temp/{str(self.debug_annotated_directory)}/", file_name=random_value)
results.export_visuals(export_dir=f"temp/{self.debug_annotated_directory}/", file_name=random_value)

# Wait until the file is created
file_path = f"temp/{str(self.debug_annotated_directory)}/{random_value}.png"
file_path = f"temp/{self.debug_annotated_directory}/{random_value}.png"
timeout = 10 # Set a timeout limit of 10 seconds or more if necessary
start_time = time.time()

Expand Down

0 comments on commit 101bea2

Please sign in to comment.