Spaces:
Runtime error
Runtime error
turn-the-cam-anonymous
commited on
Commit
•
b938b85
1
Parent(s):
25c2b18
small updates
Browse files- .gitattributes +2 -0
- app.py +14 -5
- online_demo/nerf_wild/step-100_scale-6.0/alma.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/bike.png +0 -0
- online_demo/nerf_wild/step-100_scale-6.0/car1.png +0 -0
- online_demo/nerf_wild/step-100_scale-6.0/car2.png +0 -0
- online_demo/nerf_wild/step-100_scale-6.0/car3.png +0 -0
- online_demo/nerf_wild/step-100_scale-6.0/car4.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/chair.png +0 -0
- online_demo/nerf_wild/step-100_scale-6.0/extinguisher.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/hyrdrant.png +0 -0
- online_demo/nerf_wild/step-100_scale-6.0/lysol.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/minion.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/phone1.png +0 -0
- online_demo/nerf_wild/step-100_scale-6.0/phone2.png +0 -0
- online_demo/nerf_wild/step-100_scale-6.0/picasso.png +0 -0
- online_demo/nerf_wild/step-100_scale-6.0/pikachu.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/sculpture1.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/sculpture2.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/spyro.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/sunflower.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/taxi.jpg +3 -0
- online_demo/nerf_wild/step-100_scale-6.0/yellowduck.jpg +3 -0
.gitattributes
CHANGED
@@ -32,3 +32,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -4,6 +4,15 @@ import os
|
|
4 |
from PIL import Image
|
5 |
from functools import partial
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
def retrieve_input_image(dataset, inputs):
|
8 |
img_id = inputs
|
9 |
img_path = os.path.join('online_demo', dataset, 'step-100_scale-6.0', img_id, 'input.png')
|
@@ -25,12 +34,12 @@ with gr.Blocks() as demo:
|
|
25 |
with gr.Tab("In-the-wild Images"):
|
26 |
with gr.Row():
|
27 |
with gr.Column(scale=1):
|
28 |
-
default_input_image = Image.open( os.path.join('online_demo', 'nerf_wild', 'step-100_scale-6.0', 'car1
|
29 |
input_image = gr.Image(default_input_image, shape=[256, 256])
|
30 |
-
options = sorted(os.
|
31 |
img_id = gr.Dropdown(options, value='car1', label='options')
|
32 |
text_button = gr.Button("Load Input Image")
|
33 |
-
retrieve_input_image_dataset = partial(
|
34 |
text_button.click(retrieve_input_image_dataset, inputs=img_id, outputs=input_image)
|
35 |
|
36 |
with gr.Column(scale=1):
|
@@ -41,7 +50,7 @@ with gr.Blocks() as demo:
|
|
41 |
gr.Slider(-0.5, 0.5, value=0, step=0.5, label='Zoom'),
|
42 |
gr.Slider(0, 3, value=1, step=1, label='Random seed')]
|
43 |
|
44 |
-
submit_button = gr.Button("
|
45 |
retrieve_novel_view_dataset = partial(retrieve_novel_view, 'nerf_wild')
|
46 |
submit_button.click(retrieve_novel_view_dataset, inputs=inputs, outputs=novel_view)
|
47 |
|
@@ -64,7 +73,7 @@ with gr.Blocks() as demo:
|
|
64 |
gr.Slider(-0.5, 0.5, value=0, step=0.5, label='Zoom'),
|
65 |
gr.Slider(0, 3, value=1, step=1, label='Random seed')]
|
66 |
|
67 |
-
submit_button = gr.Button("
|
68 |
retrieve_novel_view_dataset = partial(retrieve_novel_view, 'GSO')
|
69 |
submit_button.click(retrieve_novel_view_dataset, inputs=inputs, outputs=novel_view)
|
70 |
|
|
|
4 |
from PIL import Image
|
5 |
from functools import partial
|
6 |
|
7 |
+
def retrieve_input_image_wild(dataset, inputs):
|
8 |
+
img_id = inputs
|
9 |
+
img_path = os.path.join('online_demo', dataset, 'step-100_scale-6.0')
|
10 |
+
try:
|
11 |
+
image = Image.open(os.path.join(img_path, '%s.jpg' % img_id))
|
12 |
+
except:
|
13 |
+
image = Image.open(os.path.join(img_path, '%s.png' % img_id))
|
14 |
+
return image
|
15 |
+
|
16 |
def retrieve_input_image(dataset, inputs):
|
17 |
img_id = inputs
|
18 |
img_path = os.path.join('online_demo', dataset, 'step-100_scale-6.0', img_id, 'input.png')
|
|
|
34 |
with gr.Tab("In-the-wild Images"):
|
35 |
with gr.Row():
|
36 |
with gr.Column(scale=1):
|
37 |
+
default_input_image = Image.open( os.path.join('online_demo', 'nerf_wild', 'step-100_scale-6.0', 'car1.png'))
|
38 |
input_image = gr.Image(default_input_image, shape=[256, 256])
|
39 |
+
options = sorted(next(os.walk('online_demo/nerf_wild/step-100_scale-6.0'))[1])
|
40 |
img_id = gr.Dropdown(options, value='car1', label='options')
|
41 |
text_button = gr.Button("Load Input Image")
|
42 |
+
retrieve_input_image_dataset = partial(retrieve_input_image_wild, 'nerf_wild')
|
43 |
text_button.click(retrieve_input_image_dataset, inputs=img_id, outputs=input_image)
|
44 |
|
45 |
with gr.Column(scale=1):
|
|
|
50 |
gr.Slider(-0.5, 0.5, value=0, step=0.5, label='Zoom'),
|
51 |
gr.Slider(0, 3, value=1, step=1, label='Random seed')]
|
52 |
|
53 |
+
submit_button = gr.Button("Generate Novel View")
|
54 |
retrieve_novel_view_dataset = partial(retrieve_novel_view, 'nerf_wild')
|
55 |
submit_button.click(retrieve_novel_view_dataset, inputs=inputs, outputs=novel_view)
|
56 |
|
|
|
73 |
gr.Slider(-0.5, 0.5, value=0, step=0.5, label='Zoom'),
|
74 |
gr.Slider(0, 3, value=1, step=1, label='Random seed')]
|
75 |
|
76 |
+
submit_button = gr.Button("Generate Novel View")
|
77 |
retrieve_novel_view_dataset = partial(retrieve_novel_view, 'GSO')
|
78 |
submit_button.click(retrieve_novel_view_dataset, inputs=inputs, outputs=novel_view)
|
79 |
|
online_demo/nerf_wild/step-100_scale-6.0/alma.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/bike.png
ADDED
online_demo/nerf_wild/step-100_scale-6.0/car1.png
ADDED
online_demo/nerf_wild/step-100_scale-6.0/car2.png
ADDED
online_demo/nerf_wild/step-100_scale-6.0/car3.png
ADDED
online_demo/nerf_wild/step-100_scale-6.0/car4.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/chair.png
ADDED
online_demo/nerf_wild/step-100_scale-6.0/extinguisher.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/hyrdrant.png
ADDED
online_demo/nerf_wild/step-100_scale-6.0/lysol.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/minion.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/phone1.png
ADDED
online_demo/nerf_wild/step-100_scale-6.0/phone2.png
ADDED
online_demo/nerf_wild/step-100_scale-6.0/picasso.png
ADDED
online_demo/nerf_wild/step-100_scale-6.0/pikachu.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/sculpture1.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/sculpture2.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/spyro.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/sunflower.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/taxi.jpg
ADDED
Git LFS Details
|
online_demo/nerf_wild/step-100_scale-6.0/yellowduck.jpg
ADDED
Git LFS Details
|