Spaces:
Runtime error
Runtime error
update examples
Browse files- app.py +15 -1
- assets/examples/demo.jpg +0 -0
- assets/examples/demo_bg.jpg +0 -0
- assets/examples/demo_green.jpg +0 -0
- assets/examples/img1.jpg +0 -0
- assets/examples/img1_bg.jpg +0 -0
- assets/examples/img1_green.jpg +0 -0
- assets/examples/img2.jpeg +0 -0
- assets/examples/img2_bg.jpg +0 -0
- assets/examples/img2_bg_2.jpg +0 -0
- assets/examples/img2_green.jpg +0 -0
- assets/examples/img2_green_2.jpg +0 -0
- assets/examples/img3.jpg +0 -0
- assets/examples/img3_bg.jpg +0 -0
- assets/examples/img3_bg_2.jpg +0 -0
- assets/examples/img3_green.jpg +0 -0
- assets/examples/img3_green_2.jpg +0 -0
app.py
CHANGED
@@ -277,7 +277,7 @@ if __name__ == "__main__":
|
|
277 |
["merge", "split"], value="split", label="scribble_mode"
|
278 |
)
|
279 |
guidance_mode = gr.Dropdown(
|
280 |
-
["mask", "alpha"], value="alpha", label="guidance_mode", info="mask guidance
|
281 |
)
|
282 |
|
283 |
with gr.Column():
|
@@ -287,6 +287,20 @@ if __name__ == "__main__":
|
|
287 |
|
288 |
run_button.click(fn=run_grounded_sam, inputs=[
|
289 |
input_image, text_prompt, task_type, background_prompt, background_type, box_threshold, text_threshold, iou_threshold, scribble_mode, guidance_mode], outputs=gallery)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
|
291 |
block.launch(debug=args.debug, share=args.share, show_error=True)
|
292 |
#block.queue(concurrency_count=100)
|
|
|
277 |
["merge", "split"], value="split", label="scribble_mode"
|
278 |
)
|
279 |
guidance_mode = gr.Dropdown(
|
280 |
+
["mask", "alpha"], value="alpha", label="guidance_mode", info="mask guidance works better on complex scenes with multiple instances, alpha guidance works better on simple scene with human instances"
|
281 |
)
|
282 |
|
283 |
with gr.Column():
|
|
|
287 |
|
288 |
run_button.click(fn=run_grounded_sam, inputs=[
|
289 |
input_image, text_prompt, task_type, background_prompt, background_type, box_threshold, text_threshold, iou_threshold, scribble_mode, guidance_mode], outputs=gallery)
|
290 |
+
|
291 |
+
gr.Markdown(
|
292 |
+
"""
|
293 |
+
## Examples
|
294 |
+
|
295 |
+
| input image | text prompt | background type | background prompt | guidance mode | composite with background | green screen |
|
296 |
+
|-------------|------------|--------------|--------------|--------------|--------------|--------------|
|
297 |
+
| <img src="file=assets/examples/demo.jpg" width="100" height="100"> | the girl in the middle | real-world sample | None | alpha | <img src="file=assets/examples/demo_bg.jpg" width="100" height="100"> | <img src="file=assets/examples/demo_green.jpg" width="100" height="100"> |
|
298 |
+
| <img src="file=assets/examples/img1.jpg" width="100" height="100"> | the girl in the middle | generated by text | downtown area in chicago | alpha | <img src="file=assets/examples/img1_bg.jpg" width="100" height="100"> | <img src="file=assets/examples/img1_green.jpg" width="100" height="100"> |
|
299 |
+
| <img src="file=assets/examples/img2.jpeg" width="100" height="100"> | the dog sitting the left side | generated by text | national park view | mask | <img src="file=assets/examples/img2_bg.jpg" width="100" height="100"> | <img src="file=assets/examples/img2_green.jpg" width="100" height="100"> |
|
300 |
+
| <img src="file=assets/examples/img2.jpeg" width="100" height="100"> | the bigger dog sitting the right side | real-world sample | None | mask | <img src="file=assets/examples/img2_bg_2.jpg" width="100" height="100"> | <img src="file=assets/examples/img2_green_2.jpg" width="100" height="100"> |
|
301 |
+
| <img src="file=assets/examples/img3.jpg" width="100" height="100"> | the girl with red sweater | real-world sample | None | alpha | <img src="file=assets/examples/img3_bg.jpg" width="100" height="100"> | <img src="file=assets/examples/img3_green.jpg" width="100" height="100"> |
|
302 |
+
| <img src="file=assets/examples/img3.jpg" width="100" height="100"> | the girl with black sweater | generated by text | sunrise on the sea | alpha | <img src="file=assets/examples/img3_bg_2.jpg" width="100" height="100"> | <img src="file=assets/examples/img3_green_2.jpg" width="100" height="100"> |
|
303 |
+
""")
|
304 |
|
305 |
block.launch(debug=args.debug, share=args.share, show_error=True)
|
306 |
#block.queue(concurrency_count=100)
|
assets/examples/demo.jpg
ADDED
assets/examples/demo_bg.jpg
ADDED
assets/examples/demo_green.jpg
ADDED
assets/examples/img1.jpg
ADDED
assets/examples/img1_bg.jpg
ADDED
assets/examples/img1_green.jpg
ADDED
assets/examples/img2.jpeg
ADDED
assets/examples/img2_bg.jpg
ADDED
assets/examples/img2_bg_2.jpg
ADDED
assets/examples/img2_green.jpg
ADDED
assets/examples/img2_green_2.jpg
ADDED
assets/examples/img3.jpg
ADDED
assets/examples/img3_bg.jpg
ADDED
assets/examples/img3_bg_2.jpg
ADDED
assets/examples/img3_green.jpg
ADDED
assets/examples/img3_green_2.jpg
ADDED