def has_attr(self, attr): return is_valid_path(self.attrs, attr)
def generator(batch_queue): """ Yields data batches from a queue. Inputs: batch_queue - Queue containing tuples of image pairs and labels. """ while True: yield batch_queue.get(True, None) if __name__ == "__main__": parser = argparse.ArgumentParser( description="Train appearance feature extraction CNN " + "for reidentification task") parser.add_argument("model_dir", type=lambda x: is_valid_path(parser, x), help="Directory containing reidentification data") parser.add_argument("--feature_vector_length", type=int, default=500, help="Size of output feature vector") parser.add_argument( "--holdout_fraction", type=float, default=0.1, help="Fraction of total number of pairs to use for verification") parser.add_argument("--dropout_fraction", type=float, default=0.1, help="Fraction for use in dropout layer.") parser.add_argument("--num_epochs",