File size: 2,037 Bytes
e0c0aca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19a2603
e0c0aca
 
 
 
 
 
 
 
 
 
19a2603
e0c0aca
 
 
19a2603
e0c0aca
 
 
 
 
 
19a2603
 
 
 
 
 
e0c0aca
 
 
19a2603
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
77
78
79
80
81
82
83
84
85
---
dataset_info:
  features:
  - name: image
    dtype: image
  - name: label
    dtype:
      class_label:
        names:
          '0': A
          '1': B
          '2': C
          '3': D
          '4': E
          '5': F
          '6': G
          '7': H
          '8': I
          '9': J
          '10': K
          '11': L
          '12': M
          '13': 'N'
          '14': O
          '15': P
          '16': Q
          '17': R
          '18': S
          '19': T
          '20': U
          '21': V
          '22': W
          '23': X
          '24': 'Y'
          '25': Z
  splits:
  - name: train
    num_bytes: 22453522
    num_examples: 26000
  - name: test
    num_bytes: 2244964.8
    num_examples: 2600
  download_size: 8149945
  dataset_size: 24698486.8
task_categories:
- image-classification
language:
- en
size_categories:
- 1K<n<10K
---
# Dataset Card for "letter_recognition"

Images in this dataset was generated using the script defined below. The original dataset in CSV format and more information of the original dataset is available at [A-Z Handwritten Alphabets in .csv format](https://www.kaggle.com/datasets/sachinpatel21/az-handwritten-alphabets-in-csv-format).


```python
import os
import pandas as pd
import matplotlib.pyplot as plt

CHARACTER_COUNT = 26

data = pd.read_csv('./A_Z Handwritten Data.csv')
mapping = {str(i): chr(i+65) for i in range(26)}

def generate_dataset(folder, end, start=0):
    if not os.path.exists(folder):
        os.makedirs(folder)
        print(f"The folder '{folder}' has been created successfully!")
    else:
        print(f"The folder '{folder}' already exists.")

    for i in range(CHARACTER_COUNT):
        dd = data[data['0']==i]
        for j in range(start, end):
            ddd = dd.iloc[j]
            x = ddd[1:].values
            x = x.reshape((28, 28))
            plt.axis('off')
            plt.imsave(f'{folder}/{mapping[str(i)]}_{j}.jpg', x, cmap='binary')
            
generate_dataset('./train', 1000)
generate_dataset('./test', 1100, 1000)
```