Spaces:
Running
Running
DEVAN CHAUHAN commited on
Commit ·
b226f55
1
Parent(s): e1e711e
[fix] error
Browse files
app.py
CHANGED
|
@@ -111,8 +111,6 @@ with gr.Blocks() as demo:
|
|
| 111 |
)
|
| 112 |
|
| 113 |
img_input = gr.Image(type="pil")
|
| 114 |
-
status = gr.Text()
|
| 115 |
-
img_output = gr.Image()
|
| 116 |
embedding_output = gr.JSON()
|
| 117 |
|
| 118 |
run_btn = gr.Button("Run Pipeline")
|
|
@@ -120,15 +118,15 @@ with gr.Blocks() as demo:
|
|
| 120 |
def run_pipeline(img, mode):
|
| 121 |
status_msg, processed_img = process_image(img, mode)
|
| 122 |
if status_msg != "Success ✅":
|
| 123 |
-
return
|
| 124 |
|
| 125 |
embedding = get_image_embedding(processed_img)
|
| 126 |
-
return
|
| 127 |
|
| 128 |
run_btn.click(
|
| 129 |
run_pipeline,
|
| 130 |
inputs=[img_input, mode_selector],
|
| 131 |
-
outputs=[
|
| 132 |
)
|
| 133 |
|
| 134 |
with gr.Tab("Embedding Only"):
|
|
|
|
| 111 |
)
|
| 112 |
|
| 113 |
img_input = gr.Image(type="pil")
|
|
|
|
|
|
|
| 114 |
embedding_output = gr.JSON()
|
| 115 |
|
| 116 |
run_btn = gr.Button("Run Pipeline")
|
|
|
|
| 118 |
def run_pipeline(img, mode):
|
| 119 |
status_msg, processed_img = process_image(img, mode)
|
| 120 |
if status_msg != "Success ✅":
|
| 121 |
+
return {"embedding": None}
|
| 122 |
|
| 123 |
embedding = get_image_embedding(processed_img)
|
| 124 |
+
return embedding
|
| 125 |
|
| 126 |
run_btn.click(
|
| 127 |
run_pipeline,
|
| 128 |
inputs=[img_input, mode_selector],
|
| 129 |
+
outputs=[embedding_output]
|
| 130 |
)
|
| 131 |
|
| 132 |
with gr.Tab("Embedding Only"):
|