Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ model = load_model('daging128.model')
|
|
12 |
mlb = pickle.loads(open('daging128.pickle', "rb").read())
|
13 |
labl = ['Busuk', 'Segar', 'Setengah']
|
14 |
def gambaran(image):
|
15 |
-
output = imutils.resize(image, width=
|
16 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
17 |
image = cv2.resize(image, (128, 128))
|
18 |
image = image.astype("float") / 255.0
|
@@ -25,7 +25,7 @@ def gambaran(image):
|
|
25 |
label = "{}: {:.2f}%".format(mlb.classes_[j], proba[j] * 100)
|
26 |
cv2.putText(output, label, (10, (i * 30) + 25),
|
27 |
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)
|
28 |
-
return output
|
29 |
|
30 |
|
31 |
|
|
|
12 |
mlb = pickle.loads(open('daging128.pickle', "rb").read())
|
13 |
labl = ['Busuk', 'Segar', 'Setengah']
|
14 |
def gambaran(image):
|
15 |
+
output = imutils.resize(image, width=400)
|
16 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
17 |
image = cv2.resize(image, (128, 128))
|
18 |
image = image.astype("float") / 255.0
|
|
|
25 |
label = "{}: {:.2f}%".format(mlb.classes_[j], proba[j] * 100)
|
26 |
cv2.putText(output, label, (10, (i * 30) + 25),
|
27 |
cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 255, 0), 2)
|
28 |
+
return imutils.resize(output, width=128)
|
29 |
|
30 |
|
31 |
|