Isaacgonzales
commited on
Commit
•
8e12dfe
1
Parent(s):
5a7c59c
update model
Browse files
model.py
CHANGED
@@ -19,16 +19,17 @@ model.float()
|
|
19 |
|
20 |
SHAPE_X = 384
|
21 |
SHAPE_Y = 384
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
|
24 |
def prediction(image_path):
|
25 |
t_start = process_time()
|
26 |
image = cv2.imread(image_path)
|
27 |
image_original = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
28 |
-
preprocessing_fn = smp.encoders.get_preprocessing_fn('resnet50')
|
29 |
-
transform = albu.Compose([
|
30 |
-
albu.Lambda(image=preprocessing_fn), albu.Resize(SHAPE_X, SHAPE_Y)
|
31 |
-
])
|
32 |
|
33 |
image_result = transform(image=image_original)["image"]
|
34 |
transform = transforms.ToTensor()
|
|
|
19 |
|
20 |
SHAPE_X = 384
|
21 |
SHAPE_Y = 384
|
22 |
+
preprocessing_fn = smp.encoders.get_preprocessing_fn('resnet50')
|
23 |
+
|
24 |
+
transform = albu.Compose([
|
25 |
+
albu.Lambda(image=preprocessing_fn), albu.Resize(SHAPE_X, SHAPE_Y)
|
26 |
+
])
|
27 |
|
28 |
|
29 |
def prediction(image_path):
|
30 |
t_start = process_time()
|
31 |
image = cv2.imread(image_path)
|
32 |
image_original = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
|
|
|
|
|
|
|
|
33 |
|
34 |
image_result = transform(image=image_original)["image"]
|
35 |
transform = transforms.ToTensor()
|