Spaces:
Sleeping
Sleeping
NikiTricky
commited on
Commit
·
34ba7da
1
Parent(s):
7fdcf83
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ model = from_pretrained_keras("NikiTricky/resnet50-food101")
|
|
6 |
def classify_image(inp):
|
7 |
print("Classifying image...")
|
8 |
inp = inp.reshape((-1, 224, 224, 3))
|
9 |
-
inp
|
10 |
prediction = model.predict(inp)[0]
|
11 |
print(prediction, model.config)
|
12 |
confidences = {model.config['id2label'][str(i)]: float(prediction[i]) for i in range(101)}
|
|
|
6 |
def classify_image(inp):
|
7 |
print("Classifying image...")
|
8 |
inp = inp.reshape((-1, 224, 224, 3))
|
9 |
+
inp = inp/255
|
10 |
prediction = model.predict(inp)[0]
|
11 |
print(prediction, model.config)
|
12 |
confidences = {model.config['id2label'][str(i)]: float(prediction[i]) for i in range(101)}
|