Spaces:
Paused
Paused
removed json output
Browse files
app.py
CHANGED
@@ -136,13 +136,14 @@ def inference(img):
|
|
136 |
|
137 |
return (
|
138 |
Image.fromarray(np.uint8(out.get_image())).convert("RGB"),
|
139 |
-
detected_objects,
|
140 |
chat_gpt_response,
|
141 |
)
|
142 |
|
143 |
|
144 |
with gr.Blocks() as demo:
|
145 |
gr.Markdown("# Detic+ChatGPT")
|
|
|
|
|
146 |
gr.HTML("<p>You can duplicating this space and use your own session token: <a style='display:inline-block' href='https://huggingface.co/spaces/yizhangliu/chatGPT?duplicate=true'><img src='https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14' alt='Duplicate Space'></a></p>")
|
147 |
gr.HTML("<p> Instruction on how to get session token can be seen in video <a style='display:inline-block' href='https://www.youtube.com/watch?v=TdNSj_qgdFk'><font style='color:blue;weight:bold;'>here</font></a>. Add your session token by going to settings and add under secrets. </p>")
|
148 |
|
@@ -152,8 +153,8 @@ with gr.Blocks() as demo:
|
|
152 |
with gr.Column():
|
153 |
outviz = gr.Image(label="Visualization", type="pil")
|
154 |
output_desc = gr.Textbox(label="chatGPT Description", lines=5)
|
155 |
-
outputjson = gr.JSON(label="Detected Objects")
|
156 |
|
157 |
-
btn_detic.click(fn=inference, inputs=inp, outputs=[outviz,
|
158 |
|
159 |
demo.launch()
|
|
|
136 |
|
137 |
return (
|
138 |
Image.fromarray(np.uint8(out.get_image())).convert("RGB"),
|
|
|
139 |
chat_gpt_response,
|
140 |
)
|
141 |
|
142 |
|
143 |
with gr.Blocks() as demo:
|
144 |
gr.Markdown("# Detic+ChatGPT")
|
145 |
+
gr.Markdown("Use Detic to detect objects in an image and then use ChatGPT to describe the image.")
|
146 |
+
|
147 |
gr.HTML("<p>You can duplicating this space and use your own session token: <a style='display:inline-block' href='https://huggingface.co/spaces/yizhangliu/chatGPT?duplicate=true'><img src='https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14' alt='Duplicate Space'></a></p>")
|
148 |
gr.HTML("<p> Instruction on how to get session token can be seen in video <a style='display:inline-block' href='https://www.youtube.com/watch?v=TdNSj_qgdFk'><font style='color:blue;weight:bold;'>here</font></a>. Add your session token by going to settings and add under secrets. </p>")
|
149 |
|
|
|
153 |
with gr.Column():
|
154 |
outviz = gr.Image(label="Visualization", type="pil")
|
155 |
output_desc = gr.Textbox(label="chatGPT Description", lines=5)
|
156 |
+
# outputjson = gr.JSON(label="Detected Objects")
|
157 |
|
158 |
+
btn_detic.click(fn=inference, inputs=inp, outputs=[outviz, output_desc])
|
159 |
|
160 |
demo.launch()
|