Stanislav Kalinin commited on
Commit
73488ef
1 Parent(s): deac5ca

feat: Add school_notebooks_EN dataset

Browse files
annotations_test.json ADDED
The diff for this file is too large to render. See raw diff
 
annotations_train.json ADDED
The diff for this file is too large to render. See raw diff
 
annotations_val.json ADDED
The diff for this file is too large to render. See raw diff
 
dataset_infos.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "default": {
3
+ "description": "Dataset of school notebooks in English",
4
+ "features": {
5
+ "image": {"decode": true, "id": null, "_type": "Image"}
6
+ },
7
+ "splits": {"test": {
8
+ "name": "train",
9
+ "num_bytes": 15374,
10
+ "num_examples": 90,
11
+ "dataset_name": "images"
12
+ }}
13
+ }
14
+ }
images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:295ab37246a1ec976f50019ab77b3bb35543b0cdcbd2b825a7949c4959448a75
3
+ size 356400252
school_notebooks_EN.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import datasets
3
+
4
+
5
+ class FixturesOCR(datasets.GeneratorBasedBuilder):
6
+ def _info(self):
7
+ return datasets.DatasetInfo(
8
+ features=datasets.Features(
9
+ {
10
+ "image": datasets.Image(),
11
+ }
12
+ )
13
+ )
14
+
15
+ def _split_generators(self, dl_manager):
16
+ DL_URLS = [
17
+ "https://huggingface.co/datasets/sberbank-ai/school_notebooks_EN/resolve/main/images.zip"
18
+ ]
19
+ data_files = dl_manager.download_and_extract(DL_URLS)
20
+
21
+ return [
22
+ datasets.SplitGenerator(
23
+ name=datasets.Split.TRAIN,
24
+ gen_kwargs={
25
+ "image_paths": dl_manager.iter_files(data_files),
26
+ },
27
+ ),
28
+ ]
29
+
30
+ def _generate_examples(self, image_paths):
31
+ """Generate examples."""
32
+ for idx, image_path in enumerate(image_paths):
33
+ example = {
34
+ "image": image_path,
35
+ }
36
+ yield idx, example