Spaces:
Runtime error
Runtime error
Add application file
Browse files
app.py
CHANGED
|
@@ -63,10 +63,11 @@ label = gr.outputs.Label()
|
|
| 63 |
examples = ['images/airplane_002.jpg','images/airplane_003.jpg','images/airport_020.jpg','images/airport_075.jpg','images/bridge_679.jpg','images/cloud_227.jpg','images/freeway_159.jpg','images/forest_235.jpg']
|
| 64 |
|
| 65 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
| 66 |
-
intf.launch(inline=False)
|
| 67 |
|
|
|
|
|
|
|
| 68 |
# def classify_image(img):
|
| 69 |
# arr = np.expand_dims(img, axis=0)
|
| 70 |
# arr = tf.keras.applications.mobilenet.preprocess_input(arr)
|
| 71 |
# prediction = model.predict(arr).flatten()
|
| 72 |
-
# return {labels[i]: float(prediction[i]) for i in range(45)}
|
|
|
|
| 63 |
examples = ['images/airplane_002.jpg','images/airplane_003.jpg','images/airport_020.jpg','images/airport_075.jpg','images/bridge_679.jpg','images/cloud_227.jpg','images/freeway_159.jpg','images/forest_235.jpg']
|
| 64 |
|
| 65 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
|
|
|
| 66 |
|
| 67 |
+
if __name__ == "__main__":
|
| 68 |
+
intf.launch(share=True,inline=False)
|
| 69 |
# def classify_image(img):
|
| 70 |
# arr = np.expand_dims(img, axis=0)
|
| 71 |
# arr = tf.keras.applications.mobilenet.preprocess_input(arr)
|
| 72 |
# prediction = model.predict(arr).flatten()
|
| 73 |
+
# return {labels[i]: float(prediction[i]) for i in range(45)}
|