Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,11 +44,17 @@ def predict_image(image_path, model):
|
|
| 44 |
prediction = model_vgg19.run(None, {input_name: img})
|
| 45 |
|
| 46 |
elif model == "Vgg16":
|
| 47 |
-
|
|
|
|
|
|
|
| 48 |
elif model == "InceptionV3":
|
| 49 |
-
|
|
|
|
|
|
|
| 50 |
elif model == "Resnet101":
|
| 51 |
-
|
|
|
|
|
|
|
| 52 |
prediction = np.argmax(prediction[0][0])
|
| 53 |
pre_class = labels[prediction]
|
| 54 |
|
|
|
|
| 44 |
prediction = model_vgg19.run(None, {input_name: img})
|
| 45 |
|
| 46 |
elif model == "Vgg16":
|
| 47 |
+
input_name = model_vgg16.get_inputs()[0].name
|
| 48 |
+
output_name= model_vgg16.get_outputs()[0].name
|
| 49 |
+
prediction = model_vgg16.run(None, {input_name: img})
|
| 50 |
elif model == "InceptionV3":
|
| 51 |
+
input_name = model_inceptionv3.get_inputs()[0].name
|
| 52 |
+
output_name= model_inceptionv3.get_outputs()[0].name
|
| 53 |
+
prediction = model_inceptionv3.run(None, {input_name: img})
|
| 54 |
elif model == "Resnet101":
|
| 55 |
+
input_name = model_resnet101.get_inputs()[0].name
|
| 56 |
+
output_name= model_resnet101.get_outputs()[0].name
|
| 57 |
+
prediction = model_resnet101.run(None, {input_name: img})
|
| 58 |
prediction = np.argmax(prediction[0][0])
|
| 59 |
pre_class = labels[prediction]
|
| 60 |
|