Spaces:
Running
on
Zero
Running
on
Zero
aki-0421
commited on
Commit
•
1b613d0
1
Parent(s):
f8bdccb
F: update
Browse files- app.py +18 -0
- assets/1.png +0 -0
- assets/10.png +0 -0
- assets/11.png +0 -0
- assets/12.png +0 -0
- assets/13.png +0 -0
- assets/14.png +0 -0
- assets/15.png +0 -0
- assets/16.png +0 -0
- assets/17.png +0 -0
- assets/18.png +0 -0
- assets/19.png +0 -0
- assets/2.png +0 -0
- assets/20.png +0 -0
- assets/21.png +0 -0
- assets/22.png +0 -0
- assets/23.png +0 -0
- assets/24.png +0 -0
- assets/25.png +0 -0
- assets/3.png +0 -0
- assets/4.png +0 -0
- assets/5.png +0 -0
- assets/6.png +0 -0
- assets/7.png +0 -0
- assets/8.png +0 -0
- assets/9.png +0 -0
app.py
CHANGED
@@ -2,6 +2,8 @@ import gradio as gr
|
|
2 |
import spaces
|
3 |
from PIL import Image
|
4 |
from typing import List
|
|
|
|
|
5 |
|
6 |
from pipeline import prepare_white_image, MultiViewGenerator
|
7 |
from util import download_file, unzip_file
|
@@ -19,6 +21,16 @@ def generate_images(input_image: Image.Image) -> List[Image.Image]:
|
|
19 |
|
20 |
return multi_view_generator.infer(white_image=white_image)
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
with gr.Blocks() as demo:
|
23 |
gr.Markdown("# Character-360")
|
24 |
gr.Markdown("Do you want to check out your character in 360°?")
|
@@ -31,4 +43,10 @@ with gr.Blocks() as demo:
|
|
31 |
btn = gr.Button("Generate")
|
32 |
btn.click(generate_images, input_image, output_gallery)
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
demo.launch()
|
|
|
2 |
import spaces
|
3 |
from PIL import Image
|
4 |
from typing import List
|
5 |
+
import glob
|
6 |
+
import os
|
7 |
|
8 |
from pipeline import prepare_white_image, MultiViewGenerator
|
9 |
from util import download_file, unzip_file
|
|
|
21 |
|
22 |
return multi_view_generator.infer(white_image=white_image)
|
23 |
|
24 |
+
def prepare_example() -> List[Image.Image]:
|
25 |
+
image_files = sorted(glob.glob(os.path.join("assets/", '*.png')))
|
26 |
+
|
27 |
+
images = []
|
28 |
+
for image_file in image_files:
|
29 |
+
image = Image.open(image_file)
|
30 |
+
images.append(image)
|
31 |
+
|
32 |
+
return images
|
33 |
+
|
34 |
with gr.Blocks() as demo:
|
35 |
gr.Markdown("# Character-360")
|
36 |
gr.Markdown("Do you want to check out your character in 360°?")
|
|
|
43 |
btn = gr.Button("Generate")
|
44 |
btn.click(generate_images, input_image, output_gallery)
|
45 |
|
46 |
+
with gr.Row(visible=False) as ex:
|
47 |
+
examples_multi = gr.Examples(
|
48 |
+
examples=prepare_example(),
|
49 |
+
examples_per_page=8,
|
50 |
+
)
|
51 |
+
|
52 |
demo.launch()
|
assets/1.png
ADDED
assets/10.png
ADDED
assets/11.png
ADDED
assets/12.png
ADDED
assets/13.png
ADDED
assets/14.png
ADDED
assets/15.png
ADDED
assets/16.png
ADDED
assets/17.png
ADDED
assets/18.png
ADDED
assets/19.png
ADDED
assets/2.png
ADDED
assets/20.png
ADDED
assets/21.png
ADDED
assets/22.png
ADDED
assets/23.png
ADDED
assets/24.png
ADDED
assets/25.png
ADDED
assets/3.png
ADDED
assets/4.png
ADDED
assets/5.png
ADDED
assets/6.png
ADDED
assets/7.png
ADDED
assets/8.png
ADDED
assets/9.png
ADDED