Spaces:
Configuration error
Configuration error
Haozhe commited on
Commit ·
311548d
1
Parent(s): b5465a3
display image
Browse filesFiles changed (2)
- .gitattributes+1
- app.py+8-3
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textexample_images/1.jpg filter=lfs diff=lfs merge=lfs -text
249 unmodified lines25025125225325425525625717 unmodified lines2752762772782792802812822836 unmodified lines290291292293249 unmodified linesprint(raw_result)proc_img = raw_resultall_images += [proc_img]# complete_assistant_response_for_gradio += [(proc_img, "Visual Operation Result")]# yield complete_assistant_response_for_gradio # Update Gradio displaynew_piece = dict(role='user', content=[dict(type='text', text="\nHere is the cropped image (Image Size: {}x{}):".format(proc_img.size[0], proc_img.size[1])),17 unmodified linesgr.HTML(html_header)gr.ChatInterface(fn=model_inference,description="# **Pixel Reasoner**",examples=examples,fill_height=True,textbox=gr.MultimodalTextbox(label="Query Input", file_types=["image"], file_count="multiple"),6 unmodified linesgr.Markdown(learn_more_markdown)gr.Markdown(bibtext)demo.launch(debug=True, share=True)249 unmodified lines25025125225325425525625725825917 unmodified lines2772782792802812822832842852862872886 unmodified lines295296297298249 unmodified linesprint(raw_result)proc_img = raw_resultall_images += [proc_img]proc_img.save("tmp.png")display = [dict(text="", files=["tmp.png"])]complete_assistant_response_for_gradio = complete_assistant_response_for_gradio + displayyield complete_assistant_response_for_gradio # Update Gradio displaynew_piece = dict(role='user', content=[dict(type='text', text="\nHere is the cropped image (Image Size: {}x{}):".format(proc_img.size[0], proc_img.size[1])),17 unmodified linesgr.HTML(html_header)# image_op_display = gr.Image(label="Visual Operation Result", type="pil", height=480, show_download_button=True, interactive=False)gr.ChatInterface(fn=model_inference,description="# **Pixel Reasoner**",chatbot=gr.Chatbot(label="Conversation", layout="bubble", bubble_full_width=False, show_copy_button=True, height=600),examples=examples,fill_height=True,textbox=gr.MultimodalTextbox(label="Query Input", file_types=["image"], file_count="multiple"),6 unmodified linesgr.Markdown(learn_more_markdown)gr.Markdown(bibtext)demo.launch(debug=True, share=False)
.gitattributes+1
app.py+8-3