nooranis commited on
Commit
6e5f6dc
·
verified ·
1 Parent(s): e7dd4f9

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +149 -35
README.md CHANGED
@@ -1,37 +1,151 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: image
5
- dtype: image
6
- - name: image_id
7
- dtype: int64
8
- - name: noise_type
9
- dtype: string
10
- - name: count_squares
11
- dtype: int64
12
- - name: count_triangles
13
- dtype: int64
14
- - name: count_stars
15
- dtype: int64
16
- - name: total_shapes
17
- dtype: int64
18
- - name: bucket
19
- dtype: int64
20
- - name: bucket_name
21
- dtype: string
22
- - name: difficulty
23
- dtype: string
24
- - name: intended_counts
25
- dtype: string
26
- splits:
27
- - name: train
28
- num_bytes: 94003112.0
29
- num_examples: 14360
30
- download_size: 92976382
31
- dataset_size: 94003112.0
32
- configs:
33
- - config_name: default
34
- data_files:
35
- - split: train
36
- path: data/train-*
37
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: mit
3
+ task_categories:
4
+ - image-classification
5
+ - visual-question-answering
6
+ tags:
7
+ - counting
8
+ - shapes
9
+ - vision
10
+ - cognitive-science
11
+ - psychology
12
+ size_categories:
13
+ - 1K<n<10K
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ---
15
+
16
+ # Shape Counting Dataset
17
+
18
+ A dataset for evaluating shape counting abilities in vision models and humans.
19
+
20
+ ## Dataset Description
21
+
22
+ This dataset contains images with varying numbers of **squares**, **triangles**, and **stars** on a white background. Each image is provided in multiple versions: the original clean image plus several noisy variants.
23
+
24
+ ### Image Specifications
25
+ - **Size**: 256×256 pixels
26
+ - **Format**: Grayscale PNG
27
+ - **Shape size**: 18 pixels
28
+ - **Background**: White (255)
29
+ - **Shapes**: Black (0)
30
+
31
+ ## Dataset Structure
32
+
33
+ ### Fields
34
+
35
+ | Field | Type | Description |
36
+ |-------|------|-------------|
37
+ | `image` | Image | The shape image (original or noisy) |
38
+ | `image_id` | int | Unique ID for the base image (same across noise variants) |
39
+ | `noise_type` | string | Type of noise applied (see below) |
40
+ | `count_squares` | int | Number of squares in the image |
41
+ | `count_triangles` | int | Number of triangles in the image |
42
+ | `count_stars` | int | Number of stars in the image |
43
+ | `total_shapes` | int | Total number of shapes (sum of all counts) |
44
+ | `bucket` | int | Bucket number (1, 2, or 3) |
45
+ | `bucket_name` | string | Bucket description |
46
+ | `difficulty` | string | "medium" or "hard" |
47
+ | `intended_counts` | string | Original intended counts before placement |
48
+
49
+ ### Buckets Explained
50
+
51
+ The dataset is organized into 3 buckets based on shape type complexity:
52
+
53
+ | Bucket | Name | Description |
54
+ |--------|------|-------------|
55
+ | **1** | `single_shape` | Only ONE type of shape (all squares, all triangles, or all stars) |
56
+ | **2** | `two_shapes` | TWO different shape types mixed together |
57
+ | **3** | `three_shapes` | ALL THREE shape types mixed together |
58
+
59
+ ### Difficulty Levels
60
+
61
+ | Difficulty | Total Shapes | Description |
62
+ |------------|--------------|-------------|
63
+ | **medium** | 11-36 | Moderate counting difficulty |
64
+ | **hard** | 37-60 | Challenging counting task |
65
+
66
+ ### Noise Types
67
+
68
+ Each image is provided in 8 variants:
69
+
70
+ | Noise Type | Description |
71
+ |------------|-------------|
72
+ | `original` | Clean image, no noise |
73
+ | `salt_pepper_medium` | 15% salt & pepper noise |
74
+ | `salt_pepper_heavy` | 25% salt & pepper noise |
75
+ | `salt_pepper_extreme` | 35% salt & pepper noise |
76
+ | `blur_heavy` | Gaussian blur (radius=3) |
77
+ | `blur_extreme` | Gaussian blur (radius=5) |
78
+ | `motion_blur` | Horizontal motion blur (size=9) |
79
+ | `motion_blur_heavy` | Horizontal motion blur (size=13) |
80
+
81
+ ## Usage
82
+
83
+ ### Loading the Dataset
84
+
85
+ ```python
86
+ from datasets import load_dataset
87
+
88
+ # Load the full dataset
89
+ dataset = load_dataset("nooranis/shape-counting-dataset")
90
+
91
+ # Filter for only original (clean) images
92
+ original_only = dataset.filter(lambda x: x['noise_type'] == 'original')
93
+
94
+ # Filter for a specific noise type
95
+ blurry = dataset.filter(lambda x: x['noise_type'] == 'blur_heavy')
96
+
97
+ # Filter by difficulty
98
+ hard_images = dataset.filter(lambda x: x['difficulty'] == 'hard')
99
+
100
+ # Filter by bucket
101
+ single_shape = dataset.filter(lambda x: x['bucket'] == 1)
102
+ ```
103
+
104
+ ### Example: Get image and count
105
+
106
+ ```python
107
+ from datasets import load_dataset
108
+
109
+ dataset = load_dataset("nooranis/shape-counting-dataset")
110
+
111
+ # Get a sample
112
+ sample = dataset['train'][0]
113
+
114
+ # Access the image
115
+ image = sample['image'] # PIL Image
116
+
117
+ # Access counts
118
+ print(f"Squares: {sample['count_squares']}")
119
+ print(f"Triangles: {sample['count_triangles']}")
120
+ print(f"Stars: {sample['count_stars']}")
121
+ print(f"Total: {sample['total_shapes']}")
122
+ ```
123
+
124
+ ### Example: Evaluate a vision model
125
+
126
+ ```python
127
+ from datasets import load_dataset
128
+
129
+ dataset = load_dataset("nooranis/shape-counting-dataset")
130
+
131
+ # Get original images only
132
+ test_data = dataset['train'].filter(lambda x: x['noise_type'] == 'original')
133
+
134
+ for sample in test_data:
135
+ image = sample['image']
136
+ true_count = sample['count_stars'] # or count_squares, count_triangles
137
+
138
+ # Your model prediction here
139
+ predicted = your_model.count_stars(image)
140
+
141
+ # Compare
142
+ is_correct = (predicted == true_count)
143
+ ```
144
+
145
+ ## Dataset Statistics
146
+
147
+ - **Total images**: 1795 base images
148
+ - **With noise variants**: 14360 total rows
149
+ - **Noise types**: 8
150
+ - **Buckets**: 3
151
+ - **Difficulty levels**: 2 (medium, hard)