in scripts/ui/verify_data.py [0:0]
def verify(parent, save_frame_ranges=True):
"""Performs all validation on data. Warnings are displayed if an unexpected structure
is encountered.
"""
global verbose
verbose = parent.verbose
if not verbose:
print(glog.green("\nVerifying data (may take a few seconds)..."))
# Look for a rig
rig_fns = get_rigs(parent)
if not rig_fns and parent.is_aws: # no local rigs, check S3
rig_fns = get_rigs_s3(parent)
glog.check(len(rig_fns) > 0, "Cannot launch UI without any rig")
rig_ref = rig_fns[0]
parent.cameras = get_cameras(parent, rig_ref)
parent.rig_width = get_rig_width(parent, rig_ref)
# We need full-size images if we want to (re-)calibrate
have_full_color = have_color(parent)
if not all(have_full_color.values()) and parent.is_aws: # no local color, check S3
if parent.s3_ignore_fullsize_color:
log(glog.yellow(f"Ignoring full-size color image downloads from S3..."))
else:
have_full_color = get_data_s3(parent, have_full_color)
# We have a rig, but we need color levels to run thresholds for depth
# estimation
have_level_color = have_color(parent, is_levels=True)
if not all(have_level_color.values()) and parent.is_aws: # no local color, check S3
have_level_color = get_data_s3(parent, have_level_color, is_levels=True)
# Check what color types have full-size but not level color
map_level_full = dict(zip(have_level_color, have_full_color))
for dir_level, has_level_color in have_level_color.items():
if not has_level_color:
log(glog.yellow(f"No level colors in {dir_level}"))
dir_full = map_level_full[dir_level]
if not have_full_color[dir_full]:
log(
glog.yellow(
f"No full-size colors in {dir_full}. Cannot create levels"
)
)
continue
else:
resize_local_frame(parent, dir_full, dir_level, rig_ref)
have_level_color = have_color(parent, is_levels=True)
if not have_level_color[parent.path_bg_color_levels]:
log(glog.yellow(f"No background frames found. Cannot render background"))
if not have_level_color[parent.path_video_color_levels]:
log(glog.yellow(f"No video frames found. Cannot render video"))
if not any(have_level_color.values()) and not any(have_full_color.values()):
glog.check(False, f"No colors. Cannot calibrate")
# Download disparities from S3
if parent.is_aws:
download_s3_disparities(parent)
# Get frames for color, color levels, disparity (background and video)
if save_frame_ranges:
update_frame_names(parent)