Created
August 15, 2024 04:04
-
-
Save julian-q/eb19e4c034b731adeee5d7aa6ececf49 to your computer and use it in GitHub Desktop.
Create `metadata.json` for existing Minecraft data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# note: specifically for the minecraft data, based on "minecraft_video_dataset.py" | |
import json [1/110] | |
from pathlib import Path | |
splits = ["training", "validation"] | |
metadata = {} | |
for split in splits: | |
data_dir = Path("data/minecraft") / split | |
paths = sorted(list(data_dir.glob("**/*.npz")), key=lambda x: x.name) | |
lengths = [300] * len(paths) | |
metadata[split] = lengths | |
json.dump(metadata, open("data/minecraft/metadata.json", "w")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment