Spaces:
Running
on
Zero
Running
on
Zero
slothfulxtx
commited on
Commit
·
daedd73
1
Parent(s):
e2c768c
add imageio
Browse files- app.py +3 -3
- requirements.txt +1 -0
app.py
CHANGED
@@ -10,7 +10,7 @@ import torch
|
|
10 |
from decord import cpu, VideoReader
|
11 |
from diffusers.training_utils import set_seed
|
12 |
import torch.nn.functional as F
|
13 |
-
|
14 |
from kornia.filters import canny
|
15 |
from kornia.morphology import dilation
|
16 |
|
@@ -185,8 +185,8 @@ def infer_geometry(
|
|
185 |
output_disp_path.parent.mkdir(exist_ok=True)
|
186 |
|
187 |
colored_disp = pmap_to_disp(point_maps, valid_masks)
|
188 |
-
|
189 |
-
|
190 |
|
191 |
|
192 |
# downsample for visualization
|
|
|
10 |
from decord import cpu, VideoReader
|
11 |
from diffusers.training_utils import set_seed
|
12 |
import torch.nn.functional as F
|
13 |
+
import imageio
|
14 |
from kornia.filters import canny
|
15 |
from kornia.morphology import dilation
|
16 |
|
|
|
185 |
output_disp_path.parent.mkdir(exist_ok=True)
|
186 |
|
187 |
colored_disp = pmap_to_disp(point_maps, valid_masks)
|
188 |
+
imageio.mimsave(
|
189 |
+
output_disp_path, (colored_disp*255).cpu().numpy().astype(np.uint8), fps=fps, macro_block_size=1)
|
190 |
|
191 |
|
192 |
# downsample for visualization
|
requirements.txt
CHANGED
@@ -15,3 +15,4 @@ moderngl
|
|
15 |
piqp
|
16 |
trimesh
|
17 |
scipy
|
|
|
|
15 |
piqp
|
16 |
trimesh
|
17 |
scipy
|
18 |
+
imageio
|