Alessio Grancini
commited on
Update image_segmenter.py
Browse files- image_segmenter.py +3 -3
image_segmenter.py
CHANGED
|
@@ -7,9 +7,9 @@ import os
|
|
| 7 |
import torch
|
| 8 |
|
| 9 |
class ImageSegmenter:
|
| 10 |
-
def __init__(self, model_type="yolov8s-seg")
|
| 11 |
-
|
| 12 |
-
self.
|
| 13 |
self.is_show_bounding_boxes = True
|
| 14 |
self.is_show_segmentation_boundary = False
|
| 15 |
self.is_show_segmentation = False
|
|
|
|
| 7 |
import torch
|
| 8 |
|
| 9 |
class ImageSegmenter:
|
| 10 |
+
def __init__(self, model_type="yolov8s-seg", device="cpu"):
|
| 11 |
+
self.device = device
|
| 12 |
+
self.model = YOLO(model_type).to(self.device)
|
| 13 |
self.is_show_bounding_boxes = True
|
| 14 |
self.is_show_segmentation_boundary = False
|
| 15 |
self.is_show_segmentation = False
|