import gradio as gr
if __name__ == '__main__':
with gr.Blocks() as demo:
gr.HTML(
"""
GitHub
Report
Video Demo
"""
)
gr.HTML(
"""
To run this app on Hugging Face, you may need to duplicate the repo into your own space.
""")
gr.Markdown(
'''
**User Manual:**
After uploading the image, you can have a **multi-modal dialogue** by sending messages like: `"what is it in the image?"` or `"what is the background color of the image?"`.
You also can interactively operate, edit or generate the image as follows:
- You can click the image and press the button **`Pick`** to **visualize the segmented region** or press the button **`OCR`** to **recognize the words** at chosen position;
- To **remove the masked region** in the image, you can send the message like: `"remove the masked region"`;
- To **replace the masked region** in the image, you can send the message like: `"replace the masked region with {your prompt}"`;
- To **generate a new image**, you can send the message like: `"generate a new image based on its segmentation describing {your prompt}"`.
- To **create a new image by your scribble**, you should press button **`Whiteboard`** and draw in the board. After drawing, you need to press the button **`Save`** and send the message like: `"generate a new image based on this scribble describing {your prompt}"`.
'''
)
gr.HTML(
"""
More features are coming soon. Hope you have fun with our demo!
"""
)
demo.launch()