RashiAgarwal
commited on
Commit
•
0869998
1
Parent(s):
71b5c6c
Update display.py
Browse files- display.py +3 -1
display.py
CHANGED
@@ -4,9 +4,11 @@ import albumentations as A
|
|
4 |
from utils import *
|
5 |
import random
|
6 |
from albumentations.pytorch import ToTensorV2
|
|
|
7 |
|
8 |
def inference(image: np.ndarray, iou_thresh: float = 0.5, thresh: float = 0.4, show_cam: bool = False, transparency: float = 0.5):
|
9 |
-
|
|
|
10 |
transforms = A.Compose(
|
11 |
[
|
12 |
A.LongestMaxSize(max_size=config.IMAGE_SIZE),
|
|
|
4 |
from utils import *
|
5 |
import random
|
6 |
from albumentations.pytorch import ToTensorV2
|
7 |
+
from yolov3 import YOLOV3_PL
|
8 |
|
9 |
def inference(image: np.ndarray, iou_thresh: float = 0.5, thresh: float = 0.4, show_cam: bool = False, transparency: float = 0.5):
|
10 |
+
model = YOLOV3_PL()
|
11 |
+
model.load_state_dict(torch.load("model.pth", map_location=torch.device('cpu')), strict=False)
|
12 |
transforms = A.Compose(
|
13 |
[
|
14 |
A.LongestMaxSize(max_size=config.IMAGE_SIZE),
|