ZhengGuangze commited on
Commit
92afb6d
·
verified ·
1 Parent(s): 79501dc

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +92 -3
README.md CHANGED
@@ -1,3 +1,92 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ ---
4
+ # Flock4D (tar.gz format)
5
+
6
+ This dataset contains the Flock4D dataset converted to the VLBM/Flock4D-compatible format.
7
+ To facilitate easier downloading and storage, the 1000 sequences have been compressed into `.tar.gz` archives in chunks of 50 sequences per archive.
8
+
9
+ ## Dataset Description
10
+
11
+ - **Source**: Flock4D
12
+ - **Format**: VLBM / Flock4D-compatible per-sequence layout compressed into tar.gz chunks
13
+ - **Contents**: RGB images, dense depth maps, 2D/3D trajectories, camera intrinsics and extrinsics, visibility masks, and scene metadata
14
+
15
+ ### Scale
16
+
17
+ Flock4D provides 1000 sequences of birds (flocks) flying in various environments.
18
+ There are 24 species of birds included:
19
+ `cannada_goose`, `common_starling`, `cormorant`, `crane`, `crested_bis`, `crow`, `dove`, `duck`, `dunlin`, `eagle`, `egret`, `flamingo`, `jackdaw`, `mallard`, `parrot`, `pelican`, `pigeon`, `red_billed_starling`, `seagull`, `snow_goose`, `stork`, `swallow`, `tit`, `warbler`.
20
+
21
+ ## Dataset Structure
22
+
23
+ The original dataset is structured by sequence. In this Hugging Face repository, the sequences are grouped and compressed into tarballs (e.g., `flock4d_00000_00049.tar.gz`).
24
+ After extracting a `.tar.gz` archive, each sequence directory follows this layout:
25
+
26
+ ```
27
+ {Species}_{Background}_4k_{ID}/
28
+ ├── rgbs/
29
+ │ ├── rgb_00000.jpg
30
+ │ ├── rgb_00001.jpg
31
+ │ └── ...
32
+ ├── depths/
33
+ │ ├── depth_00000.npz
34
+ │ ├── depth_00001.npz
35
+ │ └── ...
36
+ ├── intrinsics.npy
37
+ ├── extrinsics.npy
38
+ ├── trajs_2d.npy
39
+ ├── trajs_3d.npy
40
+ ├── visibilities.npy
41
+ └── scene_info.json
42
+ ```
43
+
44
+ ### File Descriptions
45
+
46
+ - `rgbs/`: RGB frames saved as JPEG (`rgb_XXXXX.jpg`).
47
+ - `depths/`: Dense depth maps saved as compressed NumPy archives (`depth_XXXXX.npz`). Each archive stores a float16 array.
48
+ - `intrinsics.npy`: Camera intrinsic matrices for each frame `(T, 3, 3)`.
49
+ - `extrinsics.npy`: World-to-camera extrinsic matrices (W2C) for each frame `(T, 4, 4)`.
50
+ - `trajs_2d.npy`: 2D trajectories `(T, N, 2)` -- pixel coordinates (x, y).
51
+ - `trajs_3d.npy`: 3D trajectories `(T, N, 3)` -- world-space coordinates (x, y, z); zero-filled where invisible.
52
+ - `visibilities.npy`: Visibility flags `(T, N)` (1.0 visible, 0.0 not visible).
53
+ - `scene_info.json`: JSON file with per-sequence metadata, including camera properties and scene assets.
54
+
55
+ ## Usage Example (Python)
56
+
57
+ To use the dataset, first download the tarballs and extract them:
58
+
59
+ ```bash
60
+ mkdir -p data/flock4d
61
+ tar -xvf flock4d_00000_00049.tar.gz -C data/flock4d/
62
+ ```
63
+
64
+ Then load the annotations in Python:
65
+
66
+ ```python
67
+ import numpy as np
68
+ from PIL import Image
69
+ from pathlib import Path
70
+ import json
71
+
72
+ seq_dir = Path("data/flock4d/cannada_goose_abandoned_parking_4k_313")
73
+
74
+ # Load annotations
75
+ trajs_2d = np.load(seq_dir / "trajs_2d.npy") # (T, N, 2)
76
+ trajs_3d = np.load(seq_dir / "trajs_3d.npy") # (T, N, 3)
77
+ vis = np.load(seq_dir / "visibilities.npy") # (T, N)
78
+ intrinsics = np.load(seq_dir / "intrinsics.npy") # (T, 3, 3)
79
+ extrinsics = np.load(seq_dir / "extrinsics.npy") # (T, 4, 4)
80
+
81
+ # Load context
82
+ frame_idx = 0
83
+ rgb = Image.open(seq_dir / "rgbs" / f"rgb_{frame_idx:05d}.jpg")
84
+ depth_npz = np.load(seq_dir / "depths" / f"depth_{frame_idx:05d}.npz")
85
+ depth = depth_npz['depth'] # float16 array (H, W)
86
+
87
+ # Load scene info
88
+ with open(seq_dir / "scene_info.json", 'r') as f:
89
+ scene_info = json.load(f)
90
+
91
+ print(scene_info)
92
+ ```