#!/usr/bin/env python3 """ Upload VR Scene Evaluation Dataset to Hugging Face Hub This script uploads a YOLO format dataset to Hugging Face Hub as a dataset repository. For very large datasets, you can also use the command line approach: 1. Install huggingface-hub: pip install huggingface-hub 2. Login: huggingface-cli login 3. Upload: hf upload-large-folder / /path/to/dataset --repo-type=dataset This Python script provides more control and better error handling. """ import os import yaml from pathlib import Path from huggingface_hub import HfApi, login, create_repo import shutil import tempfile # Configuration DATASET_NAME = "DISCOVR" # Change this to your desired dataset name HF_USERNAME = None # Will be set after login DATASET_PATH = "/home/daniel/_datasets/post-2/aggregate" REPO_TYPE = "dataset" def load_dataset_config(): """Load the dataset configuration from data.yaml""" with open(os.path.join(DATASET_PATH, "data.yaml"), 'r') as f: config = yaml.safe_load(f) return config def create_dataset_card(config): """Create a README.md file for the dataset""" class_names = config['names'] num_classes = config['nc'] readme_content = f"""--- license: cc-by-4.0 task_categories: - object-detection language: - en tags: - computer-vision - object-detection - yolo - virtual-reality - vr - scene-evaluation size_categories: - 1K