Spaces:
Paused
Paused
Create notice.py
Browse files
notice.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
if __name__ == '__main__':
|
| 4 |
+
with gr.Blocks() as demo:
|
| 5 |
+
gr.HTML(
|
| 6 |
+
"""
|
| 7 |
+
<div align='center'> <img src='/file=./assets/gvlab_logo.png' style='height:70px'/> </div>
|
| 8 |
+
<p align="center"><a href="https://github.com/OpenGVLab/InternGPT"><b>GitHub</b></a> <a href="https://arxiv.org/pdf/2305.05662.pdf"><b>Report</b></a>
|
| 9 |
+
<a href="https://github.com/OpenGVLab/InternGPT/assets/13723743/8fd9112f-57d9-4871-a369-4e1929aa2593"><b>Video Demo</b></a></p>
|
| 10 |
+
"""
|
| 11 |
+
)
|
| 12 |
+
# <div align='center'><p style="font-family:verdana;> You can try our demo via </p> </div> <a href="https://igpt.opengvlab.com">https://igpt.opengvlab.com</a>
|
| 13 |
+
gr.HTML(
|
| 14 |
+
"""
|
| 15 |
+
<body>
|
| 16 |
+
<div align='center'><p style="font-family:verdana;color:#000000";> <b> You can try our demo via <a href="https://igpt.opengvlab.com">https://igpt.opengvlab.com</a> </b> </p> </div>
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
<div align='center'><p style="font-family:verdana;color:#000000";> <b>To run this app on Hugging Face, you may need to duplicate the repo into your own space. </b></p></div>
|
| 21 |
+
</body>
|
| 22 |
+
""")
|
| 23 |
+
|
| 24 |
+
gr.Markdown(
|
| 25 |
+
'''
|
| 26 |
+
**User Manual:**
|
| 27 |
+
|
| 28 |
+
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?"`.
|
| 29 |
+
|
| 30 |
+
You also can interactively operate, edit or generate the image as follows:
|
| 31 |
+
- 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;
|
| 32 |
+
- To **remove the masked region** in the image, you can send the message like: `"remove the masked region"`;
|
| 33 |
+
- To **replace the masked region** in the image, you can send the message like: `"replace the masked region with {your prompt}"`;
|
| 34 |
+
- To **generate a new image**, you can send the message like: `"generate a new image based on its segmentation describing {your prompt}"`.
|
| 35 |
+
- 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}"`.
|
| 36 |
+
'''
|
| 37 |
+
)
|
| 38 |
+
gr.HTML(
|
| 39 |
+
"""
|
| 40 |
+
<body>
|
| 41 |
+
<p style="font-family:verdana;color:#11AA00";>More features are coming soon. Hope you have fun with our demo!</p>
|
| 42 |
+
</body>
|
| 43 |
+
"""
|
| 44 |
+
)
|
| 45 |
+
demo.launch()
|