log_dataset.py 1.0 KB

123456789101112131415161718192021222324252627
  1. import argparse
  2. from wandb_utils import WandbLogger
  3. from utils.general import LOGGER
  4. WANDB_ARTIFACT_PREFIX = 'wandb-artifact://'
  5. def create_dataset_artifact(opt):
  6. logger = WandbLogger(opt, None, job_type='Dataset Creation') # TODO: return value unused
  7. if not logger.wandb:
  8. LOGGER.info("install wandb using `pip install wandb` to log the dataset")
  9. if __name__ == '__main__':
  10. parser = argparse.ArgumentParser()
  11. parser.add_argument('--data', type=str, default='data/coco128.yaml', help='data.yaml path')
  12. parser.add_argument('--single-cls', action='store_true', help='train as single-class dataset')
  13. parser.add_argument('--project', type=str, default='YOLOv5', help='name of W&B Project')
  14. parser.add_argument('--entity', default=None, help='W&B entity')
  15. parser.add_argument('--name', type=str, default='log dataset', help='name of W&B run')
  16. opt = parser.parse_args()
  17. opt.resume = False # Explicitly disallow resume check for dataset upload job
  18. create_dataset_artifact(opt)