ShAnSantosh
commited on
Commit
·
b1cd55c
1
Parent(s):
e5e4fc5
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ labels = {0: 'bacterial_leaf_blight',
|
|
17 |
8: 'normal',
|
18 |
9: 'tungro'}
|
19 |
|
20 |
-
|
21 |
model.eval()
|
22 |
image = image.to(device)
|
23 |
print(image.shape)
|
@@ -27,7 +27,7 @@ labels = {0: 'bacterial_leaf_blight',
|
|
27 |
return out
|
28 |
|
29 |
|
30 |
-
|
31 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
32 |
mean = (0.485, 0.456, 0.406)
|
33 |
std = (0.229, 0.224, 0.225)
|
|
|
17 |
8: 'normal',
|
18 |
9: 'tungro'}
|
19 |
|
20 |
+
def inference_fn(model, image=None):
|
21 |
model.eval()
|
22 |
image = image.to(device)
|
23 |
print(image.shape)
|
|
|
27 |
return out
|
28 |
|
29 |
|
30 |
+
def predict(image = None) :
|
31 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
32 |
mean = (0.485, 0.456, 0.406)
|
33 |
std = (0.229, 0.224, 0.225)
|