-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmidas_run.py
More file actions
50 lines (47 loc) · 1.97 KB
/
midas_run.py
File metadata and controls
50 lines (47 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from midas.StereoGeneratorEngine import StereoGeneratorEngine as sge
live_camera = True
if not live_camera:
#files names, can be dowloaded from https://drive.google.com/drive/folders/1xt5gVhP2kyXIWQe8xpC3nwCDejKFD0Zw?usp=sharing
# subfolder video
my_file = ['banka.mp4', 'biblioteka.mp4', 'dolina.mp4', 'ekspres.mp4', 'kolo.mp4', 'kwiatki.mp4', 'lotnisko.mp4',
'lwice.mp4',
'mycie_rak.mp4', 'owce.mp4', 'papuga.mp4', 'porsche.mp4', 'port.mp4', 'ptaki.mp4', 'rowerzysta.mp4',
'seoul.mp4', 'szlak.mp4',
'telefon.mp4', 'wiatrak.mp4', 'wodospad.mp4', 'wulkan.mp4', 'zaba.mp4', 'zegarek.mp4']
# Use one of:
# "MiDaS_small"
# "DPT_Hybrid"
# "DPT_Large"
[midas, device, transform] = sge.prepare_dnn("DPT_Large")
for dd in [25,50,75]:
maxdeviation = dd
for ff in my_file:
#path to video files for conversion
in_path = 'd:/data/video/' + ff
out_path = 'help.mp4'
#ouput patj
out_path_sound = 'd:/data/video/results/' + ff
sge.generate_stereo_from_VideoCapture(
device, midas, transform,
#horizontal = False,
#include_sound = True,
show_depth = False,
show_frames = False,
show_fps = False,
resolution = (1280, 720),#(640, 360)
theta = 0.75,
trim_left=0,
maxdeviation = maxdeviation,
in_path = in_path, out_path = out_path, out_path_sound = out_path_sound)
else:
# Use one of:
# "MiDaS_small"
# "DPT_Hybrid"
# "DPT_Large"
[midas, device, transform] = sge.prepare_dnn("MiDaS_small")
sge.generate_stereo_from_VideoCapture(
device, midas, transform,
show_depth=True,
show_frames=True,
show_fps = True
)