defload_data(root_dir:Optional[str]=None)->Tuple[LabeledDirDataset,LabeledDirDataset]:"""Load and return the USPS dataset. Args: root_dir: The path to store the downloaded data. When `path` is not provided, the data will be saved into `fastestimator_data` under the user's home directory. Returns: (train_data, test_data) """home=str(Path.home())ifroot_dirisNone:root_dir=os.path.join(home,'fastestimator_data','USPS')else:root_dir=os.path.join(os.path.abspath(root_dir),'USPS')os.makedirs(root_dir,exist_ok=True)# download data to memorytrain_compressed_path=os.path.join(root_dir,"zip.train.gz")test_compressed_path=os.path.join(root_dir,"zip.test.gz")train_base_path=os.path.join(root_dir,"train")test_base_path=os.path.join(root_dir,"test")ifnotos.path.exists(train_base_path):ifnotos.path.exists(train_compressed_path):print("Downloading train data to {}".format(root_dir))wget.download('http://statweb.stanford.edu/~tibs/ElemStatLearn/datasets/zip.train.gz',root_dir,bar=bar_custom)train_images,train_labels=_extract_images_labels(train_compressed_path)_write_data(train_images,train_labels,train_base_path,"train")ifnotos.path.exists(test_base_path):ifnotos.path.exists(test_compressed_path):print("Downloading test data to {}".format(root_dir))wget.download('http://statweb.stanford.edu/~tibs/ElemStatLearn/datasets/zip.test.gz',root_dir,bar=bar_custom)test_images,test_labels=_extract_images_labels(test_compressed_path)_write_data(test_images,test_labels,test_base_path,"test")# make datasetsreturnLabeledDirDataset(train_base_path,file_extension=".png"),LabeledDirDataset(test_base_path,file_extension=".png")