Update app.py
Browse files
app.py
CHANGED
|
@@ -84,7 +84,7 @@ def Retrieval(image, candidate_labels, text_type):
|
|
| 84 |
|
| 85 |
|
| 86 |
def infer(image, candidate_labels, text_type):
|
| 87 |
-
assert text_type in ["short","long", "box"]
|
| 88 |
candidate_labels = ast.literal_eval(candidate_labels)
|
| 89 |
fg_probs = Retrieval(image, candidate_labels,text_type)
|
| 90 |
return postprocess_result(fg_probs,candidate_labels)
|
|
@@ -135,4 +135,4 @@ with gr.Blocks() as demo:
|
|
| 135 |
run_button.click(fn=infer, inputs=[image_input, text_input, text_type], outputs=fg_output)
|
| 136 |
|
| 137 |
# demo.launch(server_name="0.0.0.0", server_port=7861, share=True)
|
| 138 |
-
demo.launch(
|
|
|
|
| 84 |
|
| 85 |
|
| 86 |
def infer(image, candidate_labels, text_type):
|
| 87 |
+
# assert text_type in ["short","long", "box"]
|
| 88 |
candidate_labels = ast.literal_eval(candidate_labels)
|
| 89 |
fg_probs = Retrieval(image, candidate_labels,text_type)
|
| 90 |
return postprocess_result(fg_probs,candidate_labels)
|
|
|
|
| 135 |
run_button.click(fn=infer, inputs=[image_input, text_input, text_type], outputs=fg_output)
|
| 136 |
|
| 137 |
# demo.launch(server_name="0.0.0.0", server_port=7861, share=True)
|
| 138 |
+
demo.launch()
|