Spaces:
Sleeping
Sleeping
xxie
commited on
Commit
•
f86f26e
1
Parent(s):
40d0f76
update UI
Browse files
app.py
CHANGED
@@ -47,9 +47,27 @@ Upload your own human object interaction image and get full 3D reconstruction!
|
|
47 |
}
|
48 |
```
|
49 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
html_str = """
|
52 |
<h2 style="text-align:center; color:#10768c">HDM Demo: Upload you own human object interaction image and get full 3D reconstruction!</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
<p style="text-align:left; color:#10768c">Instruction:
|
54 |
<ol>
|
55 |
<li>Upload an RGB image of human object interaction.</li>
|
@@ -61,11 +79,9 @@ html_str = """
|
|
61 |
<li>You can view the result at `Reconstructed point cloud` and download the point cloud at `download results`. </li>
|
62 |
</ol>
|
63 |
Alternatively, you can click one of the examples below and start reconstruction.
|
64 |
-
|
65 |
-
Have fun!
|
66 |
</p>
|
67 |
-
|
68 |
-
|
69 |
"""
|
70 |
|
71 |
def plot_points(colors, coords):
|
@@ -165,9 +181,7 @@ def main(cfg: ProjectConfig):
|
|
165 |
# Setup interface
|
166 |
demo = gr.Blocks(title="HDM Interaction Reconstruction Demo")
|
167 |
with demo:
|
168 |
-
gr.Markdown(md_description)
|
169 |
gr.HTML(html_str)
|
170 |
-
|
171 |
# Input data
|
172 |
with gr.Row():
|
173 |
input_rgb = gr.Image(label='Input RGB', type='numpy')
|
@@ -177,20 +191,19 @@ def main(cfg: ProjectConfig):
|
|
177 |
with gr.Column():
|
178 |
input_std = gr.Number(label='Gaussian std coverage', value=3.5,
|
179 |
info="This value is used to estimate camera translation to project the points."
|
180 |
-
"The larger value, the camera is farther away. It is category-dependent."
|
181 |
"We empirically found these values are suitable: backpack-3.5, ball-3.0, bottle-3.0,"
|
182 |
"box-3.5, chair-3.8, skateboard-3.0, suitcase-3.2, table-3.5. "
|
183 |
"If you are not sure, 3.5 is a good start point.")
|
184 |
input_cls = gr.Dropdown(label='Object category',
|
185 |
-
info='We
|
186 |
'Reconstructing using these models should lead to better result '
|
187 |
'for these specific categories. Simply select the category that '
|
188 |
'fits the object from input image.',
|
189 |
choices=['general', 'backpack', 'ball', 'bottle', 'box',
|
190 |
'chair', 'skateboard', 'suitcase', 'table'],
|
191 |
value='general')
|
192 |
-
input_seed = gr.Number(label='Random seed', value=42
|
193 |
-
info='Seed for the reverse diffusion process.')
|
194 |
# Output visualization
|
195 |
with gr.Row():
|
196 |
pc_plot = gr.Plot(label="Reconstructed point cloud")
|
@@ -219,6 +232,8 @@ def main(cfg: ProjectConfig):
|
|
219 |
|
220 |
], inputs=[input_rgb, input_mask_hum, input_mask_obj, input_std, input_seed, input_cls],)
|
221 |
|
|
|
|
|
222 |
# demo.launch(share=True)
|
223 |
# Enabling queue for runtime>60s, see: https://github.com/tloen/alpaca-lora/issues/60#issuecomment-1510006062
|
224 |
demo.queue().launch(share=cfg.run.share)
|
|
|
47 |
}
|
48 |
```
|
49 |
"""
|
50 |
+
citation_str = """
|
51 |
+
## Citation
|
52 |
+
```
|
53 |
+
@inproceedings{xie2023template_free,
|
54 |
+
title = {Template Free Reconstruction of Human-object Interaction with Procedural Interaction Generation},
|
55 |
+
author = {Xie, Xianghui and Bhatnagar, Bharat Lal and Lenssen, Jan Eric and Pons-Moll, Gerard},
|
56 |
+
booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
|
57 |
+
month = {June},
|
58 |
+
year = {2024},
|
59 |
+
}
|
60 |
+
"""
|
61 |
|
62 |
html_str = """
|
63 |
<h2 style="text-align:center; color:#10768c">HDM Demo: Upload you own human object interaction image and get full 3D reconstruction!</h2>
|
64 |
+
<h3 style="text-align:center; color:#10768c">Official Demo of "Template Free Reconstruction of Human Object Interaction with Procedural Generation", CVPR'24. </h3>
|
65 |
+
<h3 style="text-align:center; color:#10768c"><a href="https://virtualhumans.mpi-inf.mpg.de/procigen-hdm/" target="_blank">Project Page</a> |
|
66 |
+
<a href="https://github.com/xiexh20/HDM" target="_blank">Code</a> |
|
67 |
+
<a href="https://edmond.mpg.de/dataset.xhtml?persistentId=doi:10.17617/3.2VUEUS" target="_blank">ProciGen Dataset</a> |
|
68 |
+
<a href="https://virtualhumans.mpi-inf.mpg.de/procigen-hdm/paper-lowreso.pdf" target="_blank">Paper</a>
|
69 |
+
</h3>
|
70 |
+
|
71 |
<p style="text-align:left; color:#10768c">Instruction:
|
72 |
<ol>
|
73 |
<li>Upload an RGB image of human object interaction.</li>
|
|
|
79 |
<li>You can view the result at `Reconstructed point cloud` and download the point cloud at `download results`. </li>
|
80 |
</ol>
|
81 |
Alternatively, you can click one of the examples below and start reconstruction.
|
|
|
|
|
82 |
</p>
|
83 |
+
<p>More example results can be found in our <a href="https://virtualhumans.mpi-inf.mpg.de/procigen-hdm/" target="_blank">Project Page</a>.</p>
|
84 |
+
<p>Have fun! </p>
|
85 |
"""
|
86 |
|
87 |
def plot_points(colors, coords):
|
|
|
181 |
# Setup interface
|
182 |
demo = gr.Blocks(title="HDM Interaction Reconstruction Demo")
|
183 |
with demo:
|
|
|
184 |
gr.HTML(html_str)
|
|
|
185 |
# Input data
|
186 |
with gr.Row():
|
187 |
input_rgb = gr.Image(label='Input RGB', type='numpy')
|
|
|
191 |
with gr.Column():
|
192 |
input_std = gr.Number(label='Gaussian std coverage', value=3.5,
|
193 |
info="This value is used to estimate camera translation to project the points."
|
194 |
+
"The larger value, the camera is farther away. It is category-dependent. "
|
195 |
"We empirically found these values are suitable: backpack-3.5, ball-3.0, bottle-3.0,"
|
196 |
"box-3.5, chair-3.8, skateboard-3.0, suitcase-3.2, table-3.5. "
|
197 |
"If you are not sure, 3.5 is a good start point.")
|
198 |
input_cls = gr.Dropdown(label='Object category',
|
199 |
+
info='We fine tuned the model for some specific categories. '
|
200 |
'Reconstructing using these models should lead to better result '
|
201 |
'for these specific categories. Simply select the category that '
|
202 |
'fits the object from input image.',
|
203 |
choices=['general', 'backpack', 'ball', 'bottle', 'box',
|
204 |
'chair', 'skateboard', 'suitcase', 'table'],
|
205 |
value='general')
|
206 |
+
input_seed = gr.Number(label='Random seed', value=42)
|
|
|
207 |
# Output visualization
|
208 |
with gr.Row():
|
209 |
pc_plot = gr.Plot(label="Reconstructed point cloud")
|
|
|
232 |
|
233 |
], inputs=[input_rgb, input_mask_hum, input_mask_obj, input_std, input_seed, input_cls],)
|
234 |
|
235 |
+
gr.Markdown(citation_str)
|
236 |
+
|
237 |
# demo.launch(share=True)
|
238 |
# Enabling queue for runtime>60s, see: https://github.com/tloen/alpaca-lora/issues/60#issuecomment-1510006062
|
239 |
demo.queue().launch(share=cfg.run.share)
|