DveloperY0115 commited on
Commit
1fa8725
1 Parent(s): 2110e10

Display demo description

Browse files
Files changed (1) hide show
  1. app.py +45 -15
app.py CHANGED
@@ -101,19 +101,49 @@ def run_inference(prompt: str):
101
 
102
  if __name__ == "__main__":
103
 
104
- # create UI
105
- demo = gr.Interface(
106
- fn=run_inference,
107
- inputs="text",
108
- outputs=gr.Plot(),
109
- title="SALAD: Text-Guided Shape Generation",
110
- description="Describe a chair",
111
- examples=[
112
- "an office chair",
113
- "a chair with armrests",
114
- "a chair without armrests",
115
- ]
116
- )
117
- # initiate
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  demo.queue(max_size=30)
119
- demo.launch()
 
101
 
102
  if __name__ == "__main__":
103
 
104
+ title = "SALAD: Text-Guided Shape Generation"
105
+
106
+ description_text = '''
107
+ This demo features text-guided 3D shape generation from our work <a href="https://arxiv.org/abs/2303.12236">SALAD: Part-Level Latent Diffusion for 3D Shape Generation and Manipulation, ICCV 2023</a>.
108
+ Please refer to our <a href="https://salad3d.github.io/">project page</a> for details.
109
+ '''
110
+
111
+ # create UI
112
+ with gr.Blocks(title=title) as demo:
113
+
114
+ # description of demo
115
+ gr.Markdown(description_text)
116
+
117
+ # inputs
118
+ with gr.Row():
119
+ prompt_textbox = gr.Textbox(placeholder="Describe a chair.")
120
+
121
+ with gr.Row():
122
+ run_button = gr.Button(value="Generate")
123
+ clear_button = gr.ClearButton(
124
+ value="Clear",
125
+ components=[prompt_textbox],
126
+ )
127
+
128
+ # display examples
129
+ examples = gr.Examples(
130
+ examples=[
131
+ "an office chair",
132
+ "a chair with armrests",
133
+ "a chair without armrests",
134
+ ],
135
+ inputs=[prompt_textbox],
136
+ )
137
+
138
+ # outputs
139
+ mesh_viewport = gr.Plot()
140
+
141
+ # run inference
142
+ run_button.click(
143
+ run_inference,
144
+ inputs=[prompt_textbox],
145
+ outputs=[mesh_viewport],
146
+ )
147
+
148
  demo.queue(max_size=30)
149
+ demo.launch()