Spaces:
Running
Running
| import gradio as gr | |
| def duplicate_image(image): | |
| # Simply return the same image twice | |
| return image, image | |
| # Create a Gradio interface | |
| iface = gr.Interface( | |
| fn=duplicate_image, | |
| inputs=gr.Image(type="pil"), | |
| outputs=[gr.Image(type="pil"), gr.Image(type="pil")], | |
| title="Duplicate Image", | |
| description="Upload an image and get two identical copies as output." | |
| ) | |
| # Launch the Gradio app | |
| iface.launch() | |
| """ | |
| from transformers import pipeline | |
| from PIL import Image | |
| import requests | |
| # load pipe | |
| pipe = pipeline(task="depth-estimation", model="LiheYoung/depth-anything-small-hf") | |
| # load image | |
| url = 'http://images.cocodataset.org/val2017/000000039769.jpg' | |
| image = Image.open(requests.get(url, stream=True).raw) | |
| # inference | |
| depth = pipe(image)["depth"] | |
| """ |