Alessio Grancini commited on
Commit
908272b
·
verified ·
1 Parent(s): 2f27314

Update image_segmenter.py

Browse files
Files changed (1) hide show
  1. 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") -> None:
11
- # Initialize parameters
12
- self.model_type = model_type
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