Download school_notebooks_EN.py from ai-forever/school_notebooks_EN: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/datasets/ai-forever/school_notebooks_EN/resolve/71ba84fda0b0d9dc579b4d8bb9f1835c6b6bc0dd/school_notebooks_EN.py
- Command line
-
hf download hf://datasets/ai-forever/school_notebooks_EN@71ba84fda0b0d9dc579b4d8bb9f1835c6b6bc0dd/school_notebooks_EN.py
-
curl -L -o school_notebooks_EN.py https://huggingface.co/datasets/ai-forever/school_notebooks_EN/resolve/71ba84fda0b0d9dc579b4d8bb9f1835c6b6bc0dd/school_notebooks_EN.py
1.01 kB
| import os | |
| import datasets | |
| class FixturesOCR(datasets.GeneratorBasedBuilder): | |
| def _info(self): | |
| return datasets.DatasetInfo( | |
| features=datasets.Features( | |
| { | |
| "image": datasets.Image(), | |
| } | |
| ) | |
| ) | |
| def _split_generators(self, dl_manager): | |
| DL_URLS = [ | |
| "https://huggingface.co/datasets/sberbank-ai/school_notebooks_EN/resolve/main/images.zip" | |
| ] | |
| data_files = dl_manager.download_and_extract(DL_URLS) | |
| return [ | |
| datasets.SplitGenerator( | |
| name=datasets.Split.TRAIN, | |
| gen_kwargs={ | |
| "image_paths": dl_manager.iter_files(data_files), | |
| }, | |
| ), | |
| ] | |
| def _generate_examples(self, image_paths): | |
| """Generate examples.""" | |
| for idx, image_path in enumerate(image_paths): | |
| example = { | |
| "image": image_path, | |
| } | |
| yield idx, example | |