Spaces:
Running
on
T4
Running
on
T4
MikkoLipsanen
commited on
Update segment_image.py
Browse files- segment_image.py +2 -2
segment_image.py
CHANGED
@@ -61,7 +61,7 @@ class SegmentImage:
|
|
61 |
try:
|
62 |
# Load the trained line detection model
|
63 |
cached_model_path = hf_hub_download(repo_id=self.line_model_path, filename="lines_20240827.pt")
|
64 |
-
line_model = YOLO(cached_model_path
|
65 |
return line_model
|
66 |
except Exception as e:
|
67 |
print('Failed to load the line detection model: %s' % e)
|
@@ -71,7 +71,7 @@ class SegmentImage:
|
|
71 |
try:
|
72 |
# Load the trained line detection model
|
73 |
cached_model_path = hf_hub_download(repo_id=self.region_model_path, filename="tuomiokirja_regions_04122023.pt")
|
74 |
-
region_model = YOLO(cached_model_path
|
75 |
return region_model
|
76 |
except Exception as e:
|
77 |
print('Failed to load the region detection model: %s' % e)
|
|
|
61 |
try:
|
62 |
# Load the trained line detection model
|
63 |
cached_model_path = hf_hub_download(repo_id=self.line_model_path, filename="lines_20240827.pt")
|
64 |
+
line_model = YOLO(cached_model_path)
|
65 |
return line_model
|
66 |
except Exception as e:
|
67 |
print('Failed to load the line detection model: %s' % e)
|
|
|
71 |
try:
|
72 |
# Load the trained line detection model
|
73 |
cached_model_path = hf_hub_download(repo_id=self.region_model_path, filename="tuomiokirja_regions_04122023.pt")
|
74 |
+
region_model = YOLO(cached_model_path)
|
75 |
return region_model
|
76 |
except Exception as e:
|
77 |
print('Failed to load the region detection model: %s' % e)
|