def extract_voc_data_if_needed(): if os.path.exists(PATHS.get_voc_dir_path()): return voc_archive_path = PATHS.get_data_file_path('VOCtest_06-Nov-2007.tar') print("Unpacking {}".format(voc_archive_path)) with tarfile.open(voc_archive_path, "r") as tar: tar.extractall(path=PATHS.get_sample_root()) print("Unpacking done!")
def _extract_model(silent=False): """Extract model from Tensorflow model zoo. Args: silent (bool): if False, writes progress messages to stdout """ maybe_print(not silent, "Preparing pretrained model") model_dir = PATHS.get_models_dir_path() maybe_mkdir(model_dir) model_archive_path = PATHS.get_data_file_path( 'ssd_inception_v2_coco_2017_11_17.tar.gz') maybe_print(not silent, "Unpacking {}".format(model_archive_path)) with tarfile.open(model_archive_path, "r:gz") as tar: tar.extractall(path=model_dir) maybe_print(not silent, "Model ready")