Spaces:
Running
Running
Commit
•
ce90b56
1
Parent(s):
19b0d07
Update app.py
Browse files
app.py
CHANGED
@@ -36,14 +36,10 @@ model = load_model("tf_model.h5")
|
|
36 |
|
37 |
def pkm_predict(image):
|
38 |
image = crop_center(image)
|
39 |
-
print(image.shape)
|
40 |
image = resizeImage(image)
|
41 |
-
print(image.shape)
|
42 |
K_test = (image - image.mean()) / image.std()
|
43 |
-
print(image.shape)
|
44 |
K_test = np.reshape(K_test, (1, 256, 256, 3))
|
45 |
predictions = model.predict(K_test)
|
46 |
-
print(predictions)
|
47 |
predictions = list(map(lambda x: 0 if x<0.5 else 1, predictions)) # get binary values predictions with 0.5 as thresold
|
48 |
print(predictions)
|
49 |
if predictions == [1]:
|
|
|
36 |
|
37 |
def pkm_predict(image):
|
38 |
image = crop_center(image)
|
|
|
39 |
image = resizeImage(image)
|
|
|
40 |
K_test = (image - image.mean()) / image.std()
|
|
|
41 |
K_test = np.reshape(K_test, (1, 256, 256, 3))
|
42 |
predictions = model.predict(K_test)
|
|
|
43 |
predictions = list(map(lambda x: 0 if x<0.5 else 1, predictions)) # get binary values predictions with 0.5 as thresold
|
44 |
print(predictions)
|
45 |
if predictions == [1]:
|