in scripts/render/render.py [0:0]
def verify_inputs():
"""Verifies that all the command line flags are valid."""
glog.check_ne(FLAGS.input_root, "", "Input_root cannot be empty")
glog.check_ne(FLAGS.output_root, "", "Output_root cannot be empty")
if not FLAGS.rig:
FLAGS.rig = os.path.join(FLAGS.input_root, "rig.json")
if not FLAGS.color:
FLAGS.color = os.path.join(FLAGS.input_root, image_type_paths["color"])
if not FLAGS.background_disp:
FLAGS.background_disp = os.path.join(
FLAGS.input_root, image_type_paths["background_disp"]
)
if not FLAGS.background_color:
FLAGS.background_color = os.path.join(
FLAGS.input_root, image_type_paths["background_color"]
)
if not FLAGS.foreground_masks:
FLAGS.foreground_masks = os.path.join(
FLAGS.input_root, image_type_paths["foreground_masks"]
)
FLAGS.workers = config.LOCALHOST if not FLAGS.workers else FLAGS.workers
FLAGS.master = config.LOCALHOST if not FLAGS.master else FLAGS.master
# Check flag values
glog.check_ge(FLAGS.random_proposals, 0, "Random_proposals must be > 1")
glog.check_le(FLAGS.first, FLAGS.last, "First must be <= last")
if FLAGS.run_depth_estimation and FLAGS.do_temporal_filter:
glog.check_gt(FLAGS.time_radius, 0, "Temporal filter radius must be > 0")
num_frames = int(FLAGS.last) - int(FLAGS.first) + 1
# Ignore temporal filter if we do not have enough frames
if num_frames < 2 * int(FLAGS.time_radius) - 1:
FLAGS.do_temporal_filter = False
FLAGS.time_radius = 0
glog.check_gt(
num_frames,
FLAGS.time_radius,
f"Number of frames ({num_frames}) must be greater than temporal range ({FLAGS.time_radius})",
)