Spaces:
Sleeping
Sleeping
20240706
Browse files- app.py +21 -138
- assets/sample_input/demo/back/armor.png +0 -0
- assets/sample_input/demo/back/bird_brownblue.png +0 -0
- assets/sample_input/demo/back/bird_rainbow.png +0 -0
- assets/sample_input/demo/back/boy_blue.png +0 -0
- assets/sample_input/demo/back/boy_grey_clothes.png +0 -0
- assets/sample_input/demo/back/house.png +0 -0
- assets/sample_input/demo/back/kunkun_law.png +0 -0
- assets/sample_input/demo/back/kunkun_soccer.png +0 -0
- assets/sample_input/demo/back/lego_green.png +0 -0
- assets/sample_input/demo/back/lego_red.png +0 -0
- assets/sample_input/demo/back/loopy.png +0 -0
- assets/sample_input/demo/back/mario.png +0 -0
- assets/sample_input/demo/back/marvel_captain.png +0 -0
- assets/sample_input/demo/back/marvel_ironman.png +0 -0
- assets/sample_input/demo/back/marvel_spiderman.png +0 -0
- assets/sample_input/demo/back/penguin.png +0 -0
- assets/sample_input/demo/back/sofa.png +0 -0
- assets/sample_input/demo/front/armor.png +0 -0
- assets/sample_input/demo/front/bird_brownblue.png +0 -0
- assets/sample_input/demo/front/bird_rainbow.png +0 -0
- assets/sample_input/demo/front/boy_blue.png +0 -0
- assets/sample_input/demo/front/boy_grey_clothes.png +0 -0
- assets/sample_input/demo/front/house.png +0 -0
- assets/sample_input/demo/front/kunkun_law.png +0 -0
- assets/sample_input/demo/front/kunkun_soccer.png +0 -0
- assets/sample_input/demo/front/lego_green.png +0 -0
- assets/sample_input/demo/front/lego_red.png +0 -0
- assets/sample_input/demo/front/loopy.png +0 -0
- assets/sample_input/demo/front/mario.png +0 -0
- assets/sample_input/demo/front/marvel_captain.png +0 -0
- assets/sample_input/demo/front/marvel_ironman.png +0 -0
- assets/sample_input/demo/front/marvel_spiderman.png +0 -0
- assets/sample_input/demo/front/penguin.png +0 -0
- assets/sample_input/demo/front/sofa.png +0 -0
app.py
CHANGED
@@ -184,18 +184,14 @@ def demo_openlrm(infer_impl):
|
|
184 |
gr.Markdown(
|
185 |
"""
|
186 |
## Example in the paper.
|
187 |
-
### A. 3D Style Transfer
|
188 |
-
Here we keep the object ID and just transfer the style. <br>
|
189 |
-
|
190 |
-
**Line 1: A pop-mart boy with astronaut, blue, traditional Chinese and grey style.**
|
191 |
"""
|
192 |
)
|
193 |
with gr.Row():
|
194 |
examples = [
|
195 |
['assets/sample_input/demo/front/boy_astronaut.png', 'assets/sample_input/demo/back/boy_astronaut.png'],
|
196 |
-
['assets/sample_input/demo/front/boy_blue.png', 'assets/sample_input/demo/back/boy_blue.png'],
|
197 |
['assets/sample_input/demo/front/boy_chinese_style.png', 'assets/sample_input/demo/back/boy_chinese_style.png'],
|
198 |
-
['assets/sample_input/demo/front/
|
|
|
199 |
]
|
200 |
|
201 |
for example in examples:
|
@@ -209,138 +205,25 @@ def demo_openlrm(infer_impl):
|
|
209 |
examples_per_page=3,
|
210 |
)
|
211 |
|
212 |
-
#
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
# inputs=[input_front_image, input_back_image],
|
232 |
-
# outputs=None, # [processed_image, output_video],
|
233 |
-
# fn=None, # example_fn,
|
234 |
-
# cache_examples=bool(os.getenv('SPACE_ID')),
|
235 |
-
# examples_per_page=3,
|
236 |
-
# )
|
237 |
-
# with gr.Row():
|
238 |
-
# gr.Markdown(
|
239 |
-
# """
|
240 |
-
# **Line 3: A marvel boy featuring an Captain America, Ironman and Spiderman, and a Superman theme.**
|
241 |
-
# """
|
242 |
-
# )
|
243 |
-
# with gr.Row():
|
244 |
-
# examples = [
|
245 |
-
# ['assets/sample_input/demo/front/marvel_captain.png', 'assets/sample_input/demo/back/marvel_captain.png'],
|
246 |
-
# ['assets/sample_input/demo/front/marvel_ironman.png', 'assets/sample_input/demo/front/marvel_ironman.png'],
|
247 |
-
# ['assets/sample_input/demo/front/marvel_spiderman.png', 'assets/sample_input/demo/back/marvel_spiderman.png'],
|
248 |
-
# ['assets/sample_input/demo/front/marvel_superman.png', 'assets/sample_input/demo/back/marvel_superman.png'],
|
249 |
-
# ]
|
250 |
-
|
251 |
-
# for example in examples:
|
252 |
-
# with gr.Column(scale=0.3):
|
253 |
-
# gr.Examples(
|
254 |
-
# examples=[example],
|
255 |
-
# inputs=[input_front_image, input_back_image],
|
256 |
-
# outputs=None, # [processed_image, output_video],
|
257 |
-
# fn=None, # example_fn,
|
258 |
-
# cache_examples=bool(os.getenv('SPACE_ID')),
|
259 |
-
# examples_per_page=3,
|
260 |
-
# )
|
261 |
-
# # EXAMPLES
|
262 |
-
# with gr.Row():
|
263 |
-
# gr.Markdown(
|
264 |
-
# """
|
265 |
-
# ### B. 3D Generative Geometry or Pattern Fill
|
266 |
-
|
267 |
-
# Here, we start with a simple object and gradually add various accessories, costumes, or patterns step by step. We only showcase the final effect after multiple rounds of decoration. <br>
|
268 |
-
|
269 |
-
# **Line 4: Initial object: sofa, dog, penguin, house.**
|
270 |
-
# """
|
271 |
-
# )
|
272 |
-
# with gr.Row():
|
273 |
-
# examples = [
|
274 |
-
# ['assets/sample_input/demo/front/sofa.png', 'assets/sample_input/demo/back/sofa.png'],
|
275 |
-
# ['assets/sample_input/demo/front/penguin.png', 'assets/sample_input/demo/back/penguin.png'],
|
276 |
-
# ['assets/sample_input/demo/front/house.png', 'assets/sample_input/demo/back/house.png'],
|
277 |
-
# ]
|
278 |
-
|
279 |
-
# for example in examples:
|
280 |
-
# with gr.Column(scale=0.3):
|
281 |
-
# gr.Examples(
|
282 |
-
# examples=[example],
|
283 |
-
# inputs=[input_front_image, input_back_image],
|
284 |
-
# outputs=None, # [processed_image, output_video],
|
285 |
-
# fn=None, # example_fn,
|
286 |
-
# cache_examples=bool(os.getenv('SPACE_ID')),
|
287 |
-
# examples_per_page=3,
|
288 |
-
# )
|
289 |
-
|
290 |
-
# with gr.Row():
|
291 |
-
# gr.Markdown(
|
292 |
-
# """
|
293 |
-
# ### C. 3D Style Fusion
|
294 |
-
|
295 |
-
# We will maintain a consistent front style of the object while continuously changing the back style, blending the two different styles into one object.<br>
|
296 |
-
|
297 |
-
# **Line 5: A bird with different back styles.**
|
298 |
-
# """
|
299 |
-
# )
|
300 |
-
# with gr.Row():
|
301 |
-
# examples = [
|
302 |
-
# ['assets/sample_input/demo/front/bird.png', 'assets/sample_input/demo/back/bird.png'],
|
303 |
-
# ['assets/sample_input/demo/front/bird_brownblue.png', 'assets/sample_input/demo/back/bird_brownblue.png'],
|
304 |
-
# ['assets/sample_input/demo/front/bird_rainbow.png', 'assets/sample_input/demo/back/bird_rainbow.png'],
|
305 |
-
# ['assets/sample_input/demo/front/bird_whitered.png', 'assets/sample_input/demo/back/bird_whitered.png'],
|
306 |
-
# ]
|
307 |
-
|
308 |
-
# for example in examples:
|
309 |
-
# with gr.Column(scale=0.3):
|
310 |
-
# gr.Examples(
|
311 |
-
# examples=[example],
|
312 |
-
# inputs=[input_front_image, input_back_image],
|
313 |
-
# outputs=None, # [processed_image, output_video],
|
314 |
-
# fn=None, # example_fn,
|
315 |
-
# cache_examples=bool(os.getenv('SPACE_ID')),
|
316 |
-
# examples_per_page=3,
|
317 |
-
# )
|
318 |
-
|
319 |
-
# with gr.Row():
|
320 |
-
# gr.Markdown(
|
321 |
-
# """
|
322 |
-
# ### Others
|
323 |
-
# I vote for kunkun forever, I am really an I-kUN and have heard many of his songs.
|
324 |
-
# """
|
325 |
-
# )
|
326 |
-
# with gr.Row():
|
327 |
-
# examples = [
|
328 |
-
# ['assets/sample_input/demo/front/loopy.png', 'assets/sample_input/demo/back/loopy.png'],
|
329 |
-
# ['assets/sample_input/demo/front/mario.png', 'assets/sample_input/demo/back/mario.png'],
|
330 |
-
# ['assets/sample_input/demo/front/armor.png', 'assets/sample_input/demo/back/armor.png'],
|
331 |
-
# ['assets/sample_input/demo/front/kunkun_law.png', 'assets/sample_input/demo/back/kunkun_law.png'],
|
332 |
-
# ]
|
333 |
-
|
334 |
-
# for example in examples:
|
335 |
-
# with gr.Column(scale=0.3):
|
336 |
-
# gr.Examples(
|
337 |
-
# examples=[example],
|
338 |
-
# inputs=[input_front_image, input_back_image],
|
339 |
-
# outputs=None, # [processed_image, output_video],
|
340 |
-
# fn=None, # example_fn,
|
341 |
-
# cache_examples=bool(os.getenv('SPACE_ID')),
|
342 |
-
# examples_per_page=3,
|
343 |
-
# )
|
344 |
|
345 |
working_dir = gr.State()
|
346 |
submit.click(
|
|
|
184 |
gr.Markdown(
|
185 |
"""
|
186 |
## Example in the paper.
|
|
|
|
|
|
|
|
|
187 |
"""
|
188 |
)
|
189 |
with gr.Row():
|
190 |
examples = [
|
191 |
['assets/sample_input/demo/front/boy_astronaut.png', 'assets/sample_input/demo/back/boy_astronaut.png'],
|
|
|
192 |
['assets/sample_input/demo/front/boy_chinese_style.png', 'assets/sample_input/demo/back/boy_chinese_style.png'],
|
193 |
+
['assets/sample_input/demo/front/kunkun_soccer.png', 'assets/sample_input/demo/back/kunkun_soccer.png'],
|
194 |
+
['assets/sample_input/demo/front/marvel_superman.png', 'assets/sample_input/demo/back/marvel_superman.png'],
|
195 |
]
|
196 |
|
197 |
for example in examples:
|
|
|
205 |
examples_per_page=3,
|
206 |
)
|
207 |
|
208 |
+
# EXAMPLES
|
209 |
+
with gr.Row():
|
210 |
+
examples = [
|
211 |
+
['assets/sample_input/demo/front/lego_astronaut.png', 'assets/sample_input/demo/back/lego_astronaut.png'],
|
212 |
+
['assets/sample_input/demo/front/lego_wizard.png', 'assets/sample_input/demo/back/lego_wizard.png'],
|
213 |
+
['assets/sample_input/demo/front/bird.png', 'assets/sample_input/demo/back/bird.png'],
|
214 |
+
['assets/sample_input/demo/front/bird_whitered.png', 'assets/sample_input/demo/back/bird_whitered.png'],
|
215 |
+
]
|
216 |
+
|
217 |
+
for example in examples:
|
218 |
+
with gr.Column(scale=0.3):
|
219 |
+
gr.Examples(
|
220 |
+
examples=[example],
|
221 |
+
inputs=[input_front_image, input_back_image],
|
222 |
+
outputs=None, # [processed_image, output_video],
|
223 |
+
fn=None, # example_fn,
|
224 |
+
cache_examples=bool(os.getenv('SPACE_ID')),
|
225 |
+
examples_per_page=3,
|
226 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
227 |
|
228 |
working_dir = gr.State()
|
229 |
submit.click(
|
assets/sample_input/demo/back/armor.png
DELETED
Binary file (732 kB)
|
|
assets/sample_input/demo/back/bird_brownblue.png
DELETED
Binary file (489 kB)
|
|
assets/sample_input/demo/back/bird_rainbow.png
DELETED
Binary file (443 kB)
|
|
assets/sample_input/demo/back/boy_blue.png
DELETED
Binary file (42.6 kB)
|
|
assets/sample_input/demo/back/boy_grey_clothes.png
DELETED
Binary file (51.5 kB)
|
|
assets/sample_input/demo/back/house.png
DELETED
Binary file (318 kB)
|
|
assets/sample_input/demo/back/kunkun_law.png
DELETED
Binary file (763 kB)
|
|
assets/sample_input/demo/back/kunkun_soccer.png
ADDED
assets/sample_input/demo/back/lego_green.png
DELETED
Binary file (58.2 kB)
|
|
assets/sample_input/demo/back/lego_red.png
DELETED
Binary file (58 kB)
|
|
assets/sample_input/demo/back/loopy.png
DELETED
Binary file (77.1 kB)
|
|
assets/sample_input/demo/back/mario.png
DELETED
Binary file (45.1 kB)
|
|
assets/sample_input/demo/back/marvel_captain.png
DELETED
Binary file (64.9 kB)
|
|
assets/sample_input/demo/back/marvel_ironman.png
DELETED
Binary file (75.9 kB)
|
|
assets/sample_input/demo/back/marvel_spiderman.png
DELETED
Binary file (57.1 kB)
|
|
assets/sample_input/demo/back/penguin.png
DELETED
Binary file (856 kB)
|
|
assets/sample_input/demo/back/sofa.png
DELETED
Binary file (254 kB)
|
|
assets/sample_input/demo/front/armor.png
DELETED
Binary file (843 kB)
|
|
assets/sample_input/demo/front/bird_brownblue.png
DELETED
Binary file (100 kB)
|
|
assets/sample_input/demo/front/bird_rainbow.png
DELETED
Binary file (100 kB)
|
|
assets/sample_input/demo/front/boy_blue.png
DELETED
Binary file (510 kB)
|
|
assets/sample_input/demo/front/boy_grey_clothes.png
DELETED
Binary file (458 kB)
|
|
assets/sample_input/demo/front/house.png
DELETED
Binary file (282 kB)
|
|
assets/sample_input/demo/front/kunkun_law.png
DELETED
Binary file (507 kB)
|
|
assets/sample_input/demo/front/kunkun_soccer.png
ADDED
assets/sample_input/demo/front/lego_green.png
DELETED
Binary file (499 kB)
|
|
assets/sample_input/demo/front/lego_red.png
DELETED
Binary file (552 kB)
|
|
assets/sample_input/demo/front/loopy.png
DELETED
Binary file (77 kB)
|
|
assets/sample_input/demo/front/mario.png
DELETED
Binary file (150 kB)
|
|
assets/sample_input/demo/front/marvel_captain.png
DELETED
Binary file (186 kB)
|
|
assets/sample_input/demo/front/marvel_ironman.png
DELETED
Binary file (187 kB)
|
|
assets/sample_input/demo/front/marvel_spiderman.png
DELETED
Binary file (192 kB)
|
|
assets/sample_input/demo/front/penguin.png
DELETED
Binary file (654 kB)
|
|
assets/sample_input/demo/front/sofa.png
DELETED
Binary file (148 kB)
|
|