log_dataset.py 819 B

123456789101112131415161718192021222324
  1. import argparse
  2. import yaml
  3. from wandb_utils import WandbLogger
  4. WANDB_ARTIFACT_PREFIX = 'wandb-artifact://'
  5. def create_dataset_artifact(opt):
  6. with open(opt.data) as f:
  7. data = yaml.load(f, Loader=yaml.SafeLoader) # data dict
  8. logger = WandbLogger(opt, '', None, data, job_type='Dataset Creation')
  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. opt = parser.parse_args()
  15. opt.resume = False # Explicitly disallow resume check for dataset upload job
  16. create_dataset_artifact(opt)