Datasets:
pain
/

Modalities:
Image
Languages:
Arabic
Size:
n<1K
ArXiv:
Tags:
License:
File size: 3,101 Bytes
b7af895
 
769d07b
1d6a6de
b7af895
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3310b7c
b7af895
 
 
 
e6b9ea6
b7af895
 
 
 
 
 
 
 
 
 
9f75b8a
b7af895
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3310b7c
769d07b
3310b7c
769d07b
b7af895
769d07b
144e225
1d6a6de
161b4e2
1d6a6de
 
 
 
 
cb22f5f
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import datasets
from datasets.tasks import ImageClassification
import os
from collections import defaultdict
_CITATION = """\
@misc{https://doi.org/10.48550/arxiv.2301.11932,
  doi = {10.48550/ARXIV.2301.11932},
  
  url = {https://arxiv.org/abs/2301.11932},
  
  author = {Al-Barham, Muhammad and Alsharkawi, Adham and Al-Yaman, Musa and Al-Fetyani, Mohammad and Elnagar, Ashraf and SaAleek, Ahmad Abu and Al-Odat, Mohammad},
  
  keywords = {Computer Vision and Pattern Recognition (cs.CV), FOS: Computer and information sciences, FOS: Computer and information sciences},
  
  title = {RGB Arabic Alphabets Sign Language Dataset},
  
  publisher = {arXiv},
  
  year = {2023},
  
  copyright = {Creative Commons Attribution 4.0 International}
}
"""

_DESCRIPTION = "RGB Arabic Alphabet Sign Language (AASL) dataset comprises 7,857 raw and fully labelled RGB images of the Arabic sign language alphabets, which to our best knowledge is the first publicly available RGB dataset. The dataset is aimed to help those interested in developing real-life Arabic sign language classification models. AASL was collected from more than 200 participants and with different settings such as lighting, background, image orientation, image size, and image resolution. Experts in the field supervised, validated and filtered the collected images to ensure a high-quality dataset." 
_URL = "https://huggingface.co/datasets/pain/AASL/resolve/main/images.zip"
_HOMEPAGE = "https://www.kaggle.com/datasets/muhammadalbrham/rgb-arabic-alphabets-sign-language-dataset"
_LICENSE = "CC BY-SA 4.0"


class AASL(datasets.GeneratorBasedBuilder):
  
  def _info(self):
    
    return datasets.DatasetInfo(

        description=_DESCRIPTION,
        features=datasets.Features(

            {
                "image": datasets.Image(),
                "label": datasets.features.ClassLabel(names=['Ain','Al','Alef','Beh','Dad','Dal','Feh','Ghain','Hah','Heh','Jeem','Kaf','Khah','Laa','Lam','Meem','Noon','Qaf','Reh','Sad','Seen','Sheen','Tah','Teh','Teh_Marbuta','Theh','Waw','Yeh','Zah','Zain', 'thal'])
            }
        ),
        supervised_keys=("image", "label"),
        homepage=_HOMEPAGE,
        citation=_CITATION,
        task_templates=[
            ImageClassification(
                image_column="image",
                label_column="label"
            )
        ],
        license=_LICENSE
    )
  
  def _split_generators(self, dl_manager):
    images_path =  dl_manager.download_and_extract(_URL)
    return [datasets.SplitGenerator(
                name=datasets.Split.TRAIN, gen_kwargs={"images":dl_manager.iter_files([images_path])}
            )]
  
  def _generate_examples(self, images):
    
    two_exp = defaultdict(int)
    for i, file in enumerate(images):
        class_name = os.path.basename(file).split('.')[0].split('_')[0]
        two_exp[class_name] += 1
        if two_exp[class_name]>2:
            continue
        else:
            with open(file, "rb"):
                yield str(i), {
                    "image": file,
                    "label": class_name,
                }