Spaces:
Runtime error
Runtime error
osanseviero
commited on
Commit
•
98f4a4b
1
Parent(s):
60a2f29
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
|
4 |
import torch
|
5 |
from tqdm.auto import tqdm
|
@@ -45,8 +45,24 @@ def inference(prompt):
|
|
45 |
samples = x
|
46 |
pc = sampler.output_to_point_clouds(samples)[0]
|
47 |
pc = sampler.output_to_point_clouds(samples)[0]
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
demo = gr.Interface(fn=inference, inputs="text", outputs=gr.Plot(), examples=[["a red motorcycle"]])
|
52 |
demo.launch(debug=True)
|
|
|
1 |
import gradio as gr
|
2 |
+
import plotly.graph_objects as go
|
3 |
|
4 |
import torch
|
5 |
from tqdm.auto import tqdm
|
|
|
45 |
samples = x
|
46 |
pc = sampler.output_to_point_clouds(samples)[0]
|
47 |
pc = sampler.output_to_point_clouds(samples)[0]
|
48 |
+
colors=(238, 75, 43)
|
49 |
+
fig = go.Figure(
|
50 |
+
data=[
|
51 |
+
go.Scatter3d(
|
52 |
+
x=pc.coords[:,0], y=pc.coords[:,1], z=pc.coords[:,2],
|
53 |
+
mode='markers',
|
54 |
+
marker=dict(size=1, color=colors)
|
55 |
+
)
|
56 |
+
],
|
57 |
+
layout=dict(
|
58 |
+
scene=dict(
|
59 |
+
xaxis=dict(visible=False),
|
60 |
+
yaxis=dict(visible=False),
|
61 |
+
zaxis=dict(visible=False)
|
62 |
+
)
|
63 |
+
)
|
64 |
+
)
|
65 |
+
return fig
|
66 |
|
67 |
demo = gr.Interface(fn=inference, inputs="text", outputs=gr.Plot(), examples=[["a red motorcycle"]])
|
68 |
demo.launch(debug=True)
|