File size: 3,074 Bytes
de8b70d
 
4079284
 
 
 
 
 
 
de8b70d
4079284
 
 
44d1db1
4079284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4783d8f
4079284
8d71c67
 
 
e565ebc
8dc8885
 
 
e565ebc
8dc8885
15f6267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8095cf2
15f6267
548803c
 
 
 
 
4079284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: cc-by-4.0
tags:
- vision
- object-detection
dataset_info:
  - config_name: default
base_datasets:
- coco
---

## Use Case

This dataset is useful for demonstrations of how to train tiny vision models. The size of the dataset was reduced from ~25GB to ~300MB/900MB (grayscale/color) for quick and easy installation. This dataset focuses of the binary task of detecting a person in the image (similar to Visual Wake Words) but still contains all labels (needs to be manually relabelled to use for binary task).


## Dataset Description

This dataset is a derivative work based on the **Microsoft COCO (Common Objects in Context) Dataset** created by the COCO Consortium. It modifies the original dataset by [briefly describe your changes, 
applying the preprocessing described below.


## Preprocessing

1. Official COCO 2017 dataset.
2. Removal of all images tagged as "person" that do not have bounding boxes provided.
3. Boundig-box-aware cropping of the images to 1:1 aspect ratio (prevents cutting out the target information).
4. Downsampling to 64x64.
5. Transformation to grayscale (pixel dtype = uint8).
6. Removal of all iamges tagged as "person" that have small bounding boxes (area < 32x32 px).
7. Compression with GZIP.

**NOTE:** The "easy" version removes all images tagged as "person" that have bounding boxes with area < `int(0.85*TARGET_SIZE)**2`. Also the images are downsampled to 32x32 for fast demonstrations.



## Size
```
Total images in raw COCO dataset (train+test+val): 163,957
Images discarded: 87,856
Images remaining: 76,101
```


## How To Use
````python
import os
import tensorflow as tf
from huggingface_hub import snapshot_download

# Define the repository details
REPO_ID = "slamanigg/tiny-presence-detection"

# Download into a local cache directory
repo_dir = snapshot_download(repo_id=REPO_ID, repo_type="dataset")
print(f"Repository files successfully downloaded to: {repo_dir}\n")

# Pick a version and load
CHOSEN_VERSION = "tiny_presence_64_CH_1"
version_path = os.path.join(repo_dir, CHOSEN_VERSION)
loaded_ds = tf.data.Dataset.load(version_path,bcompression='GZIP')
print(loaded_ds)
````

## Limitations

This dataset was exported in tensorflow (2.20.0) and can therefor only be loaded with tensorflow.


## Citation

If you use this dataset, please cite the following original COCO dataset papers:

```bibtex
@inproceedings{Lin2014COCO,
  author    = {Lin, Tsung-Yi and Maire, Michael and Belongie, Serge and Hays, James and Perona, Pietro and Ramanan, Deva and Doll{\'a}r, Piotr and Zitnick, C. Lawrence},
  title     = {Microsoft COCO: Common Objects in Context},
  booktitle = {Computer Vision -- ECCV 2014},
  year      = {2014},
  pages     = {740--755},
  publisher = {Springer}
}

@article{Chen2015COCOCaptions,
  title   = {Microsoft {COCO} Captions: Data Collection and Evaluation Server},
  author  = {Chen, Xinlei and Fang, Hao and Lin, Tsung-Yi and Vedantam, Ramakrishna and Gupta, Saurabh and Doll{\'a}r, Piotr and Zitnick, C. Lawrence},
  journal = {arXiv preprint arXiv:1504.00325},
  year    = {2015}
}