Spaces:
Runtime error
Runtime error
pablovela5620
commited on
Commit
•
f503434
1
Parent(s):
169b74e
Add support for large file storage in examples folder
Browse files- .gitattributes +1 -1
- .gitignore +0 -1
- examples/146391_DT.png +3 -0
- examples/169332_DT.png +3 -0
- examples/197990_DT.png +3 -0
- examples/224596_DT.png +3 -0
- examples/228364_ALI.png +3 -0
- examples/228466_ALI.png +3 -0
- examples/232334_ALI.png +3 -0
- examples/office_01.png +3 -0
- examples/office_01.txt +3 -0
- examples/office_02.png +3 -0
- examples/office_02.txt +3 -0
- examples/office_03.png +3 -0
- examples/office_03.txt +3 -0
- examples/office_04.png +3 -0
- examples/office_04.txt +3 -0
- examples/office_05.png +3 -0
- examples/office_05.txt +3 -0
- examples/office_06.png +3 -0
- examples/office_06.txt +3 -0
- examples/office_07.png +3 -0
- examples/office_07.txt +3 -0
- examples/office_08.png +3 -0
- examples/office_08.txt +3 -0
- main.py +11 -2
.gitattributes
CHANGED
@@ -35,4 +35,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
# GitHub syntax highlighting
|
37 |
pixi.lock linguist-language=YAML
|
38 |
-
|
|
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
# GitHub syntax highlighting
|
37 |
pixi.lock linguist-language=YAML
|
38 |
+
examples/** filter=lfs diff=lfs merge=lfs -text
|
.gitignore
CHANGED
@@ -160,6 +160,5 @@ cython_debug/
|
|
160 |
#.idea/
|
161 |
# pixi environments
|
162 |
.pixi
|
163 |
-
samples/*
|
164 |
checkpoints/*
|
165 |
|
|
|
160 |
#.idea/
|
161 |
# pixi environments
|
162 |
.pixi
|
|
|
163 |
checkpoints/*
|
164 |
|
examples/146391_DT.png
ADDED
Git LFS Details
|
examples/169332_DT.png
ADDED
Git LFS Details
|
examples/197990_DT.png
ADDED
Git LFS Details
|
examples/224596_DT.png
ADDED
Git LFS Details
|
examples/228364_ALI.png
ADDED
Git LFS Details
|
examples/228466_ALI.png
ADDED
Git LFS Details
|
examples/232334_ALI.png
ADDED
Git LFS Details
|
examples/office_01.png
ADDED
Git LFS Details
|
examples/office_01.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5b2b9b72e04c2cd30d82a7ce2ce20979100c1f83a6eadfdcf513f2eb81d9d8f
|
3 |
+
size 28
|
examples/office_02.png
ADDED
Git LFS Details
|
examples/office_02.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5b2b9b72e04c2cd30d82a7ce2ce20979100c1f83a6eadfdcf513f2eb81d9d8f
|
3 |
+
size 28
|
examples/office_03.png
ADDED
Git LFS Details
|
examples/office_03.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5b2b9b72e04c2cd30d82a7ce2ce20979100c1f83a6eadfdcf513f2eb81d9d8f
|
3 |
+
size 28
|
examples/office_04.png
ADDED
Git LFS Details
|
examples/office_04.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5b2b9b72e04c2cd30d82a7ce2ce20979100c1f83a6eadfdcf513f2eb81d9d8f
|
3 |
+
size 28
|
examples/office_05.png
ADDED
Git LFS Details
|
examples/office_05.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5b2b9b72e04c2cd30d82a7ce2ce20979100c1f83a6eadfdcf513f2eb81d9d8f
|
3 |
+
size 28
|
examples/office_06.png
ADDED
Git LFS Details
|
examples/office_06.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5b2b9b72e04c2cd30d82a7ce2ce20979100c1f83a6eadfdcf513f2eb81d9d8f
|
3 |
+
size 28
|
examples/office_07.png
ADDED
Git LFS Details
|
examples/office_07.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5b2b9b72e04c2cd30d82a7ce2ce20979100c1f83a6eadfdcf513f2eb81d9d8f
|
3 |
+
size 28
|
examples/office_08.png
ADDED
Git LFS Details
|
examples/office_08.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e5b2b9b72e04c2cd30d82a7ce2ce20979100c1f83a6eadfdcf513f2eb81d9d8f
|
3 |
+
size 28
|
main.py
CHANGED
@@ -7,10 +7,10 @@ import numpy as np
|
|
7 |
import torch
|
8 |
import torch.nn.functional as F
|
9 |
from torchvision import transforms
|
10 |
-
from PIL import Image
|
11 |
import utils.utils as utils
|
12 |
|
13 |
from models.dsine import DSINE
|
|
|
14 |
|
15 |
device = torch.device("cpu")
|
16 |
|
@@ -69,11 +69,20 @@ with gr.Blocks() as demo:
|
|
69 |
with gr.Row():
|
70 |
input_img = gr.Image(label="Input image", image_mode="RGB")
|
71 |
output_img = ImageSlider(label="Surface Normal", type="numpy")
|
72 |
-
# output_img = gr.Image(label="Normal")
|
73 |
|
74 |
btn = gr.Button("Predict")
|
75 |
btn.click(fn=predict_normal, inputs=[input_img], outputs=[output_img])
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
with Modal(visible=True, allow_user_close=False) as modal:
|
78 |
gr.Markdown(
|
79 |
"""
|
|
|
7 |
import torch
|
8 |
import torch.nn.functional as F
|
9 |
from torchvision import transforms
|
|
|
10 |
import utils.utils as utils
|
11 |
|
12 |
from models.dsine import DSINE
|
13 |
+
from pathlib import Path
|
14 |
|
15 |
device = torch.device("cpu")
|
16 |
|
|
|
69 |
with gr.Row():
|
70 |
input_img = gr.Image(label="Input image", image_mode="RGB")
|
71 |
output_img = ImageSlider(label="Surface Normal", type="numpy")
|
|
|
72 |
|
73 |
btn = gr.Button("Predict")
|
74 |
btn.click(fn=predict_normal, inputs=[input_img], outputs=[output_img])
|
75 |
|
76 |
+
example_files = list(Path("examples").glob("*.png"))
|
77 |
+
example_files.sort()
|
78 |
+
examples = gr.Examples(
|
79 |
+
examples=example_files,
|
80 |
+
inputs=[input_img],
|
81 |
+
outputs=[output_img],
|
82 |
+
fn=predict_normal,
|
83 |
+
cache_examples=False,
|
84 |
+
)
|
85 |
+
|
86 |
with Modal(visible=True, allow_user_close=False) as modal:
|
87 |
gr.Markdown(
|
88 |
"""
|