Spaces:
Sleeping
Sleeping
Oliver Hamilton
commited on
Commit
·
3e699ac
1
Parent(s):
ce9a899
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,11 +34,23 @@ def infer(image=None):
|
|
| 34 |
return [output, prediction.overview]
|
| 35 |
|
| 36 |
|
| 37 |
-
|
|
|
|
| 38 |
inputs=['image'],
|
| 39 |
outputs=['image', 'text'],
|
| 40 |
allow_flagging='manual',
|
| 41 |
flagging_dir='flagged',
|
| 42 |
examples=["no_bird.jpg", "bird_example1.jpg", "bird_example2.jpg", "bird_example3.jpg"])
|
| 43 |
|
| 44 |
-
interface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
return [output, prediction.overview]
|
| 35 |
|
| 36 |
|
| 37 |
+
def run():
|
| 38 |
+
interface = gr.Interface(fn=infer,
|
| 39 |
inputs=['image'],
|
| 40 |
outputs=['image', 'text'],
|
| 41 |
allow_flagging='manual',
|
| 42 |
flagging_dir='flagged',
|
| 43 |
examples=["no_bird.jpg", "bird_example1.jpg", "bird_example2.jpg", "bird_example3.jpg"])
|
| 44 |
|
| 45 |
+
interface.launch(server_name="0.0.0.0", server_port=7860)
|
| 46 |
+
# demo = gr.Interface(
|
| 47 |
+
# fn=predict,
|
| 48 |
+
# inputs=gr.inputs.Image(type="pil"),
|
| 49 |
+
# outputs=gr.outputs.Label(num_top_classes=3),
|
| 50 |
+
# )
|
| 51 |
+
|
| 52 |
+
# demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
if __name__ == "__main__":
|
| 56 |
+
run()
|