Spaces:
Runtime error
Runtime error
Commit
•
808cb8a
1
Parent(s):
1a8bda3
initial commit
Browse files
README.md
CHANGED
@@ -6,6 +6,7 @@ colorTo: pink
|
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.37.2
|
8 |
app_file: app.py
|
|
|
9 |
pinned: false
|
10 |
---
|
11 |
|
|
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.37.2
|
8 |
app_file: app.py
|
9 |
+
license: mit
|
10 |
pinned: false
|
11 |
---
|
12 |
|
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from gradio_client import Client, file
|
3 |
+
|
4 |
+
|
5 |
+
def run(image_url):
|
6 |
+
client = Client("dylanebert/LGM-tiny")
|
7 |
+
image = file(image_url)
|
8 |
+
result = client.predict(image, api_name="/predict")
|
9 |
+
return result
|
10 |
+
|
11 |
+
|
12 |
+
demo = gr.Interface(
|
13 |
+
fn=run,
|
14 |
+
title="LGM Tiny API",
|
15 |
+
description="An API wrapper for [LGM Tiny](https://huggingface.co/spaces/dylanebert/LGM-tiny). Intended as a resource for the [ML for 3D Course](https://huggingface.co/learn/ml-for-3d-course).",
|
16 |
+
inputs=gr.Textbox(label="Image URL", placeholder="Enter image URL, e.g. https://huggingface.co/datasets/dylanebert/iso3d/resolve/main/jpg@512/a_cat_statue.jpg"),
|
17 |
+
outputs=gr.Model3D(),
|
18 |
+
examples=[
|
19 |
+
"https://huggingface.co/datasets/dylanebert/iso3d/resolve/main/jpg@512/a_cat_statue.jpg"
|
20 |
+
],
|
21 |
+
allow_duplication=True,
|
22 |
+
)
|
23 |
+
demo.queue().launch()
|