Datasets:
Update README.md
Browse files
README.md
CHANGED
@@ -20,7 +20,7 @@ dataset_info:
|
|
20 |
'10': K
|
21 |
'11': L
|
22 |
'12': M
|
23 |
-
'13': N
|
24 |
'14': O
|
25 |
'15': P
|
26 |
'16': Q
|
@@ -31,18 +31,55 @@ dataset_info:
|
|
31 |
'21': V
|
32 |
'22': W
|
33 |
'23': X
|
34 |
-
'24': Y
|
35 |
'25': Z
|
36 |
splits:
|
37 |
- name: train
|
38 |
-
num_bytes: 22453522
|
39 |
num_examples: 26000
|
40 |
- name: test
|
41 |
num_bytes: 2244964.8
|
42 |
num_examples: 2600
|
43 |
download_size: 8149945
|
44 |
dataset_size: 24698486.8
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
---
|
46 |
# Dataset Card for "letter_recognition"
|
47 |
|
48 |
-
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
'10': K
|
21 |
'11': L
|
22 |
'12': M
|
23 |
+
'13': 'N'
|
24 |
'14': O
|
25 |
'15': P
|
26 |
'16': Q
|
|
|
31 |
'21': V
|
32 |
'22': W
|
33 |
'23': X
|
34 |
+
'24': 'Y'
|
35 |
'25': Z
|
36 |
splits:
|
37 |
- name: train
|
38 |
+
num_bytes: 22453522
|
39 |
num_examples: 26000
|
40 |
- name: test
|
41 |
num_bytes: 2244964.8
|
42 |
num_examples: 2600
|
43 |
download_size: 8149945
|
44 |
dataset_size: 24698486.8
|
45 |
+
task_categories:
|
46 |
+
- image-classification
|
47 |
+
language:
|
48 |
+
- en
|
49 |
+
size_categories:
|
50 |
+
- 1K<n<10K
|
51 |
---
|
52 |
# Dataset Card for "letter_recognition"
|
53 |
|
54 |
+
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).
|
55 |
+
|
56 |
+
|
57 |
+
```python
|
58 |
+
import os
|
59 |
+
import pandas as pd
|
60 |
+
import matplotlib.pyplot as plt
|
61 |
+
|
62 |
+
CHARACTER_COUNT = 26
|
63 |
+
|
64 |
+
data = pd.read_csv('./A_Z Handwritten Data.csv')
|
65 |
+
mapping = {str(i): chr(i+65) for i in range(26)}
|
66 |
+
|
67 |
+
def generate_dataset(folder, end, start=0):
|
68 |
+
if not os.path.exists(folder):
|
69 |
+
os.makedirs(folder)
|
70 |
+
print(f"The folder '{folder}' has been created successfully!")
|
71 |
+
else:
|
72 |
+
print(f"The folder '{folder}' already exists.")
|
73 |
+
|
74 |
+
for i in range(CHARACTER_COUNT):
|
75 |
+
dd = data[data['0']==i]
|
76 |
+
for j in range(start, end):
|
77 |
+
ddd = dd.iloc[j]
|
78 |
+
x = ddd[1:].values
|
79 |
+
x = x.reshape((28, 28))
|
80 |
+
plt.axis('off')
|
81 |
+
plt.imsave(f'{folder}/{mapping[str(i)]}_{j}.jpg', x, cmap='binary')
|
82 |
+
|
83 |
+
generate_dataset('./train', 1000)
|
84 |
+
generate_dataset('./test', 1100, 1000)
|
85 |
+
```
|