| |
| import os, glob, datasets |
|
|
| _CITATION = "" |
| _DESCRIPTION = "ATLAS-1: mesh dataset of single-cell 3D OBJ files." |
| _HOMEPAGE = "https://huggingface.co/datasets/Sentinal4D/ATLAS-1" |
| _LICENSE = "CC-BY-4.0" |
|
|
| class AtlasConfig(datasets.BuilderConfig): |
| def __init__(self, **kwargs): |
| super().__init__(version=datasets.Version("1.0.0"), **kwargs) |
|
|
| class Atlas(datasets.GeneratorBasedBuilder): |
| BUILDER_CONFIGS = [AtlasConfig(name="default", description=_DESCRIPTION)] |
|
|
| def _info(self): |
| return datasets.DatasetInfo( |
| description=_DESCRIPTION, |
| features=datasets.Features({ |
| "id": datasets.Value("string"), |
| "path": datasets.Value("string"), |
| |
| |
| |
| }), |
| homepage=_HOMEPAGE, |
| license=_LICENSE, |
| citation=_CITATION, |
| ) |
|
|
| def _split_generators(self, dl_manager): |
| |
| data_files = self.config.data_files or {"train": ["data/**/*.obj"]} |
| |
| downloaded = dl_manager.download(data_files) |
| return [ |
| datasets.SplitGenerator(name=getattr(datasets.Split, split.upper(), datasets.Split.TRAIN), |
| gen_kwargs={"files": downloaded[split]}) |
| for split in downloaded |
| ] |
|
|
| def _generate_examples(self, files): |
| |
| for idx, p in enumerate(sorted(files)): |
| yield idx, { |
| "id": os.path.splitext(os.path.basename(p))[0], |
| "path": p, |
| } |
|
|