tinyperson / README.md
shijli's picture
Add the dataset card
4d21c2a verified
|
Raw History Blame Contribute Delete
9.32 kB
---
dataset_info:
config_name: detection
features:
- name: id
dtype: string
- name: file_name
dtype: string
- name: image_id
dtype: int32
- name: image
dtype: image
- name: width
dtype: int32
- name: height
dtype: int32
- name: objects
struct:
- name: category
list:
class_label:
names:
'0': sea_person
'1': earth_person
- name: bbox
list:
list: float32
length: 4
- name: ignore
list: bool
- name: uncertain
list: bool
- name: logo
list: bool
- name: in_dense_image
list: bool
splits:
- name: train
num_bytes: 183021331
num_examples: 794
- name: test
num_bytes: 279278261
num_examples: 816
download_size: 462355690
dataset_size: 462299592
configs:
- config_name: detection
data_files:
- split: train
path: detection/train-*
- split: test
path: detection/test-*
default: true
extra_gated_prompt: TinyPerson is released by its authors for research, without a
separate data license. Its images are frames of web videos and web images whose
rights stay with their owners. This packaging adds no rights.
language:
- en
tags:
- tinyperson
- person-detection
- maritime
- tiny-object-detection
task_categories:
- object-detection
pretty_name: TinyPerson
extra_gated_fields:
I will use this dataset for non-commercial research only: checkbox
I will cite TinyPerson (Scale Match for Tiny Person Detection, WACV 2020) in publications that use it: checkbox
size_categories:
- 1K<n<10K
license: other
---
# TinyPerson
TinyPerson, the tiny-person detection benchmark, packed once with the official annotations kept whole, so it loads in one line and no data path has to be configured:
```python
from datasets import load_dataset
ds = load_dataset("shijli/tinyperson") # 794 train / 816 test
```
TinyPerson (Yu et al., WACV 2020) collects seaside and maritime scenes from web videos and images, mostly 1920 x 1080 and 3840 x 2160 frames, and annotates every person in them. The persons are tiny: the scored boxes have a median size (square root of the area) of 13 pixels in train and 15 in test, and about one in five is under 8 pixels. Each box is labelled a sea person or an earth person and flagged when it is an ignore region, an uncertain object, a logo, or in a dense image.
## Splits
| split | images | labeled / dense / pure background | boxes | official file |
|---|---|---|---|---|
| `train` | 794 | 717 / 48 / 29 | 42197 | `tiny_set_train_with_dense.json` |
| `test` | 816 | 781 / 30 / 5 | 30454 | `tiny_set_test_with_dense.json` |
These are all the labelled images of the release. The benchmark files `tiny_set_train.json` (746 images) and `tiny_set_test.json` (786 images) are exactly these minus the dense images, with identical boxes, which the build checks. TinyPerson has no validation split.
`id` is the file stem (e.g. `bb_V0032_I0001640`) and `file_name` the official path under `train/` or `test/` (e.g. `labeled_images/bb_V0032_I0001640.jpg`), whose folder is the image's subset: `labeled_images`, `labeled_dense_images` or `pure_bg_images`. `image_id` is the official json id (train 0 to 793, test 794 to 1609), so predictions can be written straight into the official evaluation format.
## Columns
| column | type | meaning |
|---|---|---|
| `id` | string | the file stem |
| `file_name` | string | the official path under `train/` or `test/` |
| `image_id` | int32 | the official json image id |
| `image` | image | the JPEG, bytes unchanged |
| `width`, `height` | int32 | image size in pixels |
| `objects.category` | ClassLabel(2) | `0` sea_person, `1` earth_person (official ids 1 and 2) |
| `objects.bbox` | 4 x float32 | the official `[x, y, w, h]`, absolute pixels, top-left origin |
| `objects.ignore` | bool | a crowd, an ambiguous region or a reflection in the water |
| `objects.uncertain` | bool | cannot be told to be a person |
| `objects.logo` | bool | a watermark or logo region (always also `ignore`) |
| `objects.in_dense_image` | bool | the box is in a dense image (more than 220 boxes) |
`objects` is a dict of parallel lists, the way `datasets` stores a sequence of structs:
```python
r = ds["train"][0]
o = r["objects"]
for category, box, ignore, uncertain in zip(o["category"], o["bbox"], o["ignore"], o["uncertain"]):
...
```
## The benchmark protocol
The official tiny-person detection task treats sea and earth persons as one class, scores only the boxes that are neither `ignore` nor `uncertain` as positives, treats `ignore` and `uncertain` boxes as regions where a detection is neither a true nor a false positive, and leaves the dense images out of both training and evaluation. With this dataset that is:
```python
def benchmark(record):
o = record["objects"]
keep = [not d for d in o["in_dense_image"]] # all False for a dense image
positive = [k and not (i or u) for k, i, u in zip(keep, o["ignore"], o["uncertain"])]
ignored = [k and (i or u) for k, i, u in zip(keep, o["ignore"], o["uncertain"])]
return positive, ignored
ds = ds.filter(lambda r: not any(r["objects"]["in_dense_image"]))
```
Box counts in the non-dense images:
| split | positive | ignore | uncertain |
|---|---|---|---|
| `train` | 18433 (6318 sea, 12115 earth) | 3369 | 3486 |
| `test` | 13687 (4939 sea, 8748 earth) | 1989 | 2832 |
The metrics are AP and miss rate at IoU 0.5 (also 0.25 and 0.75), at most 200 detections per image, on the size ranges tiny [1, 20], tiny1 [1, 8], tiny2 [8, 12], tiny3 [12, 20] and small [20, 32], measured as the square root of the box area in pixels. A detection is matched to an ignored region by the fraction of the detection inside it, not by IoU. The reference implementation is `tiny_benchmark/MyPackage/tools/evaluate/evaluate_tiny.py` in the TinyBenchmark repository, run against `annotations/task/tiny_set_test_all.json`.
## The annotations are the official ones, verbatim
Each split holds exactly as many boxes as the with-dense json assigns to its images, and every box is the json's own `[x, y, w, h]` with its category and four flags. Nothing is filtered. The pure-background images are kept with their boxes, all of which are ignore regions, and the three images without any box (1 train, 2 test) are kept too.
Three json fields are not packed because they carry no information. `area` is `w * h` of the box to floating point precision on every annotation, and `iscrowd` is `0` everywhere. `segmentation` is a polygon drawn on the box's own outline: on most boxes it is the four corners, and on 3 to 4 percent it adds a few points along the edges, every point inside the box and within 2 pixels of its boundary. All three were checked over every annotation of both splits before being dropped.
Two details of the official files are worth knowing:
- Every `ignore` box carries category id 1 (sea_person), whatever it covers. The category of an ignore box means nothing.
- The per-category table in the TinyBenchmark dataset README gives 26331 sea and 15867 earth boxes in train. In the json these are the counts of the earth (id 2) boxes and of the sea (id 1) boxes plus all ignore boxes, so the table has the two names the wrong way round. The json is right: drawn on the images, id 1 boxes are the persons in the water.
## What is not included
- The 759 unlabelled images (`no_label_images/`, 380 train and 379 test) from the same videos.
- The `erase_with_uncertain_dataset/` images, in which the ignore and uncertain regions are filled with their mean colour. That is a preprocessing of these images and boxes, and can be redone from them.
- The `corner/` annotation files, which tile each image into overlapping sub-images (e.g. 640 x 512) for training and testing. These too are derived from the boxes packed here.
## How this was packed
The repository includes `create_dataset.py`, which produced these parquet files from the official `tiny_set/` folder with `train.tar.gz` and `test.tar.gz` unpacked next to `annotations/`. Images are copied through byte for byte. Before pushing, the build was checked against the source: the benchmark files are the with-dense files minus the dense images, box for box; every split holds exactly as many boxes as the json assigns to its images; every recorded size matches the JPEG; and sampled records decode back to the same categories, boxes and flags as the json.
## License and attribution
TinyPerson is released by its authors through the [TinyBenchmark repository](https://github.com/ucas-vg/PointTinyBenchmark/tree/TinyBenchmark) for research, without a separate data license. Its images are frames of web videos and web images whose rights stay with their owners. This packaging adds no rights: use it for non-commercial research and cite the original work.
```bibtex
@inproceedings{yu2020scale,
title={Scale Match for Tiny Person Detection},
author={Yu, Xuehui and Gong, Yuqi and Jiang, Nan and Ye, Qixiang and Han, Zhenjun},
booktitle={IEEE Winter Conference on Applications of Computer Vision (WACV)},
pages={1257--1265}, year={2020}
}
```