Datasets:

Modalities:
Image
Formats:
arrow
Languages:
English
Tags:
legal
Libraries:
Datasets
License:
File size: 2,906 Bytes
275fdf8
 
564b84a
dee2e1c
564b84a
 
 
 
 
 
 
dee2e1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275fdf8
564b84a
 
 
 
 
dee2e1c
 
 
 
 
 
 
 
 
 
 
 
 
564b84a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dee2e1c
564b84a
 
 
 
 
 
 
dee2e1c
 
 
 
 
 
564b84a
0424c10
564b84a
a29907b
564b84a
23f96be
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
license: mit
task_categories:
- image-classification
language:
- en
tags:
- legal
pretty_name: The Street View House Numbers (SVHN) Dataset
size_categories:
- 10K<n<100K
dataset_info:
  - config_name: default
    features:
      - name: image
        dtype: image
      - name: label
        sequence:
          - name: digit
            dtype: uint8
          - name: left
            dtype: float32
          - name: top
            dtype: float32
          - name: width
            dtype: float32
          - name: height
            dtype: float32
    splits:
      - name: train
        num_bytes: 7718427
        num_examples: 33402
      - name: test
        num_bytes: 2955196
        num_examples: 13068
    download_size: 685311858
    dataset_size: 10673623
configs:
  - config_name: default
    data_files:
      - split: train
        path: default/train/data-*.arrow
      - split: test
        path: default/test/data-*.arrow
---

# Dataset card for SVHN
The Street View House Numbers (SVHN) dataset is a real-world image dataset developed and designed for machine learning and object recognition algorithms, and is characterized by low data preprocessing and formatting requirements. Similar to MNIST, SVHN contains images of small cropped numbers, but in terms of labeled data, SVHN is an order of magnitude larger than MNIST, comprising over 600,000 digital images. Unlike MNIST, SVHN deals with a much more challenging and unsolved real-world problem - recognizing numbers and strings of numbers in natural scene images. The dataset is derived from house numbers captured in Google Street View images.

## Usage
### By API
```python
from datasets import load_dataset

ds = load_dataset("Genius-Society/svhn")
for item in ds["train"]:
    print(item)

for item in ds["test"]:
    print(item)
```

### Not By API
```python
import os
import zipfile
import requests

def download_file(url, save_path):
    response = requests.get(url, stream=True)
    with open(save_path, 'wb') as file:
        for chunk in response.iter_content(chunk_size=1024):
            if chunk:
                file.write(chunk)

def unzip(zip_file_path, extract_to):
    with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
        for member in zip_ref.infolist():
            zip_ref.extract(member, extract_to)

if not os.path.exists('./data.zip'):
    download_file(
        'https://www.modelscope.cn/datasets/Genius-Society/svhn/resolve/master/data/svhn.zip',
        'data.zip'
    )

if not os.path.exists('./data'):
    unzip('data.zip', './')
```

## Maintenance
```bash
GIT_LFS_SKIP_SMUDGE=1 git clone git@hf.co:datasets/Genius-Society/svhn
cd svhn
```

## Mirror
<https://www.modelscope.cn/datasets/Genius-Society/svhn>

## References
[1] <a href="http://ufldl.stanford.edu/housenumbers">The Street View House Numbers (SVHN) Dataset</a><br>
[2] <https://github.com/Genius-Society/svhn_recognition>