def _setup_opts(argv): """Parse inputs.""" FLAGS = gflags.FLAGS opts = arg_parsing.setup_opts(argv, FLAGS) return opts
def _setup_opts(argv): """Setup default arguments for the arg parser. returns an opt dictionary with default values setup. """ FLAGS = gflags.FLAGS opts = arg_parsing.setup_opts(argv, FLAGS) return opts
def _setup_opts(argv): """Parse inputs.""" FLAGS = gflags.FLAGS opts = arg_parsing.setup_opts(argv, FLAGS) # setup the feature key list. The hdf5 sampler expects each feature key # to be a list of sub fields. Allowing the hdf5 sampler to traverse # tree like hdf5 files. This isn't needed in this version of the # processing, so just wrap each element as a 1 item list. opts["flags"].feat_keys = [[feat_key] for feat_key in opts["flags"].feat_keys] return opts
def _setup_opts(argv): """Parse inputs.""" FLAGS = gflags.FLAGS opts = arg_parsing.setup_opts(argv, FLAGS) # setup the number iterations per epoch. with h5py.File(opts["flags"].train_file, "r") as train_data: num_train_vids = len(train_data["exp_names"]) iter_per_epoch = numpy.ceil( 1.0 * num_train_vids / opts["flags"].mini_batch) iter_per_epoch = int(iter_per_epoch) opts["flags"].iter_per_epoch = iter_per_epoch opts["flags"].total_iterations =\ iter_per_epoch * opts["flags"].total_epochs return opts
def _setup_opts(argv): """Parse inputs.""" FLAGS = gflags.FLAGS opts = arg_parsing.setup_opts(argv, FLAGS) # setup the number iterations per epoch. with h5py.File(opts["flags"].train_file, "r") as train_data: num_train_vids = len(train_data["exp_names"]) iter_per_epoch =\ np.ceil(1.0 * num_train_vids / opts["flags"].hantman_mini_batch) iter_per_epoch = int(iter_per_epoch) opts["flags"].iter_per_epoch = iter_per_epoch opts["flags"].total_iterations =\ iter_per_epoch * opts["flags"].total_epochs # convert the frames list into a list of values opts["flags"].frames = [int(frame) for frame in opts["flags"].frames] return opts
def _setup_opts(argv): """Parse inputs.""" FLAGS = gflags.FLAGS opts = arg_parsing.setup_opts(argv, FLAGS) # this is dumb... passing in negative numbers to DEFINE_multi_int doesn't # seem to work well. So frames will be a string and split off of spaces. opts["flags"].frames = [ int(frame_num) for frame_num in opts["flags"].frames.split(' ') ] # setup the number iterations per epoch. with h5py.File(opts["flags"].train_file, "r") as train_data: num_train_vids = len(train_data["exp_names"]) iter_per_epoch =\ np.ceil(1.0 * num_train_vids / opts["flags"].hantman_mini_batch) iter_per_epoch = int(iter_per_epoch) opts["flags"].iter_per_epoch = iter_per_epoch opts["flags"].total_iterations =\ iter_per_epoch * opts["flags"].total_epochs return opts
def _setup_opts(argv): """Setup the options.""" FLAGS = gflags.FLAGS opts = arg_parsing.setup_opts(argv, FLAGS) return opts