Datasets:
License:
refactor: all data
Browse files- .gitattributes +1 -0
- data/generated-vietnamese-passeports-dataset.csv +21 -0
- images/0.png → data/images.tar.gz +2 -2
- generated-vietnamese-passeports-dataset.py +74 -0
- images/1.png +0 -3
- images/10.png +0 -3
- images/11.png +0 -3
- images/12.png +0 -3
- images/13.png +0 -3
- images/14.png +0 -3
- images/15.png +0 -3
- images/16.png +0 -3
- images/17.png +0 -3
- images/18.png +0 -3
- images/19.png +0 -3
- images/2.png +0 -3
- images/3.png +0 -3
- images/4.png +0 -3
- images/5.png +0 -3
- images/6.png +0 -3
- images/7.png +0 -3
- images/8.png +0 -3
- images/9.png +0 -3
- passports.csv +0 -21
.gitattributes
CHANGED
@@ -53,3 +53,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
56 |
+
data filter=lfs diff=lfs merge=lfs -text
|
data/generated-vietnamese-passeports-dataset.csv
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
image_id,image
|
2 |
+
0,images/0.png
|
3 |
+
1,images/1.png
|
4 |
+
2,images/2.png
|
5 |
+
3,images/3.png
|
6 |
+
4,images/4.png
|
7 |
+
5,images/5.png
|
8 |
+
6,images/6.png
|
9 |
+
7,images/7.png
|
10 |
+
8,images/8.png
|
11 |
+
9,images/9.png
|
12 |
+
10,images/10.png
|
13 |
+
11,images/11.png
|
14 |
+
12,images/12.png
|
15 |
+
13,images/13.png
|
16 |
+
14,images/14.png
|
17 |
+
15,images/15.png
|
18 |
+
16,images/16.png
|
19 |
+
17,images/17.png
|
20 |
+
18,images/18.png
|
21 |
+
19,images/19.png
|
images/0.png → data/images.tar.gz
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:58db7f24fdf48a252f1bc347fccad939bee6a1630b4822d4daef4858109aabbb
|
3 |
+
size 28741603
|
generated-vietnamese-passeports-dataset.py
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import datasets
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
_CITATION = """\
|
5 |
+
@InProceedings{huggingface:dataset,
|
6 |
+
title = {generated-vietnamese-passeports-dataset},
|
7 |
+
author = {TrainingDataPro},
|
8 |
+
year = {2023}
|
9 |
+
}
|
10 |
+
"""
|
11 |
+
|
12 |
+
_DESCRIPTION = """\
|
13 |
+
Data generation in machine learning involves creating or manipulating data to train
|
14 |
+
and evaluate machine learning models. The purpose of data generation is to provide
|
15 |
+
diverse and representative examples that cover a wide range of scenarios, ensuring the
|
16 |
+
model's robustness and generalization.
|
17 |
+
The dataset contains GENERATED Vietnamese passports, which are replicas of official
|
18 |
+
passports but with randomly generated details, such as name, date of birth etc.
|
19 |
+
The primary intention of generating these fake passports is to demonstrate the
|
20 |
+
structure and content of a typical passport document and to train the neural network to
|
21 |
+
identify this type of document.
|
22 |
+
Generated passports can assist in conducting research without accessing or compromising
|
23 |
+
real user data that is often sensitive and subject to privacy regulations. Synthetic
|
24 |
+
data generation allows researchers to *develop and refine models using simulated
|
25 |
+
passport data without risking privacy leaks*.
|
26 |
+
"""
|
27 |
+
_NAME = "generated-vietnamese-passeports-dataset"
|
28 |
+
|
29 |
+
_HOMEPAGE = f"https://huggingface.co/datasets/TrainingDataPro/{_NAME}"
|
30 |
+
|
31 |
+
_LICENSE = ""
|
32 |
+
|
33 |
+
_DATA = f"https://huggingface.co/datasets/TrainingDataPro/{_NAME}/resolve/main/data/"
|
34 |
+
|
35 |
+
|
36 |
+
class GeneratedVietnamesePasseportsDataset(datasets.GeneratorBasedBuilder):
|
37 |
+
def _info(self):
|
38 |
+
return datasets.DatasetInfo(
|
39 |
+
description=_DESCRIPTION,
|
40 |
+
features=datasets.Features(
|
41 |
+
{
|
42 |
+
"id": datasets.Value("int32"),
|
43 |
+
"image": datasets.Image()
|
44 |
+
}
|
45 |
+
),
|
46 |
+
supervised_keys=None,
|
47 |
+
homepage=_HOMEPAGE,
|
48 |
+
citation=_CITATION,
|
49 |
+
)
|
50 |
+
|
51 |
+
def _split_generators(self, dl_manager):
|
52 |
+
images = dl_manager.download(f"{_DATA}images.tar.gz")
|
53 |
+
annotations = dl_manager.download(f"{_DATA}{_NAME}.csv")
|
54 |
+
images = dl_manager.iter_archive(images)
|
55 |
+
return [
|
56 |
+
datasets.SplitGenerator(
|
57 |
+
name=datasets.Split.TRAIN,
|
58 |
+
gen_kwargs={
|
59 |
+
"images": images,
|
60 |
+
"annotations": annotations,
|
61 |
+
},
|
62 |
+
),
|
63 |
+
]
|
64 |
+
|
65 |
+
def _generate_examples(self, images, masks, annotations):
|
66 |
+
annotations_df = pd.read_csv(annotations)
|
67 |
+
|
68 |
+
for idx, (image_path, image) in enumerate(
|
69 |
+
zip(images, masks)
|
70 |
+
):
|
71 |
+
yield idx, {
|
72 |
+
"id": annotations_df["image_id"].iloc[idx],
|
73 |
+
"image": {"path": image_path, "bytes": image.read()}
|
74 |
+
}
|
images/1.png
DELETED
Git LFS Details
|
images/10.png
DELETED
Git LFS Details
|
images/11.png
DELETED
Git LFS Details
|
images/12.png
DELETED
Git LFS Details
|
images/13.png
DELETED
Git LFS Details
|
images/14.png
DELETED
Git LFS Details
|
images/15.png
DELETED
Git LFS Details
|
images/16.png
DELETED
Git LFS Details
|
images/17.png
DELETED
Git LFS Details
|
images/18.png
DELETED
Git LFS Details
|
images/19.png
DELETED
Git LFS Details
|
images/2.png
DELETED
Git LFS Details
|
images/3.png
DELETED
Git LFS Details
|
images/4.png
DELETED
Git LFS Details
|
images/5.png
DELETED
Git LFS Details
|
images/6.png
DELETED
Git LFS Details
|
images/7.png
DELETED
Git LFS Details
|
images/8.png
DELETED
Git LFS Details
|
images/9.png
DELETED
Git LFS Details
|
passports.csv
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
image
|
2 |
-
images/0.png
|
3 |
-
images/1.png
|
4 |
-
images/2.png
|
5 |
-
images/3.png
|
6 |
-
images/4.png
|
7 |
-
images/5.png
|
8 |
-
images/6.png
|
9 |
-
images/7.png
|
10 |
-
images/8.png
|
11 |
-
images/9.png
|
12 |
-
images/10.png
|
13 |
-
images/11.png
|
14 |
-
images/12.png
|
15 |
-
images/13.png
|
16 |
-
images/14.png
|
17 |
-
images/15.png
|
18 |
-
images/16.png
|
19 |
-
images/17.png
|
20 |
-
images/18.png
|
21 |
-
images/19.png
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|