Commit
·
ac15725
1
Parent(s):
fd39302
Update handler.py
Browse files- handler.py +4 -0
handler.py
CHANGED
|
@@ -6,6 +6,8 @@ from PIL import Image
|
|
| 6 |
import time
|
| 7 |
import logging
|
| 8 |
import os
|
|
|
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
class EndpointHandler():
|
|
@@ -18,6 +20,8 @@ class EndpointHandler():
|
|
| 18 |
t1 = time.time()
|
| 19 |
self.model = YOLO(os.path.join(path, 'yolov8m_detect_usdl.pt'))
|
| 20 |
logging.info(f'TIME: loading the model {time.time() - t1}')
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
def __call__(self, data: Dict) -> Dict:
|
|
|
|
| 6 |
import time
|
| 7 |
import logging
|
| 8 |
import os
|
| 9 |
+
import torch
|
| 10 |
+
import torchvision
|
| 11 |
|
| 12 |
|
| 13 |
class EndpointHandler():
|
|
|
|
| 20 |
t1 = time.time()
|
| 21 |
self.model = YOLO(os.path.join(path, 'yolov8m_detect_usdl.pt'))
|
| 22 |
logging.info(f'TIME: loading the model {time.time() - t1}')
|
| 23 |
+
logging.info(f'torch version : {torch.__version__}')
|
| 24 |
+
logging.info(f'torch vision version: {torchvision.__version__}')
|
| 25 |
|
| 26 |
|
| 27 |
def __call__(self, data: Dict) -> Dict:
|