Spaces:
Sleeping
Sleeping
Update segment_image.py
Browse files- segment_image.py +2 -2
segment_image.py
CHANGED
|
@@ -58,7 +58,7 @@ class SegmentImage:
|
|
| 58 |
"""Function for initializing the line detection model."""
|
| 59 |
try:
|
| 60 |
# Load the trained line detection model
|
| 61 |
-
line_model = YOLO(self.line_model_path)
|
| 62 |
return line_model
|
| 63 |
except Exception as e:
|
| 64 |
print('Failed to load the line detection model: %s' % e)
|
|
@@ -67,7 +67,7 @@ class SegmentImage:
|
|
| 67 |
"""Function for initializing the region detection model."""
|
| 68 |
try:
|
| 69 |
# Load the trained line detection model
|
| 70 |
-
region_model = YOLO(self.region_model_path)
|
| 71 |
return region_model
|
| 72 |
except Exception as e:
|
| 73 |
print('Failed to load the region detection model: %s' % e)
|
|
|
|
| 58 |
"""Function for initializing the line detection model."""
|
| 59 |
try:
|
| 60 |
# Load the trained line detection model
|
| 61 |
+
line_model = YOLO(self.line_model_path, task="instance-segmentation")
|
| 62 |
return line_model
|
| 63 |
except Exception as e:
|
| 64 |
print('Failed to load the line detection model: %s' % e)
|
|
|
|
| 67 |
"""Function for initializing the region detection model."""
|
| 68 |
try:
|
| 69 |
# Load the trained line detection model
|
| 70 |
+
region_model = YOLO(self.region_model_path, task="instance-segmentation")
|
| 71 |
return region_model
|
| 72 |
except Exception as e:
|
| 73 |
print('Failed to load the region detection model: %s' % e)
|