Commit
·
30d9209
1
Parent(s):
1ebf67c
fix: model path
Browse files- config/settings.py +1 -0
- utils/api.py +3 -1
config/settings.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
MODEL_PATH = './weights/nsfw_detector_e_rok.pt'
|
utils/api.py
CHANGED
@@ -7,11 +7,13 @@ import torch
|
|
7 |
|
8 |
from .general import non_max_suppression, scale_boxes
|
9 |
from models.common import DetectMultiBackend
|
|
|
|
|
10 |
from .torch_utils import select_device
|
11 |
|
12 |
# 모델 로드
|
13 |
device = select_device('')
|
14 |
-
model = DetectMultiBackend(
|
15 |
names = model.names
|
16 |
imgsz = (640, 640)
|
17 |
|
|
|
7 |
|
8 |
from .general import non_max_suppression, scale_boxes
|
9 |
from models.common import DetectMultiBackend
|
10 |
+
from config.settings import MODEL_PATH
|
11 |
+
|
12 |
from .torch_utils import select_device
|
13 |
|
14 |
# 모델 로드
|
15 |
device = select_device('')
|
16 |
+
model = DetectMultiBackend(MODEL_PATH, device=device, dnn=False, data='data/coco128.yaml', fp16=False)
|
17 |
names = model.names
|
18 |
imgsz = (640, 640)
|
19 |
|