Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,7 @@ import json
|
|
16 |
from collections import Counter
|
17 |
import mediapy
|
18 |
import ffmpy
|
|
|
19 |
|
20 |
#from depth_anything.dpt import DepthAnything
|
21 |
#from depth_anything.util.transform import Resize, NormalizeImage, PrepareForNet
|
@@ -63,10 +64,11 @@ def create_alpha_video(frames, fps, type):
|
|
63 |
print("building composite video result")
|
64 |
imgs = []
|
65 |
for j, img in enumerate(frames):
|
66 |
-
imgs.append(cv2.
|
67 |
|
68 |
-
|
69 |
-
|
|
|
70 |
|
71 |
def create_video(frames, fps, type):
|
72 |
print("building video result")
|
|
|
16 |
from collections import Counter
|
17 |
import mediapy
|
18 |
import ffmpy
|
19 |
+
from apng import APNG
|
20 |
|
21 |
#from depth_anything.dpt import DepthAnything
|
22 |
#from depth_anything.util.transform import Resize, NormalizeImage, PrepareForNet
|
|
|
64 |
print("building composite video result")
|
65 |
imgs = []
|
66 |
for j, img in enumerate(frames):
|
67 |
+
imgs.append(cv2.imread(img).astype(np.uint8))
|
68 |
|
69 |
+
APNG.from_files(frames, delay=1000).save(type + "_result.png")
|
70 |
+
mediapy.write_video(type + "_result.webm", imgs, fps=fps)
|
71 |
+
return type + "_result.webm"
|
72 |
|
73 |
def create_video(frames, fps, type):
|
74 |
print("building video result")
|