Beispiel #1
0
 def remove(ds_name, data_path=None):
     """Remove a downloaded coco dataset."""
     path = Path(URLs.path(c_key='data'))/ds_name if data_path is None else Path(data_path)/ds_name
     if path.is_dir():
         rmtree(path)
         print(f"{path} removed.")
     else:
         print(f"No dataset '{path}' found.")
Beispiel #2
0
 def get_path_df(ds_name, data_path=None):
     """Get path and dataframe of downloaded coco dataset."""
     path = Path(URLs.path(c_key='data'))/ds_name if data_path is None else Path(data_path)/ds_name
     if path.is_dir():
         if (path/"df_train.csv").is_file():
             return (path, pd.read_csv(path/"df_train.csv"))
         else:
             print("No Dataframe found in "+str(path))
     else:
         print("No dataset '"+str(path)+"' found.")
         print("Create dataset first with CocoData.create(ds_name, cat_list) or list available datasets with CocoData.ls()")
Beispiel #3
0
 def ls(data_path=None):
     """List all available datasets."""
     path = Path(URLs.path(c_key='data')) if data_path is None else Path(data_path)
     if path.is_dir():
         return list(path.ls())
     else: print(f"Path {path} does not exist.")