Skip to content

Commit dbbff0f

Browse files
committed
Fix: 수정 import error
1 parent a3efdbf commit dbbff0f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/AIProcessor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import cv2
55
from ultralytics import YOLO
66
from ultralytics import SAM
7-
from segment_anything import sam_model_registry, SamPredictor
7+
# from segment_anything import sam_model_registry, SamPredictor
88
import io
99
import logging
1010

@@ -50,9 +50,10 @@ def remove_alpha(self, image):
5050
return image_rgb
5151

5252
def load_sam_model(self, model_type="vit_h"): # sam 로드
53-
self.sam_model = sam_model_registry[model_type](checkpoint=self.sam_path)
54-
self.sam_model.to(self.device)
55-
self.predictor = SamPredictor(self.sam_model)
53+
# self.sam_model = sam_model_registry[model_type](checkpoint=self.sam_path)
54+
# self.sam_model.to(self.device)
55+
# self.predictor = SamPredictor(self.sam_model)
56+
logging.info("SAM model cannot be loaded")
5657

5758
def object_detection(self, img):
5859
results = self.yolo_model.predict(source=img, imgsz=640, device=self.device,

0 commit comments

Comments
 (0)