xiaohaoy commited on
Commit
16231ab
·
verified ·
1 Parent(s): 47a8043

Initial release

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +10 -34
  2. .gitignore +11 -0
  3. README.md +243 -0
  4. configs/baseline.yaml +64 -0
  5. configs/open_clip30.yaml +69 -0
  6. configs/qoevave_outdoor_assets.json +22 -0
  7. data/audioset_class_labels_indices.csv +528 -0
  8. data/drop_lists/manual_non_scene_frames.csv +432 -0
  9. data/drop_lists/tau_indoor_scenes.csv +0 -0
  10. data/final_split/final_pairs.csv +0 -0
  11. data/places365_categories.txt +365 -0
  12. data/places365_io.txt +365 -0
  13. docs/DATASETS.md +41 -0
  14. docs/figures/place_average.png +3 -0
  15. docs/figures/scene_type_contrasts.png +3 -0
  16. environment.yml +11 -0
  17. models/final/model_siglip_krr_pe.npz +3 -0
  18. models/soundscape_models/__init__.py +3 -0
  19. models/soundscape_models/audio.py +233 -0
  20. models/soundscape_models/utils.py +167 -0
  21. models/third_party/ImageBind/.assets/bird_audio.wav +3 -0
  22. models/third_party/ImageBind/.assets/bird_image.jpg +3 -0
  23. models/third_party/ImageBind/.assets/car_audio.wav +3 -0
  24. models/third_party/ImageBind/.assets/car_image.jpg +0 -0
  25. models/third_party/ImageBind/.assets/dog_audio.wav +3 -0
  26. models/third_party/ImageBind/.assets/dog_image.jpg +0 -0
  27. models/third_party/ImageBind/.gitignore +8 -0
  28. models/third_party/ImageBind/CODE_OF_CONDUCT.md +80 -0
  29. models/third_party/ImageBind/CONTRIBUTING.md +31 -0
  30. models/third_party/ImageBind/LICENSE +437 -0
  31. models/third_party/ImageBind/README.md +155 -0
  32. models/third_party/ImageBind/imagebind/__init__.py +3 -0
  33. models/third_party/ImageBind/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz +3 -0
  34. models/third_party/ImageBind/imagebind/data.py +357 -0
  35. models/third_party/ImageBind/imagebind/models/__init__.py +0 -0
  36. models/third_party/ImageBind/imagebind/models/helpers.py +140 -0
  37. models/third_party/ImageBind/imagebind/models/imagebind_model.py +506 -0
  38. models/third_party/ImageBind/imagebind/models/multimodal_preprocessors.py +685 -0
  39. models/third_party/ImageBind/imagebind/models/transformer.py +280 -0
  40. models/third_party/ImageBind/model_card.md +94 -0
  41. models/third_party/ImageBind/requirements.txt +11 -0
  42. models/third_party/ImageBind/setup.py +23 -0
  43. models/third_party/classify_street_like_view/core/__init__.py +35 -0
  44. models/third_party/classify_street_like_view/core/data.py +245 -0
  45. models/third_party/classify_street_like_view/core/features.py +189 -0
  46. models/third_party/classify_street_like_view/core/metrics.py +77 -0
  47. models/third_party/classify_street_like_view/core/model.py +267 -0
  48. models/third_party/classify_street_like_view/core/utils.py +104 -0
  49. models/third_party/models/lora_J/LICENSE.md +66 -0
  50. models/third_party/models/lora_J/NOTICE.md +9 -0
.gitattributes CHANGED
@@ -1,35 +1,11 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
  *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ *.sh text eol=lf
2
+ *.py text eol=lf
3
+ models/final/*.npz filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  *.safetensors filter=lfs diff=lfs merge=lfs -text
5
+ *.pt filter=lfs diff=lfs merge=lfs -text
6
+ *.png filter=lfs diff=lfs merge=lfs -text
7
+ models/third_party/ImageBind/.assets/bird_audio.wav filter=lfs diff=lfs merge=lfs -text
8
+ models/third_party/ImageBind/.assets/bird_image.jpg filter=lfs diff=lfs merge=lfs -text
9
+ models/third_party/ImageBind/.assets/car_audio.wav filter=lfs diff=lfs merge=lfs -text
10
+ models/third_party/ImageBind/.assets/dog_audio.wav filter=lfs diff=lfs merge=lfs -text
11
+ models/third_party/ImageBind/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz filter=lfs diff=lfs merge=lfs -text
 
 
 
.gitignore ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ runs_main_all_datasets/
2
+ checkpoints/
3
+ data/*
4
+ !data/places365_categories.txt
5
+ !data/places365_io.txt
6
+ !data/audioset_class_labels_indices.csv
7
+ !data/drop_lists/
8
+ !data/final_split/
9
+ __pycache__/
10
+ *.egg-info/
11
+ runs/
README.md ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ViewingSoundPAQ
2
+
3
+ Predict how a place **sounds** from a **single photo**: the 8 perceived affective qualities (PAQ) of ISO/TS 12913
4
+ (pleasant, eventful, chaotic, vibrant, uneventful, calm, annoying, monotonous), each with an 80% range.
5
+
6
+ The model learns from photo-sound pairs. Each photo is paired with the 10-s audio clip recorded at the same place. The training target is the PAQ that SoundAQNet assigns to that clip. Only the single photo is needed for inference.
7
+
8
+ ## Model
9
+
10
+ | | |
11
+ |---|---|
12
+ | Input | one perspective photo (panoramas: split into 4 views first, `scripts/model/inference/split_panoramas.py`) |
13
+ | Features (frozen, 4,352-d) | SigLIP 2 giant (pooled + mean token, 3,072) + Perception Encoder PE-Core bigG/14 at 448 px (1,280); nothing else at prediction time |
14
+ | Model | kernel ridge regression with an RBF kernel (width 0.5 x median squared distance between standardized training photos), lambda by grouped 5-fold CV on the training side |
15
+ | Output | 8 AQ means + photo-dependent 80% range (a second kernel ridge on the same kernel predicts each photo's error size; calibrated on the out-of-fold residuals) |
16
+ |||
17
+
18
+ **What the 80% range means:**
19
+
20
+ For each AQ the model gives its best guess and a range around it, for example calm 3.1
21
+ with range 2.4-3.9 on the 1-5 scale. The range is where the AQ of the sound actually recorded at that spot is expected
22
+ to fall 8 times out of 10: across many photos, about 8 in 10 real values lie inside their range, about 1 in 10 below
23
+ and 1 in 10 above (the bounds are the 10th and 90th percentiles of the expected error). It is a prediction interval for
24
+ one recording, not a confidence interval for an average: it covers both what the model cannot tell from the photo and
25
+ how much a 10-s clip of such a place varies from moment to moment (a passing bus, a quiet spell).
26
+
27
+ The width is
28
+ photo-specific: narrow width = places that look like this sound consistent and the prediction is more reliable; wide width = the
29
+ sound of such scenes varies a lot or the model is less sure.
30
+
31
+ **10-fold CV results:**
32
+
33
+ | Measure | Result |
34
+ |---|---|
35
+ | Spearman per AQ | pleasant 0.59, eventful 0.68, chaotic 0.66, vibrant 0.56, uneventful 0.66, calm 0.64, annoying 0.58, monotonous 0.60 (mean 0.621) |
36
+ | Pearson per AQ | pleasant 0.59, eventful 0.69, chaotic 0.65, vibrant 0.58, uneventful 0.67, calm 0.64, annoying 0.58, monotonous 0.62 (mean 0.626) |
37
+ | RMSE / MAE (1-5 scale, mean over 8 AQs) | 0.47 / 0.38 |
38
+ | 80% range: coverage / mean width / Winkler | 0.810 / 1.24 / 1.620 |
39
+ |||
40
+
41
+
42
+ ![Place-level average](docs/figures/place_average.png)
43
+
44
+ ![Predicted AQ differences follow the real sound across scene types and events](docs/figures/scene_type_contrasts.png)
45
+
46
+ *Scene types and transient events: difference in mean AQ between photo groups (held-out photos; grey = real sound,
47
+ blue = predicted from the photo). Groups come from segmentation, not a model input.*
48
+
49
+ **Comparison with existing photo-only methods**:
50
+
51
+ | Method | Mean of 8 AQs | Pleasant | Eventful | Chaotic | Vibrant | Uneventful | Calm | Annoying | Monotonous | Delta vs ours [95% CI] |
52
+ |---|---|---|---|---|---|---|---|---|---|---|
53
+ | **Ours (SigLIP 2 + PE + kernel ridge)** | **0.607** | **0.584** | **0.659** | **0.641** | **0.554** | **0.634** | **0.628** | **0.566** | **0.590** | - |
54
+ | CLIP ViT-B/16 + ridge | 0.552 | 0.513 | 0.613 | 0.580 | 0.505 | 0.593 | 0.557 | 0.501 | 0.553 | -0.055 [-0.071, -0.043] |
55
+ | ResNet-50 (ImageNet) + ridge | 0.492 | 0.426 | 0.576 | 0.520 | 0.451 | 0.548 | 0.481 | 0.434 | 0.499 | -0.115 [-0.135, -0.099] |
56
+ | Zhao et al. 2023 [13]: gradient-boosted trees | 0.493 | 0.442 | 0.565 | 0.519 | 0.439 | 0.542 | 0.492 | 0.443 | 0.501 | -0.114 [-0.132, -0.099] |
57
+ | Zhao et al. 2023 [13]: random forest | 0.489 | 0.439 | 0.567 | 0.522 | 0.433 | 0.536 | 0.490 | 0.442 | 0.482 | -0.118 [-0.139, -0.099] |
58
+ | View composition (19 segmentation ratios) + linear regression | 0.351 | 0.260 | 0.460 | 0.365 | 0.338 | 0.420 | 0.327 | 0.272 | 0.369 | -0.256 [-0.286, -0.229] |
59
+ | Qwen3-VL-8B zero-shot PAQ rating | 0.318 | 0.209 | 0.455 | 0.407 | 0.297 | 0.329 | 0.379 | 0.236 | 0.233 | -0.289 [-0.318, -0.261] |
60
+ | Each dataset's mean training target | 0.252 | 0.169 | 0.311 | 0.216 | 0.240 | 0.310 | 0.194 | 0.211 | 0.364 | -0.355 [-0.392, -0.318] |
61
+
62
+ ## Setup
63
+
64
+ Two options. Both use `setup_env.sh` (conda env + PyTorch + this package); torch backend `cu126 | cu128 | cu130 | cpu`
65
+ (macOS: `cpu`).
66
+
67
+ ### Option A: inference only (predict new photos with the final model)
68
+
69
+ ```bash
70
+ ./setup_env.sh viewing-sound-paq cu126
71
+ conda activate viewing-sound-paq
72
+ git lfs pull # the fitted model is stored with Git LFS
73
+ python scripts/model/inference/predict_photo_aq.py --krr --model models/final/model_siglip_krr_pe.npz \
74
+ --images path/to/photos --output-dir runs/my_photos
75
+ ```
76
+
77
+ ### Option B: train the model with the available datasets (evaluation included)
78
+
79
+ ```bash
80
+ ./setup_env.sh viewing-sound-paq cu126 --download-imagebind
81
+ conda activate viewing-sound-paq
82
+ python -c "from huggingface_hub import login; login()" # DINOv3 is gated: accept its licence on Hugging Face first
83
+ ```
84
+
85
+ ## Usage
86
+
87
+ ### 1. Data preparation
88
+
89
+ Download and prepare each dataset as in [docs/DATASETS.md](docs/DATASETS.md).
90
+
91
+ ```bash
92
+ ./runners/run_external_av_datasets.sh --dataset tau
93
+ ./runners/run_external_av_datasets.sh --dataset urban
94
+ ./runners/run_external_av_datasets.sh --dataset lion
95
+ ./runners/run_urbansas_whole_prepare.sh
96
+ ./runners/run_singapore_prepare.sh
97
+ python scripts/data_preparation/datasets/download_360x_outdoor.py
98
+ python scripts/data_preparation/datasets/prepare_360x_outdoor.py
99
+ python scripts/data_preparation/datasets/prepare_eth_binaural.py
100
+ python scripts/data_preparation/open_sound_image_pairs/build_open_sound_image_pairs.py collect
101
+ python scripts/data_preparation/open_sound_image_pairs/build_open_sound_image_pairs.py pair
102
+ python scripts/data_preparation/open_sound_image_pairs/prepare_open_sound_image_pairs.py \
103
+ --output data/open_sound_image_pairs_synchronized_manifest.csv
104
+ ```
105
+
106
+ ### 2. Build the dataset
107
+
108
+ ```bash
109
+ ./runners/build_training_revision.sh --revision urbansas_whole_yfcc_binaural_v1
110
+ ./runners/run_yfcc_expansion.sh --pool nogeo --max-videos 21105
111
+ ./runners/run_sonicurban.sh --root /data/SonicUrban/SonicUrban_clean --images-only
112
+ ./runners/run_sonicurban.sh --root /data/SonicUrban/SonicUrban_clean \
113
+ --revision urbansas_whole_yfcc_binaural_v1_yfcc_nogeo_b0_21105
114
+ python scripts/data_preparation/assemble/combine_revisions.py \
115
+ --base urbansas_whole_yfcc_binaural_v1_yfcc_nogeo_b0_21105 --base-folds <base cv_folds.csv> \
116
+ --add <rev>:<dataset>:<cv_folds.csv> ... --train-exclude <train_exclude.csv> ... \
117
+ --name urbansas_whole_yfcc_binaural_v1_yfcc_nogeo_b0_21105_allnew
118
+ python scripts/data_preparation/targets/relevel_reference.py
119
+ python scripts/data_preparation/datasets/rebuild_usotw_views.py
120
+ ```
121
+
122
+ ### 3. Features
123
+
124
+ ```bash
125
+ rev=urbansas_whole_yfcc_binaural_v1_yfcc_nogeo_b0_21105_allnew_ref40_usotw4
126
+ python scripts/model/features/extract_backbone_features.py \
127
+ --manifest runs_main_all_datasets/direct_aq_dataset_gain/$rev/metadata_manifest.csv \
128
+ --models siglip2_giant_384 pe_core_bigg14_448
129
+ ```
130
+
131
+ ### 4. Training and evaluation (10-fold CV)
132
+
133
+ ```bash
134
+ ./runners/run_final_cv.sh
135
+ ```
136
+
137
+ ### 5. Comparison with existing methods
138
+
139
+ ```bash
140
+ ./runners/run_compare_methods.sh --images /data/Images/Images
141
+ ```
142
+
143
+ ### 6. Inference
144
+
145
+ ```bash
146
+ python scripts/model/inference/predict_photo_aq.py --krr \
147
+ --model models/final/model_siglip_krr_pe.npz \
148
+ --images path/to/photos --output-dir runs_main_all_datasets/predictions_myphotos
149
+ ```
150
+
151
+ ## Datasets
152
+
153
+ Where to download each public dataset and how to prepare it: [docs/DATASETS.md](docs/DATASETS.md).
154
+
155
+ Every training example is a **photo paired with a 10-s clip recorded at the same place** (synchronized video, or a
156
+ recording made at the same spot); no generated or imagined sound is used. The dataset is
157
+ 16,422 pairs from 13 sources (image-audio ImageBind cosine >= 0.2, the added sets' subsets, and the exclusions below).
158
+ 10-fold CV: each fold trains on about 14,800 pairs (14,639-14,888) and tests on about 1,640 (1,534-1,783), holding out
159
+ whole recording groups, so every pair is tested exactly once by a model that never saw its group. The final model is
160
+ then trained on all 16,422.
161
+
162
+ Rules used everywhere:
163
+ - **Pairing:** one-to-one, highest ImageBind cosine; for videos 4/6 frames per video within +-20 s.
164
+ - **Panoramas:** split into 4 perspective views (yaw 0/90/180/270).
165
+
166
+ **PAQ labels (SoundAQNet).** Clips have no human ratings, so each pair's target is predicted from its own
167
+ recorded 10-s clip by SoundAQNet [14] (checkpoint `SoundAQnet_ASC96_AEC94_PAQ1027`, package `soundaqnet`). SoundAQNet
168
+ was trained on the ARAUS listening experiment [15] (25,440 ratings by 605 listeners of 30-s binaural urban soundscapes);
169
+ it reads the clip's log-mel spectrogram and its ISO 532-1 loudness and outputs the 8 PAQ attributes on the 1-5 scale. Clips are cut to 10 s and converted to mono 16 kHz before scoring. The targets are
170
+ therefore machine labels of the recorded sound, not ratings of the photo.
171
+
172
+ **Loudness reference (-40 LUFS).** SoundAQNet reads absolute level (ARAUS [15] recordings were played at their measured 52-77 dB), but most recordings here are uncalibrated, so each dataset gets one gain. The gain
173
+ puts the dataset's median clip at a reference loudness; it was -30 LUFS (inherited), and is now -40 LUFS, chosen on
174
+ human ratings that train nothing: SoundAQNet vs listeners, mean Spearman over
175
+ the 8 AQs, at -30 / -40 LUFS: SATP [16] (27 calibrated London recordings, ~830 listeners each) 0.58 / 0.72 (0.73 at the true
176
+ level), Mumbai (150 clips, Verma et al. 2020 [17]) 0.46 / 0.49; flat from -40 to -48 on both. Moving the reference is the
177
+ same -10 dB on every clip, so all level differences between and within datasets stay.
178
+
179
+ | Dataset | Image | Sound | Used pairs | Public | Reference |
180
+ |---|---|---|---|---|---|
181
+ | YFCC100M street videos | video frame | video soundtrack | 4,151 | yes | [1] |
182
+ | 360+x outdoor | 360 frame | 4-mic 360 camera | 1,202 | yes | [2] |
183
+ | TAU Urban Audio-Visual Scenes 2021 (12 European cities; outdoor scenes) | video frame | binaural recording | 767 | yes | [3] |
184
+ | Urban Soundscapes of the World | 360 screenshot | binaural recording | 458 | yes | [4] |
185
+ | Urbansas (Urban Sound & Sight) | video frame | stereo recording | 273 | yes | [5] |
186
+ | Lion City Soundscapes | video frame | binaural | 49 | yes | [6] |
187
+ | Michigan recordings (Ann Arbor / Detroit field recordings) | panorama | field recorder | 1,592 | no | own recordings |
188
+ | Singapore field recordings (Zhao et al. 2023) | panorama | field video recording | 163 | yes (CC BY-NC-SA 4.0) | [13] |
189
+ | SonicUrban city walks (126 cities) | video frame | camera microphone | 3,692 | yes | [7] |
190
+ | Open sound-image pair data | Mapillary panorama views, Mapillary and Flickr photos near the recording | Aporee / Freesound field recording | 2,723 | yes (sources) | built here from [8]-[11] |
191
+ | ETH Zurich binaural 360 dataset | 360 frame | binaural recording | 660 | yes | [12] |
192
+ | Taiwan sound survey | Mapillary views near the clip | phone recording | 692 | no | [10] |
193
+ |||
194
+
195
+ ## Repository contents
196
+
197
+ ```
198
+ setup_env.sh / environment.yml / pyproject.toml environment (Linux / macOS)
199
+ runners/ shell pipelines: build_training_revision.sh (build the dataset),
200
+ run_*.sh (dataset preparation, expansions, CV, comparison)
201
+ docs/DATASETS.md where to download each public dataset and how to prepare it
202
+ scripts/common/ shared helpers (lib.sh, dataset labels, panorama views, environment check)
203
+ scripts/data_preparation/datasets/ per-dataset frames, views and screens (YFCC, 360+x, TAU, USotW, Urbansas,
204
+ Lion City, SonicUrban, ETH, Singapore field)
205
+ scripts/data_preparation/open_sound_image_pairs/ build the open sound-image pair data (openSIP; Mapillary / Flickr keys)
206
+ scripts/data_preparation/pairing/ ImageBind photo-clip pairing (one-to-one, cosine)
207
+ scripts/data_preparation/targets/ SoundAQNet PAQ labels, dataset gain, -40 LUFS reference
208
+ scripts/data_preparation/assemble/ merge the datasets, training exclusions, CV folds, test list
209
+ scripts/model/features/ SigLIP 2 giant + PE-Core bigG features
210
+ scripts/model/train_test/ CV folds, kernel ridge + 80% range, 10-fold CV, reports
211
+ scripts/model/comparison/ other photo-only methods
212
+ scripts/model/evaluation/ scene-type check and figures
213
+ scripts/model/inference/ predict new photos
214
+ models/final/model_siglip_krr_pe.npz the fitted final model (287 MB, Git LFS)
215
+ models/soundscape_models/ shared code (audio I/O, utils)
216
+ models/third_party/ImageBind/ ImageBind code (CC BY-NC 4.0, see its LICENSE)
217
+ models/third_party/classify_street_like_view/ street-view classifier (LORA_J) code
218
+ models/third_party/models/lora_J/ its trained weights: LoRA adapter + MLP head (16 MB), metrics.json (threshold 0.687)
219
+ configs/ audio target configs
220
+ data/ small label files (Places365 categories, AudioSet labels)
221
+ data/drop_lists/ photos left out (TAU indoor scenes, photos checked by eye)
222
+ data/final_split/final_pairs.csv pairs of the public datasets with their CV folds (dataset, photo file, paired clip, group, fold)
223
+ ```
224
+
225
+ ### References
226
+
227
+ 1. B. Thomee, D. A. Shamma, G. Friedland, B. Elizalde, K. Ni, D. Poland, D. Borth, L.-J. Li. YFCC100M: The new data in multimedia research. *Communications of the ACM* 59(2):64-73, 2016.
228
+ 2. H. Chen, Y. Hou, C. Qu, I. Testini, X. Hong, J. Jiao. 360+x: A panoptic multi-modal scene understanding dataset. *CVPR* 2024. arXiv:2404.00989.
229
+ 3. S. Wang, A. Mesaros, T. Heittola, T. Virtanen. A curated dataset of urban scenes for audio-visual scene analysis. *ICASSP* 2021. Data: Zenodo, doi:10.5281/zenodo.4477542.
230
+ 4. B. De Coensel, K. Sun, D. Botteldooren. Urban Soundscapes of the World: selection and reproduction of urban acoustic environments with soundscape in mind. *Inter-Noise* 2017, Hong Kong. Data: Zenodo, doi:10.5281/zenodo.10106181.
231
+ 5. M. Fuentes, B. Steers, P. Zinemanas, M. Rocamora, L. Bondi, J. Wilkins, Q. Shi, Y. Hou, S. Das, X. Serra, J. P. Bello. Urban sound & sight: Dataset and benchmark for audio-visual urban scene understanding. *ICASSP* 2022. Data: Zenodo, doi:10.5281/zenodo.6658386.
232
+ 6. K. Ooi, J. Goh, H.-W. Lin, Z.-T. Ong, T. Wong, K. N. Watcharasupat, B. Lam, W.-S. Gan. Lion City Soundscapes: Modified partitioning around medoids for a perceptually diverse dataset of Singaporean soundscapes. *JASA Express Letters*, 2024. hdl:10356/178828.
233
+ 7. J. Wang, H. Tan, B. Liao, A. Jiang, T. Fei, Q. Huang, B. Zhou, Z. Tu, S. Ye, Y. Kang. SounDiT: Geo-contextual soundscape-to-landscape generation. *CVPR* 2026, pp. 32659-32670. arXiv:2505.12734. Data: https://huggingface.co/datasets/gisenselab/SounDiT_SoundingSVI_SonicUrban.
234
+ 8. radio aporee ::: maps (U. Noll), https://aporee.org/maps/.
235
+ 9. F. Font, G. Roma, X. Serra. Freesound technical demo. *ACM Multimedia* 2013, pp. 411-412.
236
+ 10. Mapillary street-level imagery, https://www.mapillary.com/.
237
+ 11. Flickr, https://www.flickr.com/.
238
+ 12. A. B. Vasudevan, D. Dai, L. Van Gool. Semantic object prediction and spatial sound super-resolution with binaural sounds. *ECCV* 2020.
239
+ 13. T. Zhao, X. Liang, W. Tu, Z. Huang, F. Biljecki. Sensing urban soundscapes from street view imagery. *Computers, Environment and Urban Systems* 99:101915, 2023. doi:10.1016/j.compenvurbsys.2022.101915. Data: https://github.com/ualsg/Visual-soundscapes (CC BY-NC-SA 4.0).
240
+ 14. Y. Hou, Q. Ren, A. Mitchell, W. Wang, J. Kang, T. Belpaeme, D. Botteldooren. Soundscape captioning using sound affective quality network and large language model. *IEEE Transactions on Multimedia*, 2026. arXiv:2406.05914.
241
+ 15. K. Ooi, Z.-T. Ong, K. N. Watcharasupat, B. Lam, J. Y. Hong, W.-S. Gan. ARAUS: A large-scale dataset and baseline models of affective responses to augmented urban soundscapes. *IEEE Transactions on Affective Computing*. doi:10.1109/TAFFC.2023.3247914. arXiv:2207.01078.
242
+ 16. T. Oberman, A. Mitchell, F. Aletta, J. A. Almagro Pastor, K. Jambrošić, J. Kang. Soundscape Attributes Translation Project (SATP) Dataset. Zenodo, 2022. doi:10.5281/zenodo.6914434.
243
+ 17. D. Verma, A. Jana, K. Ramamritham. Predicting human perception of the urban environment in a spatiotemporal urban setting using locally acquired street view images and audio clips. *Building and Environment* 186:107340, 2020. doi:10.1016/j.buildenv.2020.107340. Data: Audio and Visual Perception Dataset, Mendeley Data v2, doi:10.17632/3hrb6gsgyn.2.
configs/baseline.yaml ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ seed: 42
2
+
3
+ audio:
4
+ feature_profile: soundaqnet_logmel_v1
5
+ sample_rate: 16000
6
+ duration_seconds: 10.0
7
+ n_fft: 512
8
+ win_length: 512
9
+ hop_length: 160
10
+ n_mels: 64
11
+ f_min: 50.0
12
+ f_max: 8000.0
13
+ window: hann
14
+ center: true
15
+ pad_mode: reflect
16
+ power: 2.0
17
+ ref: 1.0
18
+ amin: 1.0e-10
19
+ top_db: null
20
+ loudness_floor_db: -80.0
21
+
22
+ photo:
23
+ dino_model: facebook/dinov3-vitl16-pretrain-lvd1689m
24
+ semantic_model: nvidia/segformer-b5-finetuned-ade-640-640
25
+ depth_model: depth-anything/Depth-Anything-V2-Small-hf
26
+ image_size: 448
27
+ batch_size: 2
28
+ num_workers: 0
29
+
30
+ model1:
31
+ d_model: 256
32
+ attention_heads: 8
33
+ transformer_layers: 2
34
+ decoder_channels: 128
35
+ dropout: 0.1
36
+ batch_size: 4
37
+ epochs: 30
38
+ learning_rate: 0.0002
39
+ weight_decay: 0.05
40
+ warmup_fraction: 0.05
41
+ gradient_clip: 1.0
42
+ num_workers: 0
43
+ loss_weights:
44
+ mel: 1.0
45
+ loudness: 0.5
46
+ lufs: 0.25
47
+
48
+ model2:
49
+ channels: 256
50
+ upsample_rates: [8, 5, 2, 2]
51
+ upsample_kernel_sizes: [16, 15, 4, 4]
52
+ segment_frames: 64
53
+ batch_size: 4
54
+ epochs: 50
55
+ learning_rate: 0.0002
56
+ weight_decay: 0.0001
57
+ warmup_fraction: 0.02
58
+ gradient_clip: 10.0
59
+ num_workers: 0
60
+ loss_weights:
61
+ waveform_l1: 1.0
62
+ stft: 2.0
63
+ envelope: 0.5
64
+
configs/open_clip30.yaml ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Open-source SIPset pairs (Aporee / Freesound + Mapillary): 832 recordists with unknown gains, so
2
+ # each clip is level-normalized to -30 LUFS (loudness is not comparable; spectrum shape and content are).
3
+ # Spectrogram settings shared by all datasets so they can be combined.
4
+ seed: 42
5
+
6
+ audio:
7
+ feature_profile: soundaqnet_logmel_v1
8
+ sample_rate: 16000
9
+ duration_seconds: 10.0
10
+ n_fft: 512
11
+ win_length: 512
12
+ hop_length: 160
13
+ n_mels: 64
14
+ f_min: 50.0
15
+ f_max: 8000.0
16
+ window: hann
17
+ center: true
18
+ pad_mode: reflect
19
+ power: 2.0
20
+ ref: 1.0
21
+ amin: 1.0e-10
22
+ top_db: null
23
+ loudness_floor_db: -80.0
24
+ level_normalization_lufs: -30.0
25
+ level_normalization_mode: clip
26
+
27
+ photo:
28
+ dino_model: facebook/dinov3-vitl16-pretrain-lvd1689m
29
+ semantic_model: nvidia/segformer-b5-finetuned-ade-640-640
30
+ depth_model: depth-anything/Depth-Anything-V2-Small-hf
31
+ image_size: 448
32
+ batch_size: 2
33
+ num_workers: 0
34
+
35
+ model1:
36
+ d_model: 256
37
+ attention_heads: 8
38
+ transformer_layers: 2
39
+ decoder_channels: 128
40
+ dropout: 0.3
41
+ batch_size: 4
42
+ epochs: 10
43
+ learning_rate: 0.0001
44
+ weight_decay: 0.1
45
+ warmup_fraction: 0.05
46
+ gradient_clip: 1.0
47
+ num_workers: 0
48
+ loss_weights:
49
+ mel: 1.0
50
+ loudness: 0.5
51
+ lufs: 0.0
52
+
53
+ model2:
54
+ channels: 256
55
+ upsample_rates: [8, 5, 2, 2]
56
+ upsample_kernel_sizes: [16, 15, 4, 4]
57
+ segment_frames: 64
58
+ batch_size: 4
59
+ epochs: 30
60
+ learning_rate: 0.0002
61
+ weight_decay: 0.0001
62
+ warmup_fraction: 0.02
63
+ gradient_clip: 10.0
64
+ num_workers: 0
65
+ loss_weights:
66
+ waveform_l1: 1.0
67
+ stft: 2.0
68
+ envelope: 0.5
69
+
configs/qoevave_outdoor_assets.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dataset": "qoevave_outdoor",
3
+ "source_url": "https://qoevave.github.io/database/docs/Scenes",
4
+ "license": "CC BY-NC-ND 4.0",
5
+ "audio_format": "4th-order AmbiX, ACN/SN3D, 48 kHz, 24-bit",
6
+ "video_format": "8K muxed MP4; the embedded audio is not used",
7
+ "assets": [
8
+ {"take":"BuskingCity01","family":"BuskingCity","location_group":"kasemattentor","split":"test","duration_hint":51},
9
+ {"take":"BuskingCity02","family":"BuskingCity","location_group":"kasemattentor","split":"test","duration_hint":63},
10
+ {"take":"ForestWalk01","family":"ForestWalk","location_group":"goldbach","split":"train","duration_hint":60},
11
+ {"take":"ForestWalk02","family":"ForestWalk","location_group":"goldbach","split":"train","duration_hint":60},
12
+ {"take":"ForestWalk03","family":"ForestWalk","location_group":"goldbach","split":"train","duration_hint":60},
13
+ {"take":"Lake01","family":"Lake","location_group":"grosse_teich","split":"test","duration_hint":60},
14
+ {"take":"ParkFountains01","family":"ParkFountains","location_group":"stadtpark_fountains","split":"train","duration_hint":60},
15
+ {"take":"River01","family":"River","location_group":"goldbach","split":"train","duration_hint":60},
16
+ {"take":"Skateboarding01","family":"Skateboarding","location_group":"th_nuernberg_plaza","split":"val","duration_hint":60},
17
+ {"take":"Skateboarding03","family":"Skateboarding","location_group":"th_nuernberg_plaza","split":"val","duration_hint":60},
18
+ {"take":"Skateboarding04","family":"Skateboarding","location_group":"th_nuernberg_plaza","split":"val","duration_hint":60},
19
+ {"take":"Skateboarding05","family":"Skateboarding","location_group":"th_nuernberg_plaza","split":"val","duration_hint":63},
20
+ {"take":"Train01","family":"Train","location_group":"nelson_mandela_bridge","split":"train","duration_hint":60}
21
+ ]
22
+ }
data/audioset_class_labels_indices.csv ADDED
@@ -0,0 +1,528 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ index,mid,display_name
2
+ 0,/m/09x0r,"Speech"
3
+ 1,/m/05zppz,"Male speech, man speaking"
4
+ 2,/m/02zsn,"Female speech, woman speaking"
5
+ 3,/m/0ytgt,"Child speech, kid speaking"
6
+ 4,/m/01h8n0,"Conversation"
7
+ 5,/m/02qldy,"Narration, monologue"
8
+ 6,/m/0261r1,"Babbling"
9
+ 7,/m/0brhx,"Speech synthesizer"
10
+ 8,/m/07p6fty,"Shout"
11
+ 9,/m/07q4ntr,"Bellow"
12
+ 10,/m/07rwj3x,"Whoop"
13
+ 11,/m/07sr1lc,"Yell"
14
+ 12,/m/04gy_2,"Battle cry"
15
+ 13,/t/dd00135,"Children shouting"
16
+ 14,/m/03qc9zr,"Screaming"
17
+ 15,/m/02rtxlg,"Whispering"
18
+ 16,/m/01j3sz,"Laughter"
19
+ 17,/t/dd00001,"Baby laughter"
20
+ 18,/m/07r660_,"Giggle"
21
+ 19,/m/07s04w4,"Snicker"
22
+ 20,/m/07sq110,"Belly laugh"
23
+ 21,/m/07rgt08,"Chuckle, chortle"
24
+ 22,/m/0463cq4,"Crying, sobbing"
25
+ 23,/t/dd00002,"Baby cry, infant cry"
26
+ 24,/m/07qz6j3,"Whimper"
27
+ 25,/m/07qw_06,"Wail, moan"
28
+ 26,/m/07plz5l,"Sigh"
29
+ 27,/m/015lz1,"Singing"
30
+ 28,/m/0l14jd,"Choir"
31
+ 29,/m/01swy6,"Yodeling"
32
+ 30,/m/02bk07,"Chant"
33
+ 31,/m/01c194,"Mantra"
34
+ 32,/t/dd00003,"Male singing"
35
+ 33,/t/dd00004,"Female singing"
36
+ 34,/t/dd00005,"Child singing"
37
+ 35,/t/dd00006,"Synthetic singing"
38
+ 36,/m/06bxc,"Rapping"
39
+ 37,/m/02fxyj,"Humming"
40
+ 38,/m/07s2xch,"Groan"
41
+ 39,/m/07r4k75,"Grunt"
42
+ 40,/m/01w250,"Whistling"
43
+ 41,/m/0lyf6,"Breathing"
44
+ 42,/m/07mzm6,"Wheeze"
45
+ 43,/m/01d3sd,"Snoring"
46
+ 44,/m/07s0dtb,"Gasp"
47
+ 45,/m/07pyy8b,"Pant"
48
+ 46,/m/07q0yl5,"Snort"
49
+ 47,/m/01b_21,"Cough"
50
+ 48,/m/0dl9sf8,"Throat clearing"
51
+ 49,/m/01hsr_,"Sneeze"
52
+ 50,/m/07ppn3j,"Sniff"
53
+ 51,/m/06h7j,"Run"
54
+ 52,/m/07qv_x_,"Shuffle"
55
+ 53,/m/07pbtc8,"Walk, footsteps"
56
+ 54,/m/03cczk,"Chewing, mastication"
57
+ 55,/m/07pdhp0,"Biting"
58
+ 56,/m/0939n_,"Gargling"
59
+ 57,/m/01g90h,"Stomach rumble"
60
+ 58,/m/03q5_w,"Burping, eructation"
61
+ 59,/m/02p3nc,"Hiccup"
62
+ 60,/m/02_nn,"Fart"
63
+ 61,/m/0k65p,"Hands"
64
+ 62,/m/025_jnm,"Finger snapping"
65
+ 63,/m/0l15bq,"Clapping"
66
+ 64,/m/01jg02,"Heart sounds, heartbeat"
67
+ 65,/m/01jg1z,"Heart murmur"
68
+ 66,/m/053hz1,"Cheering"
69
+ 67,/m/028ght,"Applause"
70
+ 68,/m/07rkbfh,"Chatter"
71
+ 69,/m/03qtwd,"Crowd"
72
+ 70,/m/07qfr4h,"Hubbub, speech noise, speech babble"
73
+ 71,/t/dd00013,"Children playing"
74
+ 72,/m/0jbk,"Animal"
75
+ 73,/m/068hy,"Domestic animals, pets"
76
+ 74,/m/0bt9lr,"Dog"
77
+ 75,/m/05tny_,"Bark"
78
+ 76,/m/07r_k2n,"Yip"
79
+ 77,/m/07qf0zm,"Howl"
80
+ 78,/m/07rc7d9,"Bow-wow"
81
+ 79,/m/0ghcn6,"Growling"
82
+ 80,/t/dd00136,"Whimper (dog)"
83
+ 81,/m/01yrx,"Cat"
84
+ 82,/m/02yds9,"Purr"
85
+ 83,/m/07qrkrw,"Meow"
86
+ 84,/m/07rjwbb,"Hiss"
87
+ 85,/m/07r81j2,"Caterwaul"
88
+ 86,/m/0ch8v,"Livestock, farm animals, working animals"
89
+ 87,/m/03k3r,"Horse"
90
+ 88,/m/07rv9rh,"Clip-clop"
91
+ 89,/m/07q5rw0,"Neigh, whinny"
92
+ 90,/m/01xq0k1,"Cattle, bovinae"
93
+ 91,/m/07rpkh9,"Moo"
94
+ 92,/m/0239kh,"Cowbell"
95
+ 93,/m/068zj,"Pig"
96
+ 94,/t/dd00018,"Oink"
97
+ 95,/m/03fwl,"Goat"
98
+ 96,/m/07q0h5t,"Bleat"
99
+ 97,/m/07bgp,"Sheep"
100
+ 98,/m/025rv6n,"Fowl"
101
+ 99,/m/09b5t,"Chicken, rooster"
102
+ 100,/m/07st89h,"Cluck"
103
+ 101,/m/07qn5dc,"Crowing, cock-a-doodle-doo"
104
+ 102,/m/01rd7k,"Turkey"
105
+ 103,/m/07svc2k,"Gobble"
106
+ 104,/m/09ddx,"Duck"
107
+ 105,/m/07qdb04,"Quack"
108
+ 106,/m/0dbvp,"Goose"
109
+ 107,/m/07qwf61,"Honk"
110
+ 108,/m/01280g,"Wild animals"
111
+ 109,/m/0cdnk,"Roaring cats (lions, tigers)"
112
+ 110,/m/04cvmfc,"Roar"
113
+ 111,/m/015p6,"Bird"
114
+ 112,/m/020bb7,"Bird vocalization, bird call, bird song"
115
+ 113,/m/07pggtn,"Chirp, tweet"
116
+ 114,/m/07sx8x_,"Squawk"
117
+ 115,/m/0h0rv,"Pigeon, dove"
118
+ 116,/m/07r_25d,"Coo"
119
+ 117,/m/04s8yn,"Crow"
120
+ 118,/m/07r5c2p,"Caw"
121
+ 119,/m/09d5_,"Owl"
122
+ 120,/m/07r_80w,"Hoot"
123
+ 121,/m/05_wcq,"Bird flight, flapping wings"
124
+ 122,/m/01z5f,"Canidae, dogs, wolves"
125
+ 123,/m/06hps,"Rodents, rats, mice"
126
+ 124,/m/04rmv,"Mouse"
127
+ 125,/m/07r4gkf,"Patter"
128
+ 126,/m/03vt0,"Insect"
129
+ 127,/m/09xqv,"Cricket"
130
+ 128,/m/09f96,"Mosquito"
131
+ 129,/m/0h2mp,"Fly, housefly"
132
+ 130,/m/07pjwq1,"Buzz"
133
+ 131,/m/01h3n,"Bee, wasp, etc."
134
+ 132,/m/09ld4,"Frog"
135
+ 133,/m/07st88b,"Croak"
136
+ 134,/m/078jl,"Snake"
137
+ 135,/m/07qn4z3,"Rattle"
138
+ 136,/m/032n05,"Whale vocalization"
139
+ 137,/m/04rlf,"Music"
140
+ 138,/m/04szw,"Musical instrument"
141
+ 139,/m/0fx80y,"Plucked string instrument"
142
+ 140,/m/0342h,"Guitar"
143
+ 141,/m/02sgy,"Electric guitar"
144
+ 142,/m/018vs,"Bass guitar"
145
+ 143,/m/042v_gx,"Acoustic guitar"
146
+ 144,/m/06w87,"Steel guitar, slide guitar"
147
+ 145,/m/01glhc,"Tapping (guitar technique)"
148
+ 146,/m/07s0s5r,"Strum"
149
+ 147,/m/018j2,"Banjo"
150
+ 148,/m/0jtg0,"Sitar"
151
+ 149,/m/04rzd,"Mandolin"
152
+ 150,/m/01bns_,"Zither"
153
+ 151,/m/07xzm,"Ukulele"
154
+ 152,/m/05148p4,"Keyboard (musical)"
155
+ 153,/m/05r5c,"Piano"
156
+ 154,/m/01s0ps,"Electric piano"
157
+ 155,/m/013y1f,"Organ"
158
+ 156,/m/03xq_f,"Electronic organ"
159
+ 157,/m/03gvt,"Hammond organ"
160
+ 158,/m/0l14qv,"Synthesizer"
161
+ 159,/m/01v1d8,"Sampler"
162
+ 160,/m/03q5t,"Harpsichord"
163
+ 161,/m/0l14md,"Percussion"
164
+ 162,/m/02hnl,"Drum kit"
165
+ 163,/m/0cfdd,"Drum machine"
166
+ 164,/m/026t6,"Drum"
167
+ 165,/m/06rvn,"Snare drum"
168
+ 166,/m/03t3fj,"Rimshot"
169
+ 167,/m/02k_mr,"Drum roll"
170
+ 168,/m/0bm02,"Bass drum"
171
+ 169,/m/011k_j,"Timpani"
172
+ 170,/m/01p970,"Tabla"
173
+ 171,/m/01qbl,"Cymbal"
174
+ 172,/m/03qtq,"Hi-hat"
175
+ 173,/m/01sm1g,"Wood block"
176
+ 174,/m/07brj,"Tambourine"
177
+ 175,/m/05r5wn,"Rattle (instrument)"
178
+ 176,/m/0xzly,"Maraca"
179
+ 177,/m/0mbct,"Gong"
180
+ 178,/m/016622,"Tubular bells"
181
+ 179,/m/0j45pbj,"Mallet percussion"
182
+ 180,/m/0dwsp,"Marimba, xylophone"
183
+ 181,/m/0dwtp,"Glockenspiel"
184
+ 182,/m/0dwt5,"Vibraphone"
185
+ 183,/m/0l156b,"Steelpan"
186
+ 184,/m/05pd6,"Orchestra"
187
+ 185,/m/01kcd,"Brass instrument"
188
+ 186,/m/0319l,"French horn"
189
+ 187,/m/07gql,"Trumpet"
190
+ 188,/m/07c6l,"Trombone"
191
+ 189,/m/0l14_3,"Bowed string instrument"
192
+ 190,/m/02qmj0d,"String section"
193
+ 191,/m/07y_7,"Violin, fiddle"
194
+ 192,/m/0d8_n,"Pizzicato"
195
+ 193,/m/01xqw,"Cello"
196
+ 194,/m/02fsn,"Double bass"
197
+ 195,/m/085jw,"Wind instrument, woodwind instrument"
198
+ 196,/m/0l14j_,"Flute"
199
+ 197,/m/06ncr,"Saxophone"
200
+ 198,/m/01wy6,"Clarinet"
201
+ 199,/m/03m5k,"Harp"
202
+ 200,/m/0395lw,"Bell"
203
+ 201,/m/03w41f,"Church bell"
204
+ 202,/m/027m70_,"Jingle bell"
205
+ 203,/m/0gy1t2s,"Bicycle bell"
206
+ 204,/m/07n_g,"Tuning fork"
207
+ 205,/m/0f8s22,"Chime"
208
+ 206,/m/026fgl,"Wind chime"
209
+ 207,/m/0150b9,"Change ringing (campanology)"
210
+ 208,/m/03qjg,"Harmonica"
211
+ 209,/m/0mkg,"Accordion"
212
+ 210,/m/0192l,"Bagpipes"
213
+ 211,/m/02bxd,"Didgeridoo"
214
+ 212,/m/0l14l2,"Shofar"
215
+ 213,/m/07kc_,"Theremin"
216
+ 214,/m/0l14t7,"Singing bowl"
217
+ 215,/m/01hgjl,"Scratching (performance technique)"
218
+ 216,/m/064t9,"Pop music"
219
+ 217,/m/0glt670,"Hip hop music"
220
+ 218,/m/02cz_7,"Beatboxing"
221
+ 219,/m/06by7,"Rock music"
222
+ 220,/m/03lty,"Heavy metal"
223
+ 221,/m/05r6t,"Punk rock"
224
+ 222,/m/0dls3,"Grunge"
225
+ 223,/m/0dl5d,"Progressive rock"
226
+ 224,/m/07sbbz2,"Rock and roll"
227
+ 225,/m/05w3f,"Psychedelic rock"
228
+ 226,/m/06j6l,"Rhythm and blues"
229
+ 227,/m/0gywn,"Soul music"
230
+ 228,/m/06cqb,"Reggae"
231
+ 229,/m/01lyv,"Country"
232
+ 230,/m/015y_n,"Swing music"
233
+ 231,/m/0gg8l,"Bluegrass"
234
+ 232,/m/02x8m,"Funk"
235
+ 233,/m/02w4v,"Folk music"
236
+ 234,/m/06j64v,"Middle Eastern music"
237
+ 235,/m/03_d0,"Jazz"
238
+ 236,/m/026z9,"Disco"
239
+ 237,/m/0ggq0m,"Classical music"
240
+ 238,/m/05lls,"Opera"
241
+ 239,/m/02lkt,"Electronic music"
242
+ 240,/m/03mb9,"House music"
243
+ 241,/m/07gxw,"Techno"
244
+ 242,/m/07s72n,"Dubstep"
245
+ 243,/m/0283d,"Drum and bass"
246
+ 244,/m/0m0jc,"Electronica"
247
+ 245,/m/08cyft,"Electronic dance music"
248
+ 246,/m/0fd3y,"Ambient music"
249
+ 247,/m/07lnk,"Trance music"
250
+ 248,/m/0g293,"Music of Latin America"
251
+ 249,/m/0ln16,"Salsa music"
252
+ 250,/m/0326g,"Flamenco"
253
+ 251,/m/0155w,"Blues"
254
+ 252,/m/05fw6t,"Music for children"
255
+ 253,/m/02v2lh,"New-age music"
256
+ 254,/m/0y4f8,"Vocal music"
257
+ 255,/m/0z9c,"A capella"
258
+ 256,/m/0164x2,"Music of Africa"
259
+ 257,/m/0145m,"Afrobeat"
260
+ 258,/m/02mscn,"Christian music"
261
+ 259,/m/016cjb,"Gospel music"
262
+ 260,/m/028sqc,"Music of Asia"
263
+ 261,/m/015vgc,"Carnatic music"
264
+ 262,/m/0dq0md,"Music of Bollywood"
265
+ 263,/m/06rqw,"Ska"
266
+ 264,/m/02p0sh1,"Traditional music"
267
+ 265,/m/05rwpb,"Independent music"
268
+ 266,/m/074ft,"Song"
269
+ 267,/m/025td0t,"Background music"
270
+ 268,/m/02cjck,"Theme music"
271
+ 269,/m/03r5q_,"Jingle (music)"
272
+ 270,/m/0l14gg,"Soundtrack music"
273
+ 271,/m/07pkxdp,"Lullaby"
274
+ 272,/m/01z7dr,"Video game music"
275
+ 273,/m/0140xf,"Christmas music"
276
+ 274,/m/0ggx5q,"Dance music"
277
+ 275,/m/04wptg,"Wedding music"
278
+ 276,/t/dd00031,"Happy music"
279
+ 277,/t/dd00032,"Funny music"
280
+ 278,/t/dd00033,"Sad music"
281
+ 279,/t/dd00034,"Tender music"
282
+ 280,/t/dd00035,"Exciting music"
283
+ 281,/t/dd00036,"Angry music"
284
+ 282,/t/dd00037,"Scary music"
285
+ 283,/m/03m9d0z,"Wind"
286
+ 284,/m/09t49,"Rustling leaves"
287
+ 285,/t/dd00092,"Wind noise (microphone)"
288
+ 286,/m/0jb2l,"Thunderstorm"
289
+ 287,/m/0ngt1,"Thunder"
290
+ 288,/m/0838f,"Water"
291
+ 289,/m/06mb1,"Rain"
292
+ 290,/m/07r10fb,"Raindrop"
293
+ 291,/t/dd00038,"Rain on surface"
294
+ 292,/m/0j6m2,"Stream"
295
+ 293,/m/0j2kx,"Waterfall"
296
+ 294,/m/05kq4,"Ocean"
297
+ 295,/m/034srq,"Waves, surf"
298
+ 296,/m/06wzb,"Steam"
299
+ 297,/m/07swgks,"Gurgling"
300
+ 298,/m/02_41,"Fire"
301
+ 299,/m/07pzfmf,"Crackle"
302
+ 300,/m/07yv9,"Vehicle"
303
+ 301,/m/019jd,"Boat, Water vehicle"
304
+ 302,/m/0hsrw,"Sailboat, sailing ship"
305
+ 303,/m/056ks2,"Rowboat, canoe, kayak"
306
+ 304,/m/02rlv9,"Motorboat, speedboat"
307
+ 305,/m/06q74,"Ship"
308
+ 306,/m/012f08,"Motor vehicle (road)"
309
+ 307,/m/0k4j,"Car"
310
+ 308,/m/0912c9,"Vehicle horn, car horn, honking"
311
+ 309,/m/07qv_d5,"Toot"
312
+ 310,/m/02mfyn,"Car alarm"
313
+ 311,/m/04gxbd,"Power windows, electric windows"
314
+ 312,/m/07rknqz,"Skidding"
315
+ 313,/m/0h9mv,"Tire squeal"
316
+ 314,/t/dd00134,"Car passing by"
317
+ 315,/m/0ltv,"Race car, auto racing"
318
+ 316,/m/07r04,"Truck"
319
+ 317,/m/0gvgw0,"Air brake"
320
+ 318,/m/05x_td,"Air horn, truck horn"
321
+ 319,/m/02rhddq,"Reversing beeps"
322
+ 320,/m/03cl9h,"Ice cream truck, ice cream van"
323
+ 321,/m/01bjv,"Bus"
324
+ 322,/m/03j1ly,"Emergency vehicle"
325
+ 323,/m/04qvtq,"Police car (siren)"
326
+ 324,/m/012n7d,"Ambulance (siren)"
327
+ 325,/m/012ndj,"Fire engine, fire truck (siren)"
328
+ 326,/m/04_sv,"Motorcycle"
329
+ 327,/m/0btp2,"Traffic noise, roadway noise"
330
+ 328,/m/06d_3,"Rail transport"
331
+ 329,/m/07jdr,"Train"
332
+ 330,/m/04zmvq,"Train whistle"
333
+ 331,/m/0284vy3,"Train horn"
334
+ 332,/m/01g50p,"Railroad car, train wagon"
335
+ 333,/t/dd00048,"Train wheels squealing"
336
+ 334,/m/0195fx,"Subway, metro, underground"
337
+ 335,/m/0k5j,"Aircraft"
338
+ 336,/m/014yck,"Aircraft engine"
339
+ 337,/m/04229,"Jet engine"
340
+ 338,/m/02l6bg,"Propeller, airscrew"
341
+ 339,/m/09ct_,"Helicopter"
342
+ 340,/m/0cmf2,"Fixed-wing aircraft, airplane"
343
+ 341,/m/0199g,"Bicycle"
344
+ 342,/m/06_fw,"Skateboard"
345
+ 343,/m/02mk9,"Engine"
346
+ 344,/t/dd00065,"Light engine (high frequency)"
347
+ 345,/m/08j51y,"Dental drill, dentist's drill"
348
+ 346,/m/01yg9g,"Lawn mower"
349
+ 347,/m/01j4z9,"Chainsaw"
350
+ 348,/t/dd00066,"Medium engine (mid frequency)"
351
+ 349,/t/dd00067,"Heavy engine (low frequency)"
352
+ 350,/m/01h82_,"Engine knocking"
353
+ 351,/t/dd00130,"Engine starting"
354
+ 352,/m/07pb8fc,"Idling"
355
+ 353,/m/07q2z82,"Accelerating, revving, vroom"
356
+ 354,/m/02dgv,"Door"
357
+ 355,/m/03wwcy,"Doorbell"
358
+ 356,/m/07r67yg,"Ding-dong"
359
+ 357,/m/02y_763,"Sliding door"
360
+ 358,/m/07rjzl8,"Slam"
361
+ 359,/m/07r4wb8,"Knock"
362
+ 360,/m/07qcpgn,"Tap"
363
+ 361,/m/07q6cd_,"Squeak"
364
+ 362,/m/0642b4,"Cupboard open or close"
365
+ 363,/m/0fqfqc,"Drawer open or close"
366
+ 364,/m/04brg2,"Dishes, pots, and pans"
367
+ 365,/m/023pjk,"Cutlery, silverware"
368
+ 366,/m/07pn_8q,"Chopping (food)"
369
+ 367,/m/0dxrf,"Frying (food)"
370
+ 368,/m/0fx9l,"Microwave oven"
371
+ 369,/m/02pjr4,"Blender"
372
+ 370,/m/02jz0l,"Water tap, faucet"
373
+ 371,/m/0130jx,"Sink (filling or washing)"
374
+ 372,/m/03dnzn,"Bathtub (filling or washing)"
375
+ 373,/m/03wvsk,"Hair dryer"
376
+ 374,/m/01jt3m,"Toilet flush"
377
+ 375,/m/012xff,"Toothbrush"
378
+ 376,/m/04fgwm,"Electric toothbrush"
379
+ 377,/m/0d31p,"Vacuum cleaner"
380
+ 378,/m/01s0vc,"Zipper (clothing)"
381
+ 379,/m/03v3yw,"Keys jangling"
382
+ 380,/m/0242l,"Coin (dropping)"
383
+ 381,/m/01lsmm,"Scissors"
384
+ 382,/m/02g901,"Electric shaver, electric razor"
385
+ 383,/m/05rj2,"Shuffling cards"
386
+ 384,/m/0316dw,"Typing"
387
+ 385,/m/0c2wf,"Typewriter"
388
+ 386,/m/01m2v,"Computer keyboard"
389
+ 387,/m/081rb,"Writing"
390
+ 388,/m/07pp_mv,"Alarm"
391
+ 389,/m/07cx4,"Telephone"
392
+ 390,/m/07pp8cl,"Telephone bell ringing"
393
+ 391,/m/01hnzm,"Ringtone"
394
+ 392,/m/02c8p,"Telephone dialing, DTMF"
395
+ 393,/m/015jpf,"Dial tone"
396
+ 394,/m/01z47d,"Busy signal"
397
+ 395,/m/046dlr,"Alarm clock"
398
+ 396,/m/03kmc9,"Siren"
399
+ 397,/m/0dgbq,"Civil defense siren"
400
+ 398,/m/030rvx,"Buzzer"
401
+ 399,/m/01y3hg,"Smoke detector, smoke alarm"
402
+ 400,/m/0c3f7m,"Fire alarm"
403
+ 401,/m/04fq5q,"Foghorn"
404
+ 402,/m/0l156k,"Whistle"
405
+ 403,/m/06hck5,"Steam whistle"
406
+ 404,/t/dd00077,"Mechanisms"
407
+ 405,/m/02bm9n,"Ratchet, pawl"
408
+ 406,/m/01x3z,"Clock"
409
+ 407,/m/07qjznt,"Tick"
410
+ 408,/m/07qjznl,"Tick-tock"
411
+ 409,/m/0l7xg,"Gears"
412
+ 410,/m/05zc1,"Pulleys"
413
+ 411,/m/0llzx,"Sewing machine"
414
+ 412,/m/02x984l,"Mechanical fan"
415
+ 413,/m/025wky1,"Air conditioning"
416
+ 414,/m/024dl,"Cash register"
417
+ 415,/m/01m4t,"Printer"
418
+ 416,/m/0dv5r,"Camera"
419
+ 417,/m/07bjf,"Single-lens reflex camera"
420
+ 418,/m/07k1x,"Tools"
421
+ 419,/m/03l9g,"Hammer"
422
+ 420,/m/03p19w,"Jackhammer"
423
+ 421,/m/01b82r,"Sawing"
424
+ 422,/m/02p01q,"Filing (rasp)"
425
+ 423,/m/023vsd,"Sanding"
426
+ 424,/m/0_ksk,"Power tool"
427
+ 425,/m/01d380,"Drill"
428
+ 426,/m/014zdl,"Explosion"
429
+ 427,/m/032s66,"Gunshot, gunfire"
430
+ 428,/m/04zjc,"Machine gun"
431
+ 429,/m/02z32qm,"Fusillade"
432
+ 430,/m/0_1c,"Artillery fire"
433
+ 431,/m/073cg4,"Cap gun"
434
+ 432,/m/0g6b5,"Fireworks"
435
+ 433,/g/122z_qxw,"Firecracker"
436
+ 434,/m/07qsvvw,"Burst, pop"
437
+ 435,/m/07pxg6y,"Eruption"
438
+ 436,/m/07qqyl4,"Boom"
439
+ 437,/m/083vt,"Wood"
440
+ 438,/m/07pczhz,"Chop"
441
+ 439,/m/07pl1bw,"Splinter"
442
+ 440,/m/07qs1cx,"Crack"
443
+ 441,/m/039jq,"Glass"
444
+ 442,/m/07q7njn,"Chink, clink"
445
+ 443,/m/07rn7sz,"Shatter"
446
+ 444,/m/04k94,"Liquid"
447
+ 445,/m/07rrlb6,"Splash, splatter"
448
+ 446,/m/07p6mqd,"Slosh"
449
+ 447,/m/07qlwh6,"Squish"
450
+ 448,/m/07r5v4s,"Drip"
451
+ 449,/m/07prgkl,"Pour"
452
+ 450,/m/07pqc89,"Trickle, dribble"
453
+ 451,/t/dd00088,"Gush"
454
+ 452,/m/07p7b8y,"Fill (with liquid)"
455
+ 453,/m/07qlf79,"Spray"
456
+ 454,/m/07ptzwd,"Pump (liquid)"
457
+ 455,/m/07ptfmf,"Stir"
458
+ 456,/m/0dv3j,"Boiling"
459
+ 457,/m/0790c,"Sonar"
460
+ 458,/m/0dl83,"Arrow"
461
+ 459,/m/07rqsjt,"Whoosh, swoosh, swish"
462
+ 460,/m/07qnq_y,"Thump, thud"
463
+ 461,/m/07rrh0c,"Thunk"
464
+ 462,/m/0b_fwt,"Electronic tuner"
465
+ 463,/m/02rr_,"Effects unit"
466
+ 464,/m/07m2kt,"Chorus effect"
467
+ 465,/m/018w8,"Basketball bounce"
468
+ 466,/m/07pws3f,"Bang"
469
+ 467,/m/07ryjzk,"Slap, smack"
470
+ 468,/m/07rdhzs,"Whack, thwack"
471
+ 469,/m/07pjjrj,"Smash, crash"
472
+ 470,/m/07pc8lb,"Breaking"
473
+ 471,/m/07pqn27,"Bouncing"
474
+ 472,/m/07rbp7_,"Whip"
475
+ 473,/m/07pyf11,"Flap"
476
+ 474,/m/07qb_dv,"Scratch"
477
+ 475,/m/07qv4k0,"Scrape"
478
+ 476,/m/07pdjhy,"Rub"
479
+ 477,/m/07s8j8t,"Roll"
480
+ 478,/m/07plct2,"Crushing"
481
+ 479,/t/dd00112,"Crumpling, crinkling"
482
+ 480,/m/07qcx4z,"Tearing"
483
+ 481,/m/02fs_r,"Beep, bleep"
484
+ 482,/m/07qwdck,"Ping"
485
+ 483,/m/07phxs1,"Ding"
486
+ 484,/m/07rv4dm,"Clang"
487
+ 485,/m/07s02z0,"Squeal"
488
+ 486,/m/07qh7jl,"Creak"
489
+ 487,/m/07qwyj0,"Rustle"
490
+ 488,/m/07s34ls,"Whir"
491
+ 489,/m/07qmpdm,"Clatter"
492
+ 490,/m/07p9k1k,"Sizzle"
493
+ 491,/m/07qc9xj,"Clicking"
494
+ 492,/m/07rwm0c,"Clickety-clack"
495
+ 493,/m/07phhsh,"Rumble"
496
+ 494,/m/07qyrcz,"Plop"
497
+ 495,/m/07qfgpx,"Jingle, tinkle"
498
+ 496,/m/07rcgpl,"Hum"
499
+ 497,/m/07p78v5,"Zing"
500
+ 498,/t/dd00121,"Boing"
501
+ 499,/m/07s12q4,"Crunch"
502
+ 500,/m/028v0c,"Silence"
503
+ 501,/m/01v_m0,"Sine wave"
504
+ 502,/m/0b9m1,"Harmonic"
505
+ 503,/m/0hdsk,"Chirp tone"
506
+ 504,/m/0c1dj,"Sound effect"
507
+ 505,/m/07pt_g0,"Pulse"
508
+ 506,/t/dd00125,"Inside, small room"
509
+ 507,/t/dd00126,"Inside, large room or hall"
510
+ 508,/t/dd00127,"Inside, public space"
511
+ 509,/t/dd00128,"Outside, urban or manmade"
512
+ 510,/t/dd00129,"Outside, rural or natural"
513
+ 511,/m/01b9nn,"Reverberation"
514
+ 512,/m/01jnbd,"Echo"
515
+ 513,/m/096m7z,"Noise"
516
+ 514,/m/06_y0by,"Environmental noise"
517
+ 515,/m/07rgkc5,"Static"
518
+ 516,/m/06xkwv,"Mains hum"
519
+ 517,/m/0g12c5,"Distortion"
520
+ 518,/m/08p9q4,"Sidetone"
521
+ 519,/m/07szfh9,"Cacophony"
522
+ 520,/m/0chx_,"White noise"
523
+ 521,/m/0cj0r,"Pink noise"
524
+ 522,/m/07p_0gm,"Throbbing"
525
+ 523,/m/01jwx6,"Vibration"
526
+ 524,/m/07c52,"Television"
527
+ 525,/m/06bz3,"Radio"
528
+ 526,/m/07hvw1,"Field recording"
data/drop_lists/manual_non_scene_frames.csv ADDED
@@ -0,0 +1,432 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ view_id,dataset,reason,file
2
+ view_d4f746529c1b65cdf8e4,yfcc100m_street,pure_sky,yfcc_2422764772_000_frame00.jpg
3
+ view_06c01880d7d06f3d9321,yfcc100m_street,pure_sky,yfcc_2422764772_001_frame05.jpg
4
+ view_c4253ece40cc7e988385,yfcc100m_street,pure_sky,yfcc_2521985849_000_frame09.jpg
5
+ view_013d826f642bce042529,yfcc100m_street,pure_sky,yfcc_2610868528_001_frame00.jpg
6
+ view_ab256f55c03210887b4f,yfcc100m_street,pure_sky,yfcc_2610868528_003_frame04.jpg
7
+ view_21a33db9791b4d4f252f,yfcc100m_street,pure_sky,yfcc_2610868528_004_frame04.jpg
8
+ view_e887e88cd3d694e64d9a,yfcc100m_street,pure_sky,yfcc_2610868528_006_frame03.jpg
9
+ view_94f7771f97c187a0313b,yfcc100m_street,pure_sky,yfcc_2933619835_001_frame08.jpg
10
+ view_436cb0ce70b69aa33977,yfcc100m_street,pure_sky,yfcc_2933619835_003_frame07.jpg
11
+ view_1b8e488b5faf0e995cb2,yfcc100m_street,pure_sky,yfcc_2933619835_004_frame05.jpg
12
+ view_dace373a952bec4bb006,yfcc100m_street,pure_sky,yfcc_2933619835_006_frame04.jpg
13
+ view_c68aeff3eb1e978160c5,yfcc100m_street,pure_sky,yfcc_2976639776_000_frame06.jpg
14
+ view_d01ca4c70b58650d6971,yfcc100m_street,pure_sky,yfcc_2976639776_002_frame05.jpg
15
+ view_c96e53e1905bbb961efc,yfcc100m_street,pure_sky,yfcc_2976639776_004_frame03.jpg
16
+ view_140e046ee12e71c7a73e,yfcc100m_street,pure_sky,yfcc_3274446526_001_frame07.jpg
17
+ view_54b507c5a2e891c79241,yfcc100m_street,pure_sky,yfcc_3274446526_003_frame05.jpg
18
+ view_4638c426e83702c0f5d9,yfcc100m_street,pure_sky,yfcc_3274446526_004_frame08.jpg
19
+ view_7da934230be5b0d0e66d,yfcc100m_street,pure_sky,yfcc_3274446526_006_frame03.jpg
20
+ view_a7bc0a0deb761014d513,yfcc100m_street,pure_sky,yfcc_3384407574_000_frame09.jpg
21
+ view_53e5624bce67054dc415,yfcc100m_street,pure_sky,yfcc_3384407574_001_frame05.jpg
22
+ view_d644c4bac668def10e38,yfcc100m_street,indoor,yfcc_3514307332_000_frame06.jpg
23
+ view_c7016d7e6052e1a74cd0,yfcc100m_street,indoor,yfcc_3514307332_001_frame02.jpg
24
+ view_0a0366f88fbe6aaef95d,yfcc100m_street,indoor,yfcc_3514307332_002_frame00.jpg
25
+ view_3c023a9ded95d2d40d3d,yfcc100m_street,indoor,yfcc_3608980102_000_frame00.jpg
26
+ view_d7310283c1b94cc9aee7,yfcc100m_street,indoor,yfcc_4217862405_000_frame01.jpg
27
+ view_440769f572bbcb889edd,yfcc100m_street,pure_sky,yfcc_4247502023_001_frame09.jpg
28
+ view_b6edb02d5e46dff857e1,yfcc100m_street,pure_sky,yfcc_4247502023_002_frame08.jpg
29
+ view_90b42cddb94db75fcbae,yfcc100m_street,pure_sky,yfcc_4247502023_003_frame09.jpg
30
+ view_e85a7282d5700fc87620,yfcc100m_street,pure_sky,yfcc_4247502023_004_frame04.jpg
31
+ view_c1929c4bd15a0faa305a,yfcc100m_street,pure_sky,yfcc_4262477613_000_frame00.jpg
32
+ view_1cad5563dbc951b86210,yfcc100m_street,pure_sky,yfcc_4262477613_001_frame01.jpg
33
+ view_e0ca8d2bb638dc693681,yfcc100m_street,pure_sky,yfcc_4452537914_000_frame05.jpg
34
+ view_ba50b4b7ee164cee5794,yfcc100m_street,pure_sky,yfcc_4488919566_000_frame05.jpg
35
+ view_d17513aed4b27e3bb7aa,yfcc100m_street,pure_sky,yfcc_4488919566_001_frame07.jpg
36
+ view_99c640c6e3f28791931f,yfcc100m_street,pure_sky,yfcc_4488919566_002_frame03.jpg
37
+ view_3005b4ec0fd677d993ee,yfcc100m_street,pure_sky,yfcc_4537419189_001_frame08.jpg
38
+ view_ba9aefb431718607916c,yfcc100m_street,pure_sky,yfcc_4537419189_002_frame00.jpg
39
+ view_876e1bb59651f28a72d4,yfcc100m_street,pure_sky,yfcc_4537419189_003_frame08.jpg
40
+ view_b5af49bc78a2b4d62b5b,yfcc100m_street,pure_sky,yfcc_4537419189_004_frame08.jpg
41
+ view_8e4b274f538f618f0004,yfcc100m_street,pure_sky,yfcc_4617891254_000_frame02.jpg
42
+ view_bfa1e56309219b4d229f,yfcc100m_street,indoor,yfcc_4732727164_001_frame00.jpg
43
+ view_b0abe3a42a91e9badcbf,yfcc100m_street,indoor,yfcc_4732727164_002_frame02.jpg
44
+ view_68c994dc23a3718592c8,yfcc100m_street,indoor,yfcc_4732727164_004_frame01.jpg
45
+ view_cbb2a4befbce421303ed,yfcc100m_street,indoor,yfcc_4732727164_005_frame00.jpg
46
+ view_2028b1be84b541337d34,yfcc100m_street,indoor,yfcc_4766455625_000_frame00.jpg
47
+ view_8801c962273949b18c95,yfcc100m_street,indoor,yfcc_4766455625_001_frame01.jpg
48
+ view_8173c74aff3a76a0e39d,yfcc100m_street,indoor,yfcc_4766455625_003_frame02.jpg
49
+ view_79a0a1bd1de12197e1e9,yfcc100m_street,pure_sky,yfcc_4807545103_000_frame06.jpg
50
+ view_668e3a95842fbb373eb7,yfcc100m_street,pure_sky,yfcc_4817412866_000_frame06.jpg
51
+ view_fa452081221797e89663,yfcc100m_street,pure_sky,yfcc_4817412866_001_frame09.jpg
52
+ view_4467a3c20fcc0c2768c4,yfcc100m_street,pure_sky,yfcc_4817412866_002_frame01.jpg
53
+ view_070af312f2dba03e4535,yfcc100m_street,pure_sky,yfcc_4817412866_003_frame05.jpg
54
+ view_6e89a1630fd03f8e3d00,yfcc100m_street,pure_sky,yfcc_5223022932_000_frame05.jpg
55
+ view_1005d9563bc7deb1888f,yfcc100m_street,pure_sky,yfcc_5223022932_001_frame05.jpg
56
+ view_82820d5ac9b44f4c9165,yfcc100m_street,pure_sky,yfcc_5302305430_001_frame00.jpg
57
+ view_61218675b3884d0f6bdc,yfcc100m_street,pure_sky,yfcc_5302305430_002_frame04.jpg
58
+ view_79e00dfe83cf7c038676,yfcc100m_street,pure_sky,yfcc_5302305430_003_frame00.jpg
59
+ view_a4b0377592087567637e,yfcc100m_street,indoor,yfcc_5494263693_000_frame07.jpg
60
+ view_9ac92a0e3353544f4a61,yfcc100m_street,indoor,yfcc_5494263693_001_frame03.jpg
61
+ view_c8f154cbeb6b40452133,yfcc100m_street,indoor,yfcc_5629138179_000_frame02.jpg
62
+ view_d1af7634fad26ef2f961,yfcc100m_street,indoor,yfcc_5629138179_001_frame01.jpg
63
+ view_52a57ef80d4fda7805a6,yfcc100m_street,pure_sky,yfcc_5916272981_001_frame00.jpg
64
+ view_9b20408567748f328fff,yfcc100m_street,pure_sky,yfcc_5916272981_002_frame09.jpg
65
+ view_94a7d0f043b5d2db1191,yfcc100m_street,pure_sky,yfcc_5916272981_004_frame00.jpg
66
+ view_4bf7c4871c7875899aaf,yfcc100m_street,pure_sky,yfcc_5916272981_005_frame03.jpg
67
+ view_cbe98c3c686cf9c8b3a7,yfcc100m_street,pure_sky,yfcc_6043815805_000_frame02.jpg
68
+ view_fc477301c12a441de03d,yfcc100m_street,pure_sky,yfcc_6043815805_001_frame04.jpg
69
+ view_1548976d2d3ceb7f1232,yfcc100m_street,pure_sky,yfcc_6308553647_004_frame00.jpg
70
+ view_5a6c470c85e1459631e3,yfcc100m_street,pure_sky,yfcc_6404818777_000_frame00.jpg
71
+ view_fb6cc945aa95c05af6c1,yfcc100m_street,pure_sky,yfcc_6404818777_001_frame07.jpg
72
+ view_93be219767a92a2c7e69,yfcc100m_street,pure_sky,yfcc_6404818777_002_frame04.jpg
73
+ view_85b713439ceda86b9e5d,yfcc100m_street,pure_sky,yfcc_6897680924_002_frame06.jpg
74
+ view_d7fe30b1692dddb034d2,yfcc100m_street,pure_sky,yfcc_6897680924_003_frame02.jpg
75
+ view_4560adbb12773b5cff25,yfcc100m_street,pure_sky,yfcc_6897680924_005_frame00.jpg
76
+ view_9eeac4daec3268e05208,yfcc100m_street,pure_sky,yfcc_6897680924_006_frame06.jpg
77
+ view_0305261e7a9c67710b27,yfcc100m_street,pure_sky,yfcc_6985803302_000_frame08.jpg
78
+ view_2619225e280c8179610e,yfcc100m_street,pure_sky,yfcc_6985803302_001_frame00.jpg
79
+ view_babdf22ff57b064f9d96,yfcc100m_street,pure_sky,yfcc_7057952693_000_frame00.jpg
80
+ view_5dcbcdd3f61306731480,yfcc100m_street,pure_sky,yfcc_7468935342_000_frame00.jpg
81
+ view_aea2a69a2334accd62f3,yfcc100m_street,pure_sky,yfcc_7468935342_001_frame07.jpg
82
+ view_3d991f2f279e819ee5b1,yfcc100m_street,pure_sky,yfcc_7643557946_000_frame09.jpg
83
+ view_aab9868e6400c2c04e31,yfcc100m_street,pure_sky,yfcc_7643557946_001_frame04.jpg
84
+ view_308fea0c528cffe9848f,yfcc100m_street,pure_sky,yfcc_7643557946_002_frame01.jpg
85
+ view_f7e86a7948d553a8db16,yfcc100m_street,indoor,yfcc_8115709314_000_frame03.jpg
86
+ view_313de5a3f0602daebdff,yfcc100m_street,indoor,yfcc_8115709314_001_frame09.jpg
87
+ view_9acfad30487fdc915b54,yfcc100m_street,indoor,yfcc_8115709314_002_frame02.jpg
88
+ view_2f3248a95ce30ec4562a,yfcc100m_street,pure_sky,yfcc_8129276144_000_frame01.jpg
89
+ view_31e2bce4bebb781eac78,yfcc100m_street,pure_sky,yfcc_8206864042_000_frame05.jpg
90
+ view_65794d1a890589b0f97a,yfcc100m_street,pure_sky,yfcc_8206864042_003_frame02.jpg
91
+ view_1cf6c47bd1b4b8cf6341,yfcc100m_street,pure_sky,yfcc_8206864042_006_frame02.jpg
92
+ view_141c05fdecacb70bcf97,yfcc100m_street,pure_sky,yfcc_8223946245_001_frame03.jpg
93
+ view_25de77aa443c22d81e0a,yfcc100m_street,pure_sky,yfcc_8223946245_002_frame04.jpg
94
+ view_a16c171af323b93eb463,yfcc100m_street,pure_sky,yfcc_8223946245_003_frame00.jpg
95
+ view_12da950eb1221eda9254,yfcc100m_street,pure_sky,yfcc_8223946245_004_frame05.jpg
96
+ view_05c01961f223a896cd99,yfcc100m_street,pure_sky,yfcc_8427780471_000_frame06.jpg
97
+ view_1627975a100527b49577,yfcc100m_street,pure_sky,yfcc_8427780471_001_frame00.jpg
98
+ view_6e172e8cb2824b69b149,yfcc100m_street,pure_sky,yfcc_8444829479_000_frame02.jpg
99
+ view_a3cbdb4cc7da0ab4893e,yfcc100m_street,pure_sky,yfcc_8444829479_001_frame01.jpg
100
+ view_493e820c8996d615c4b3,yfcc100m_street,pure_sky,yfcc_8447053666_000_frame02.jpg
101
+ view_744c94c09cbe9fff8aca,yfcc100m_street,pure_sky,yfcc_8447053666_001_frame01.jpg
102
+ view_b7136ce9b08f0f1fca4d,yfcc100m_street,pure_sky,yfcc_8447053666_003_frame04.jpg
103
+ view_337679c5350aa5a147af,yfcc100m_street,pure_sky,yfcc_8460673354_000_frame04.jpg
104
+ view_a897597d508fce2d5070,yfcc100m_street,pure_sky,yfcc_8460673354_001_frame03.jpg
105
+ view_db3fa5722c90669402ec,yfcc100m_street,pure_sky,yfcc_8460673354_002_frame04.jpg
106
+ view_5be11dbbab87708abcf1,yfcc100m_street,pure_sky,yfcc_8487394285_000_frame06.jpg
107
+ view_412eed958df18fc20e88,yfcc100m_street,pure_sky,yfcc_9568942324_000_frame08.jpg
108
+ view_6f34c5f33c2f232eeed8,yfcc100m_street,pure_sky,yfcc_9568942324_002_frame09.jpg
109
+ view_dd8025b97aa69df32b10,yfcc100m_street,pure_sky,yfcc_9568942324_004_frame08.jpg
110
+ view_896f58601e4624d44a72,yfcc100m_street,indoor,yfcc_9611752550_000_frame01.jpg
111
+ view_0f1f81c32407455548a0,yfcc100m_street,pure_sky,yfcc_12630838484_001_frame03.jpg
112
+ view_96a2f9aa6016e65542be,yfcc100m_street,pure_sky,yfcc_12630838484_002_frame01.jpg
113
+ view_998f735aad67285fde07,yfcc100m_street,pure_sky,yfcc_12630838484_004_frame01.jpg
114
+ view_aeda079944a925672359,yfcc100m_street,pure_sky,yfcc_12630838484_005_frame09.jpg
115
+ view_236aea8e9a592e1739fb,yfcc100m_street,indoor,yfcc_2553183011_000_frame07.jpg
116
+ view_5422d5aa7fd1d900c88d,yfcc100m_street,indoor,yfcc_2553183011_001_frame00.jpg
117
+ view_01afb32bcf6798aeb57e,360x_outdoor,too_dark,02692940-fd94-4af1-8ebc-577acacc617a_0005_yaw000.jpg
118
+ view_6866b4bec444555339fc,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0003_yaw000.jpg
119
+ view_f245abdff9a3a3e05f26,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0003_yaw090.jpg
120
+ view_39008b0c3ff5a23c7aee,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0003_yaw180.jpg
121
+ view_3cbe6fd8d7fabd377f8b,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0003_yaw270.jpg
122
+ view_1213f32a1df4eb901431,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0009_yaw000.jpg
123
+ view_624e18fbd0f3a8da3134,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0009_yaw090.jpg
124
+ view_47e02f2788285d8ce64d,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0009_yaw180.jpg
125
+ view_e04ddcb169a0103f7de3,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0009_yaw270.jpg
126
+ view_c536efbe33df68316048,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0015_yaw000.jpg
127
+ view_47d8eb7169cec6d290fc,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0015_yaw090.jpg
128
+ view_6176a6482b5568313250,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0015_yaw180.jpg
129
+ view_d9e72c39c5d8069b1f03,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0015_yaw270.jpg
130
+ view_8664518783b01a10be6c,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0020_yaw000.jpg
131
+ view_fc6084e70652e19320a6,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0020_yaw090.jpg
132
+ view_35e39281db2c063e15f9,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0020_yaw180.jpg
133
+ view_822f74f441820c28b272,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0020_yaw270.jpg
134
+ view_ebe64025659ae3c91574,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0026_yaw000.jpg
135
+ view_fbc3d20d79e474092829,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0026_yaw090.jpg
136
+ view_203154cfc7d7ab15f1f6,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0026_yaw180.jpg
137
+ view_d9fdf55184a3deb6fa52,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0026_yaw270.jpg
138
+ view_7113c9985ed2450e9a6a,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0032_yaw000.jpg
139
+ view_89ca64afd427cb9e8bcb,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0032_yaw090.jpg
140
+ view_3239337f7260e8ab8f80,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0032_yaw180.jpg
141
+ view_26690777ad7902c364c6,360x_outdoor,too_dark,32af32f0-55dc-4875-9bf6-57fc7621787c_0032_yaw270.jpg
142
+ view_b237cfe61e572a190707,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0003_yaw000.jpg
143
+ view_0cb460763c526c3b5c23,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0003_yaw090.jpg
144
+ view_3856ede24e00dd682bf9,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0003_yaw180.jpg
145
+ view_9ad30995dc4d9bf9625c,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0003_yaw270.jpg
146
+ view_90150cc36783488ead71,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0009_yaw000.jpg
147
+ view_d87c7620c9c487af5355,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0009_yaw090.jpg
148
+ view_f34901418fd6c8340646,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0009_yaw180.jpg
149
+ view_84be76180c6905c7313c,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0009_yaw270.jpg
150
+ view_ecc49dd568f0f182f879,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0015_yaw000.jpg
151
+ view_4cf2dbf9736483dc2c6e,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0015_yaw090.jpg
152
+ view_4d40fa7f70dc0369e739,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0015_yaw270.jpg
153
+ view_8a8d3655b93b161e8ea1,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0022_yaw000.jpg
154
+ view_9beecf6460d4d98cd55b,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0022_yaw090.jpg
155
+ view_be4d85f7b4ab320cd4cd,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0022_yaw270.jpg
156
+ view_6b5580e0f2a24559e5e5,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0028_yaw000.jpg
157
+ view_6625003707101872bfb4,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0028_yaw090.jpg
158
+ view_cf0d84a8d049cd9b601e,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0028_yaw180.jpg
159
+ view_c44a9774b7f00a3be9c0,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0028_yaw270.jpg
160
+ view_4d9eb3b97ce34750d3a2,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0034_yaw000.jpg
161
+ view_76553aec308c148ad19d,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0034_yaw090.jpg
162
+ view_55382988d7cc6e44f8bd,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0034_yaw180.jpg
163
+ view_6e5faf16fa1da9031efb,360x_outdoor,too_dark,39311111-417c-4c7f-b96e-8f0ae5f8a393_0034_yaw270.jpg
164
+ view_5de2e10cc3e82e80266d,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0002_yaw180.jpg
165
+ view_56a82a1f3813f176b84d,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0002_yaw270.jpg
166
+ view_33384bc06d5bf484ab52,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0005_yaw000.jpg
167
+ view_ba4ec2cac679781c496a,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0005_yaw180.jpg
168
+ view_cfab6dc5fb7aff0b2ab6,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0005_yaw270.jpg
169
+ view_41ff73e322bcfd6194da,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0008_yaw000.jpg
170
+ view_7730a8fdbe6fbd73bcc9,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0008_yaw180.jpg
171
+ view_e4ccd17259e87ab4e4e9,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0008_yaw270.jpg
172
+ view_9fee8202bde2732c04a8,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0012_yaw000.jpg
173
+ view_a5d1d2ce7e19d8e69ec2,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0012_yaw180.jpg
174
+ view_e8b07cfa9176e5d704d8,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0012_yaw270.jpg
175
+ view_1fe1e6a40f8d1985da7b,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0015_yaw180.jpg
176
+ view_b66ce2d95e588c33b2d6,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0015_yaw270.jpg
177
+ view_c2bc586844949fadc4eb,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0018_yaw180.jpg
178
+ view_ef7b5f86216c5fd311a9,360x_outdoor,too_dark,3af3e0a7-4f80-4f7d-9f56-aad9381bc42c_0018_yaw270.jpg
179
+ view_7d3b4cac75b3613ea68e,360x_outdoor,too_dark,4792eed5-4090-4dd5-bd36-5ba9064b2897_0022_yaw180.jpg
180
+ view_05d6b4aa8d16b80537a5,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0003_yaw000.jpg
181
+ view_bded10ce025cfc410233,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0008_yaw090.jpg
182
+ view_4e50062e613a14d48467,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0008_yaw180.jpg
183
+ view_262ef9c9e401f2b1a316,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0008_yaw270.jpg
184
+ view_b7e37c299170f25632e5,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0013_yaw000.jpg
185
+ view_d7de8fe184c3810ab77d,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0013_yaw090.jpg
186
+ view_8a6872227a8b5885d7fc,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0013_yaw180.jpg
187
+ view_7031b7ac84b0e95d1c4e,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0013_yaw270.jpg
188
+ view_98a6619c91fb4db157b1,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0018_yaw000.jpg
189
+ view_e066d060007a39221fa2,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0018_yaw090.jpg
190
+ view_e6bf9fd4c1cee38920a0,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0018_yaw180.jpg
191
+ view_92a1f0247842b0b66b4a,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0018_yaw270.jpg
192
+ view_57ea784ab216e4348759,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0023_yaw000.jpg
193
+ view_8d8fe48046df1b7e358e,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0023_yaw090.jpg
194
+ view_a266958dab700cb3115f,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0023_yaw180.jpg
195
+ view_a88a94aacd2b55b4e5f3,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0023_yaw270.jpg
196
+ view_4ecf66cb1b94bb72581e,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0028_yaw000.jpg
197
+ view_0170b37153e2f32074e4,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0028_yaw090.jpg
198
+ view_b60f4879040bf7cb15ff,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0028_yaw180.jpg
199
+ view_1796a93a8c143fcbb912,360x_outdoor,too_dark,47f51bd8-b655-4ae2-a1c3-0ce0c5b1748c_0028_yaw270.jpg
200
+ view_a0e0725dca32349c753c,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0003_yaw090.jpg
201
+ view_86beb898fae1ce17150a,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0003_yaw180.jpg
202
+ view_150c412abb4fd9b4adac,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0003_yaw270.jpg
203
+ view_0f452e352fca52b9a802,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0009_yaw090.jpg
204
+ view_eb2c5973f22f7cb818fe,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0009_yaw180.jpg
205
+ view_0b7f26617a46386c9391,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0009_yaw270.jpg
206
+ view_843c5551b3b2069a3e0c,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0015_yaw090.jpg
207
+ view_274b1461b7620621c4fc,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0015_yaw180.jpg
208
+ view_686eec47ce5d16522b61,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0015_yaw270.jpg
209
+ view_6324a3244f8c4986a01e,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0020_yaw090.jpg
210
+ view_f126565231746aae75e1,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0020_yaw180.jpg
211
+ view_68b9f2a100de6912e52b,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0020_yaw270.jpg
212
+ view_fd9544c26c2bd178c6f2,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0026_yaw090.jpg
213
+ view_7daf0de73e9b781ffc31,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0026_yaw180.jpg
214
+ view_a7047cd8e2d100f1e6ad,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0026_yaw270.jpg
215
+ view_33afe38ee40b92415faa,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0032_yaw090.jpg
216
+ view_bf9d3152d5db3166902f,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0032_yaw180.jpg
217
+ view_f622cfe1909a89ad4586,360x_outdoor,too_dark,91901e40-5f67-461a-aab9-110ab46970ea_0032_yaw270.jpg
218
+ view_b4e0875c4a154aa0a03f,360x_outdoor,too_dark,9e961559-5a0b-4fd8-b7e3-68a7892eda7a_0002_yaw000.jpg
219
+ view_c9c22732abb975f02965,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0002_yaw000.jpg
220
+ view_50f9119aa2a56aa7f74b,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0002_yaw180.jpg
221
+ view_9a37c33f91ef067a2a7e,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0002_yaw270.jpg
222
+ view_562816ac1d5e7698bd85,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0008_yaw000.jpg
223
+ view_d70ae414182baa2f0851,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0008_yaw180.jpg
224
+ view_a7799d691106fb9cc965,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0008_yaw270.jpg
225
+ view_670fdc974c5a8aaa5ae8,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0012_yaw000.jpg
226
+ view_d0f5ee948927f0ea89bc,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0012_yaw180.jpg
227
+ view_25277209a52635157b94,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0012_yaw270.jpg
228
+ view_489c5127b0cc4194e74a,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0018_yaw000.jpg
229
+ view_2be0c61e0dcc1037a990,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0018_yaw180.jpg
230
+ view_1a38f7eaabed6f43d510,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0018_yaw270.jpg
231
+ view_331f501c58aa8d52d5c9,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0022_yaw000.jpg
232
+ view_c886e9875155a4bee9ef,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0022_yaw180.jpg
233
+ view_0575af9ba5c67d7c3641,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0022_yaw270.jpg
234
+ view_84f1250ecff1b3e7c302,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0028_yaw000.jpg
235
+ view_195b5eb81836067a9a43,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0028_yaw180.jpg
236
+ view_e343a02207dcdd125bbb,360x_outdoor,too_dark,a9fdfbf2-144c-4173-9308-1ea549a48b4e_0028_yaw270.jpg
237
+ view_3328801a228871e6f70d,360x_outdoor,too_dark,bce0ab50-aa52-42eb-9dbd-69eee35e985b_0003_yaw180.jpg
238
+ view_d31c74c287bad3550d4b,360x_outdoor,too_dark,bce0ab50-aa52-42eb-9dbd-69eee35e985b_0003_yaw270.jpg
239
+ view_924045f70d7246510aea,360x_outdoor,too_dark,bce0ab50-aa52-42eb-9dbd-69eee35e985b_0014_yaw180.jpg
240
+ view_f98784e05dd93c8dc4c2,360x_outdoor,too_dark,bce0ab50-aa52-42eb-9dbd-69eee35e985b_0014_yaw270.jpg
241
+ view_91c14118507b55a81232,360x_outdoor,too_dark,bce0ab50-aa52-42eb-9dbd-69eee35e985b_0020_yaw270.jpg
242
+ view_2a5a4e28401b1391ad12,360x_outdoor,too_dark,bce0ab50-aa52-42eb-9dbd-69eee35e985b_0026_yaw180.jpg
243
+ view_f465b938eeacbef991be,360x_outdoor,too_dark,bce0ab50-aa52-42eb-9dbd-69eee35e985b_0026_yaw270.jpg
244
+ view_4e1885f8711909ac98aa,360x_outdoor,too_dark,bce0ab50-aa52-42eb-9dbd-69eee35e985b_0031_yaw180.jpg
245
+ view_813e084cc6b44717f35f,360x_outdoor,too_dark,bce0ab50-aa52-42eb-9dbd-69eee35e985b_0031_yaw270.jpg
246
+ view_572ae3422fbd82429539,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0005_yaw270.jpg
247
+ view_ea576a349c661ef5cfd7,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0014_yaw000.jpg
248
+ view_8f925df61b96bc67ee4a,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0014_yaw270.jpg
249
+ view_941f87fc37da33cff684,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0032_yaw180.jpg
250
+ view_df25c03581b7885c362a,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0032_yaw270.jpg
251
+ view_0f46cd2e30048c94a710,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0041_yaw000.jpg
252
+ view_f37fe9bba302135ba88f,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0041_yaw180.jpg
253
+ view_3f3243f9111590f606e6,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0041_yaw270.jpg
254
+ view_192d7b30ea4173535031,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0050_yaw000.jpg
255
+ view_9aba5c5b01200da2b291,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0050_yaw090.jpg
256
+ view_24bcbe713473ef1ef430,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0050_yaw180.jpg
257
+ view_99e917089317876636c1,360x_outdoor,too_dark,cb9a173c-859b-4ac1-9b30-3c099309c076_0050_yaw270.jpg
258
+ view_b151f3657015a2e5577e,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0003_yaw000.jpg
259
+ view_d3154f83893de785630a,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0003_yaw090.jpg
260
+ view_45294ae60183b8ea17df,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0003_yaw180.jpg
261
+ view_a91c1a75a521845fc086,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0003_yaw270.jpg
262
+ view_4cd401470205de067322,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0008_yaw000.jpg
263
+ view_44bfa368fd3f3b543e66,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0008_yaw090.jpg
264
+ view_3c60b0d4b63b03ac1b22,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0008_yaw180.jpg
265
+ view_b9fe253128de018cb35b,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0008_yaw270.jpg
266
+ view_0859f97c1077450ea31e,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0013_yaw000.jpg
267
+ view_96fff65d72476d7aeff6,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0013_yaw090.jpg
268
+ view_85c3d9e5b600a3e61696,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0013_yaw180.jpg
269
+ view_741db0d527314b334944,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0013_yaw270.jpg
270
+ view_16beac626f806eedfe9a,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0018_yaw000.jpg
271
+ view_431f732aef4f69cb8f58,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0018_yaw090.jpg
272
+ view_6dc12c8640de049842f5,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0018_yaw180.jpg
273
+ view_1aff8956d051a835fec8,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0018_yaw270.jpg
274
+ view_9a4cbf6705e5c271b4fb,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0023_yaw000.jpg
275
+ view_74d3ef9ee3caa5c5e645,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0023_yaw090.jpg
276
+ view_8a780b1e74b369eaa070,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0023_yaw180.jpg
277
+ view_9f06260efcf8b671cdfa,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0023_yaw270.jpg
278
+ view_171a1028842c0901d0d3,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0028_yaw000.jpg
279
+ view_7082f5a2204b108af393,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0028_yaw090.jpg
280
+ view_cf5b95ea6b0e23effbda,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0028_yaw180.jpg
281
+ view_5d1965a37827fa42023d,360x_outdoor,too_dark,d7bcd8d5-755e-4de1-9782-7ae8d030a0d9_0028_yaw270.jpg
282
+ view_af6b5ccc6e114b2cf452,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0004_yaw090.jpg
283
+ view_095031649ecf67ebd8ba,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0004_yaw180.jpg
284
+ view_922877596fceffa3494b,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0012_yaw090.jpg
285
+ view_cb7e091001cbfcfed73c,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0012_yaw180.jpg
286
+ view_63806e02dc965e8021a8,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0020_yaw090.jpg
287
+ view_8e1c00e9b37d09aedfd8,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0020_yaw180.jpg
288
+ view_96db8bc6e553ffe1d9aa,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0029_yaw090.jpg
289
+ view_056f4b7d3101be249f6b,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0029_yaw180.jpg
290
+ view_b8b774d93231ef2be6e6,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0037_yaw090.jpg
291
+ view_91b9d11ef536f651c6e7,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0037_yaw180.jpg
292
+ view_ef88381ca19c7a2a5002,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0045_yaw090.jpg
293
+ view_e3548d6db6fc402ae2cb,360x_outdoor,too_dark,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0045_yaw180.jpg
294
+ view_c945b4271a886fceb687,360x_outdoor,too_dark,f5492abc-8bd4-4539-9a90-ba01412b4c38_0028_yaw000.jpg
295
+ view_9740a6419d999990e841,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0004_yaw000.jpg
296
+ view_45d19794ccfcdd8504d4,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0004_yaw090.jpg
297
+ view_acd935e880dfced92381,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0004_yaw270.jpg
298
+ view_fba2d392977c20f97b49,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0012_yaw270.jpg
299
+ view_59f9e3da11bb937ae642,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0020_yaw000.jpg
300
+ view_84d5985267aa7b1d8a4f,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0020_yaw090.jpg
301
+ view_e584780118cbacd10974,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0020_yaw180.jpg
302
+ view_1c8c58957c68ad0bec88,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0020_yaw270.jpg
303
+ view_8e5dc829e34867d8ad3c,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0029_yaw000.jpg
304
+ view_80fbe343a69e1350287e,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0029_yaw090.jpg
305
+ view_2c1c28f5df67dbd2a34d,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0029_yaw180.jpg
306
+ view_f8d39edae59007d1d02b,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0029_yaw270.jpg
307
+ view_1b48acab7502b7aeac3f,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0037_yaw000.jpg
308
+ view_45c8fc5d829a4187b3d1,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0037_yaw090.jpg
309
+ view_55b5657e348c7a536cab,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0037_yaw180.jpg
310
+ view_8d84ad51ba510a39eef3,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0037_yaw270.jpg
311
+ view_4e9fefe2368a4716373e,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0045_yaw000.jpg
312
+ view_68f0e1b2e6417b8725bf,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0045_yaw090.jpg
313
+ view_da15bdb1b566076705fb,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0045_yaw180.jpg
314
+ view_1f888101e0f08927546c,360x_outdoor,too_dark,fbffc5b8-ac79-416c-bb46-00fd8298a3c3_0045_yaw270.jpg
315
+ view_3b46d479c20c459e9bbb,tau_urban_audio_visual_2021_nonoverlap,too_dark,park-vienna-247-7358_midpoint.jpg
316
+ view_972bddaf392439b32ad2,tau_urban_audio_visual_2021_nonoverlap,too_dark,park-vienna-247-7364_midpoint.jpg
317
+ view_cfa14f2be8e4144546f8,tau_urban_audio_visual_2021_nonoverlap,too_dark,park-vienna-247-7370_midpoint.jpg
318
+ view_20b8e3ebc116dca9fa6c,tau_urban_audio_visual_2021_nonoverlap,too_dark,park-vienna-247-7375_midpoint.jpg
319
+ view_6e23f16c7fdc64183901,tau_urban_audio_visual_2021_nonoverlap,too_dark,park-vienna-247-7381_midpoint.jpg
320
+ view_7176665059a63250f9ae,tau_urban_audio_visual_2021_nonoverlap,too_dark,park-vienna-247-7387_midpoint.jpg
321
+ view_a43d24df3c6639671803,yfcc100m_street,waterfall_closeup,yfcc_7001577995_000_frame00.jpg
322
+ view_f8a1f0bdaa6d6eef55a0,yfcc100m_street,waterfall_closeup,yfcc_7001577995_001_frame04.jpg
323
+ view_4f0d2d903958dfbe561d,yfcc100m_street,car_show_music,yfcc_8070542781_000_frame07.jpg
324
+ view_616c23f5eceaa2d1b790,yfcc100m_street,car_show_music,yfcc_8070542781_001_frame03.jpg
325
+ view_88ffe2f2ef2470772af4,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0003_yaw000.jpg
326
+ view_3fef0cf41ab43b4459ba,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0003_yaw090.jpg
327
+ view_ab6f98ad6fffb93ab6da,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0003_yaw180.jpg
328
+ view_8f7e05e8b6e92d5c4af9,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0003_yaw270.jpg
329
+ view_e144ccbcd3fb272757a7,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0009_yaw000.jpg
330
+ view_f1626f6ec1b61ccd60a2,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0009_yaw090.jpg
331
+ view_dec7dfe1bd25dfde2af4,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0009_yaw180.jpg
332
+ view_b153305a53e7b6073c24,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0009_yaw270.jpg
333
+ view_47102bd4bf4499246f39,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0015_yaw000.jpg
334
+ view_9f98ff41cfcf177655c1,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0015_yaw090.jpg
335
+ view_3492b1131c85524969b9,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0015_yaw180.jpg
336
+ view_9216b07b9f1c93942d99,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0015_yaw270.jpg
337
+ view_7d00cc92596292c12f45,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0022_yaw000.jpg
338
+ view_08434799f304052b3cc2,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0022_yaw090.jpg
339
+ view_ca6b80beeaae194ebbc7,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0022_yaw180.jpg
340
+ view_23d8c614e0d4943c572b,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0022_yaw270.jpg
341
+ view_5f6cc55e127b6418f141,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0028_yaw000.jpg
342
+ view_6c73c9d2c2dcc9fd7bcc,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0028_yaw090.jpg
343
+ view_b8b63ebca89bd584a224,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0028_yaw180.jpg
344
+ view_a54f68ccfbaf95cb564d,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0028_yaw270.jpg
345
+ view_fce567b7a3fc013c7c62,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0034_yaw000.jpg
346
+ view_b444fbdf64eef55d64a1,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0034_yaw090.jpg
347
+ view_c14080196dfe0df5face,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0034_yaw180.jpg
348
+ view_970a107fb9bed5c4578a,360x_outdoor,indoor_cafe,13ee7933-508d-4d06-9584-5054989c2a4e_0034_yaw270.jpg
349
+ view_363a9e3b30b4c5dcf781,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0003_yaw000.jpg
350
+ view_2fe3b630365a856eaabe,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0003_yaw090.jpg
351
+ view_e1630bef035a26bf8ed0,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0003_yaw180.jpg
352
+ view_9df3eca23927fe970463,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0003_yaw270.jpg
353
+ view_e3885a8e2a9873ee8e7b,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0009_yaw000.jpg
354
+ view_da9bed335f1851d5e92c,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0009_yaw090.jpg
355
+ view_3168f0ebd0c3360ec92c,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0009_yaw180.jpg
356
+ view_7442c2dc00dd77d102ef,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0009_yaw270.jpg
357
+ view_25b33f9c424cba53e2d8,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0015_yaw000.jpg
358
+ view_7864fb3d8866e3a8f2fb,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0015_yaw090.jpg
359
+ view_945017d85dd67b7e9207,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0015_yaw180.jpg
360
+ view_4b5bcdd7ef5255b3118a,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0015_yaw270.jpg
361
+ view_dbdcaf4bf132e7003e9c,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0020_yaw000.jpg
362
+ view_2e86a827ff718216a070,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0020_yaw090.jpg
363
+ view_5108520e33b30b23f4ad,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0020_yaw180.jpg
364
+ view_d233c9ca7e48dd016957,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0020_yaw270.jpg
365
+ view_415c55e84905b332e5de,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0026_yaw000.jpg
366
+ view_2ba21e7e198cd36b949c,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0026_yaw090.jpg
367
+ view_9722bec72c1f0218c007,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0026_yaw180.jpg
368
+ view_b3b020d22d4b39636134,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0026_yaw270.jpg
369
+ view_ff619e7eb804e0debf9d,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0032_yaw000.jpg
370
+ view_ad73849226ae7fde59a6,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0032_yaw090.jpg
371
+ view_a1fe0c95273e7c5c6afb,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0032_yaw180.jpg
372
+ view_f86d450379812549811f,360x_outdoor,indoor_restaurant,a0ecf96a-9f96-4cf5-9aa7-50ca84adad86_0032_yaw270.jpg
373
+ view_040942b3c08dabf80308,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0003_yaw000.jpg
374
+ view_4cd49ea1deeb074d49ab,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0003_yaw090.jpg
375
+ view_3c83897adb4e559a814c,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0003_yaw180.jpg
376
+ view_a952a917394f93a67af3,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0003_yaw270.jpg
377
+ view_ac883caa08b73e770e91,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0010_yaw000.jpg
378
+ view_f4c4b635bd6babb52f85,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0010_yaw090.jpg
379
+ view_e7f1beaa155a5e9eb848,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0010_yaw180.jpg
380
+ view_849f63283c7c61b3e2ea,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0010_yaw270.jpg
381
+ view_e9c7b625bf56190c1c51,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0017_yaw000.jpg
382
+ view_4c0f54ef04dad1072d38,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0017_yaw090.jpg
383
+ view_ddee35f0e687e5d2d19c,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0017_yaw180.jpg
384
+ view_81af8732eb0200fe9aa1,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0017_yaw270.jpg
385
+ view_2021e4f35f64abaaf860,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0024_yaw000.jpg
386
+ view_c006a32caae323b2bcf9,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0024_yaw090.jpg
387
+ view_570fe5555ee2bd1ebdee,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0024_yaw180.jpg
388
+ view_a9d00abfd111d441e1c5,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0024_yaw270.jpg
389
+ view_9b43e47442bc9d564205,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0031_yaw000.jpg
390
+ view_4c5e86b1549420736557,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0031_yaw090.jpg
391
+ view_613f7e0ee65adc4c74f8,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0031_yaw180.jpg
392
+ view_1bb45193622f824a7719,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0031_yaw270.jpg
393
+ view_af6615d1a1925f8f9fea,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0038_yaw000.jpg
394
+ view_4e49d7ed4508433c9d51,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0038_yaw090.jpg
395
+ view_c5c039195c849f333193,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0038_yaw180.jpg
396
+ view_f378ca923e093d5d93ca,360x_outdoor,indoor_restaurant,a6cd265d-58fd-4b18-bd54-1f03751dbeac_0038_yaw270.jpg
397
+ view_763d3f4412b3c9361933,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0004_yaw000.jpg
398
+ view_f8ce86bb71b788035f1d,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0004_yaw270.jpg
399
+ view_15af2d399f8f97a28f2d,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0012_yaw000.jpg
400
+ view_ad6c182d49c88e2ad44c,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0012_yaw270.jpg
401
+ view_507d05b1dca26552abfd,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0020_yaw000.jpg
402
+ view_03bf0fb3ff76a0ffe2bf,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0020_yaw270.jpg
403
+ view_c91acde6fd7aea91d317,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0029_yaw000.jpg
404
+ view_c80e6001caaafb977b9b,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0029_yaw270.jpg
405
+ view_d26098b240ee68579c08,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0037_yaw000.jpg
406
+ view_df390407f6a2cb67e04f,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0037_yaw270.jpg
407
+ view_f84291adb904c60b1dd3,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0045_yaw000.jpg
408
+ view_558b668f16cedadf383b,360x_outdoor,indoor_room_balcony,ee1e440b-a8db-41c8-8adf-97af9fcf87cb_0045_yaw270.jpg
409
+ view_4b146880899bf5662e64,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0004_yaw000.jpg
410
+ view_70fecd03387c1361c758,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0004_yaw090.jpg
411
+ view_256c791a0cf7e0569dcc,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0004_yaw180.jpg
412
+ view_5911832e452ddd8f6ded,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0004_yaw270.jpg
413
+ view_934d5ca2f514b7c97943,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0013_yaw000.jpg
414
+ view_0e3551ef826723a4cfea,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0013_yaw090.jpg
415
+ view_f816f9121d11e3228918,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0013_yaw180.jpg
416
+ view_72695a7aea72fe6fbaf0,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0013_yaw270.jpg
417
+ view_48c1da79b08c686e8416,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0021_yaw000.jpg
418
+ view_002cc49d72da5e31af82,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0021_yaw090.jpg
419
+ view_84882e3431df985a6fe0,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0021_yaw180.jpg
420
+ view_9c9822ba83e4ee748d1a,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0021_yaw270.jpg
421
+ view_60b7e890c85dc2ca4e6d,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0030_yaw000.jpg
422
+ view_30af8d8aaa7dde1fef41,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0030_yaw090.jpg
423
+ view_c9f09af9022a5fc76134,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0030_yaw180.jpg
424
+ view_5c99a80d484eb473962e,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0030_yaw270.jpg
425
+ view_b9d2c76f240e6302562e,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0038_yaw000.jpg
426
+ view_6dbd1f4d5851a4b40ea4,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0038_yaw090.jpg
427
+ view_e086aefd348b1174fc53,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0038_yaw180.jpg
428
+ view_c1bc509eafe9600828d5,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0038_yaw270.jpg
429
+ view_6069ee644390f42a1553,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0047_yaw000.jpg
430
+ view_3287681bf82426015350,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0047_yaw090.jpg
431
+ view_aac82baa14d919bf31cd,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0047_yaw180.jpg
432
+ view_d7fba3f7c0006f306d46,360x_outdoor,indoor_restaurant,fbe0f9c8-d32d-4d33-b8ef-30966ca71f87_0047_yaw270.jpg
data/drop_lists/tau_indoor_scenes.csv ADDED
The diff for this file is too large to render. See raw diff
 
data/final_split/final_pairs.csv ADDED
The diff for this file is too large to render. See raw diff
 
data/places365_categories.txt ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /a/airfield 0
2
+ /a/airplane_cabin 1
3
+ /a/airport_terminal 2
4
+ /a/alcove 3
5
+ /a/alley 4
6
+ /a/amphitheater 5
7
+ /a/amusement_arcade 6
8
+ /a/amusement_park 7
9
+ /a/apartment_building/outdoor 8
10
+ /a/aquarium 9
11
+ /a/aqueduct 10
12
+ /a/arcade 11
13
+ /a/arch 12
14
+ /a/archaelogical_excavation 13
15
+ /a/archive 14
16
+ /a/arena/hockey 15
17
+ /a/arena/performance 16
18
+ /a/arena/rodeo 17
19
+ /a/army_base 18
20
+ /a/art_gallery 19
21
+ /a/art_school 20
22
+ /a/art_studio 21
23
+ /a/artists_loft 22
24
+ /a/assembly_line 23
25
+ /a/athletic_field/outdoor 24
26
+ /a/atrium/public 25
27
+ /a/attic 26
28
+ /a/auditorium 27
29
+ /a/auto_factory 28
30
+ /a/auto_showroom 29
31
+ /b/badlands 30
32
+ /b/bakery/shop 31
33
+ /b/balcony/exterior 32
34
+ /b/balcony/interior 33
35
+ /b/ball_pit 34
36
+ /b/ballroom 35
37
+ /b/bamboo_forest 36
38
+ /b/bank_vault 37
39
+ /b/banquet_hall 38
40
+ /b/bar 39
41
+ /b/barn 40
42
+ /b/barndoor 41
43
+ /b/baseball_field 42
44
+ /b/basement 43
45
+ /b/basketball_court/indoor 44
46
+ /b/bathroom 45
47
+ /b/bazaar/indoor 46
48
+ /b/bazaar/outdoor 47
49
+ /b/beach 48
50
+ /b/beach_house 49
51
+ /b/beauty_salon 50
52
+ /b/bedchamber 51
53
+ /b/bedroom 52
54
+ /b/beer_garden 53
55
+ /b/beer_hall 54
56
+ /b/berth 55
57
+ /b/biology_laboratory 56
58
+ /b/boardwalk 57
59
+ /b/boat_deck 58
60
+ /b/boathouse 59
61
+ /b/bookstore 60
62
+ /b/booth/indoor 61
63
+ /b/botanical_garden 62
64
+ /b/bow_window/indoor 63
65
+ /b/bowling_alley 64
66
+ /b/boxing_ring 65
67
+ /b/bridge 66
68
+ /b/building_facade 67
69
+ /b/bullring 68
70
+ /b/burial_chamber 69
71
+ /b/bus_interior 70
72
+ /b/bus_station/indoor 71
73
+ /b/butchers_shop 72
74
+ /b/butte 73
75
+ /c/cabin/outdoor 74
76
+ /c/cafeteria 75
77
+ /c/campsite 76
78
+ /c/campus 77
79
+ /c/canal/natural 78
80
+ /c/canal/urban 79
81
+ /c/candy_store 80
82
+ /c/canyon 81
83
+ /c/car_interior 82
84
+ /c/carrousel 83
85
+ /c/castle 84
86
+ /c/catacomb 85
87
+ /c/cemetery 86
88
+ /c/chalet 87
89
+ /c/chemistry_lab 88
90
+ /c/childs_room 89
91
+ /c/church/indoor 90
92
+ /c/church/outdoor 91
93
+ /c/classroom 92
94
+ /c/clean_room 93
95
+ /c/cliff 94
96
+ /c/closet 95
97
+ /c/clothing_store 96
98
+ /c/coast 97
99
+ /c/cockpit 98
100
+ /c/coffee_shop 99
101
+ /c/computer_room 100
102
+ /c/conference_center 101
103
+ /c/conference_room 102
104
+ /c/construction_site 103
105
+ /c/corn_field 104
106
+ /c/corral 105
107
+ /c/corridor 106
108
+ /c/cottage 107
109
+ /c/courthouse 108
110
+ /c/courtyard 109
111
+ /c/creek 110
112
+ /c/crevasse 111
113
+ /c/crosswalk 112
114
+ /d/dam 113
115
+ /d/delicatessen 114
116
+ /d/department_store 115
117
+ /d/desert/sand 116
118
+ /d/desert/vegetation 117
119
+ /d/desert_road 118
120
+ /d/diner/outdoor 119
121
+ /d/dining_hall 120
122
+ /d/dining_room 121
123
+ /d/discotheque 122
124
+ /d/doorway/outdoor 123
125
+ /d/dorm_room 124
126
+ /d/downtown 125
127
+ /d/dressing_room 126
128
+ /d/driveway 127
129
+ /d/drugstore 128
130
+ /e/elevator/door 129
131
+ /e/elevator_lobby 130
132
+ /e/elevator_shaft 131
133
+ /e/embassy 132
134
+ /e/engine_room 133
135
+ /e/entrance_hall 134
136
+ /e/escalator/indoor 135
137
+ /e/excavation 136
138
+ /f/fabric_store 137
139
+ /f/farm 138
140
+ /f/fastfood_restaurant 139
141
+ /f/field/cultivated 140
142
+ /f/field/wild 141
143
+ /f/field_road 142
144
+ /f/fire_escape 143
145
+ /f/fire_station 144
146
+ /f/fishpond 145
147
+ /f/flea_market/indoor 146
148
+ /f/florist_shop/indoor 147
149
+ /f/food_court 148
150
+ /f/football_field 149
151
+ /f/forest/broadleaf 150
152
+ /f/forest_path 151
153
+ /f/forest_road 152
154
+ /f/formal_garden 153
155
+ /f/fountain 154
156
+ /g/galley 155
157
+ /g/garage/indoor 156
158
+ /g/garage/outdoor 157
159
+ /g/gas_station 158
160
+ /g/gazebo/exterior 159
161
+ /g/general_store/indoor 160
162
+ /g/general_store/outdoor 161
163
+ /g/gift_shop 162
164
+ /g/glacier 163
165
+ /g/golf_course 164
166
+ /g/greenhouse/indoor 165
167
+ /g/greenhouse/outdoor 166
168
+ /g/grotto 167
169
+ /g/gymnasium/indoor 168
170
+ /h/hangar/indoor 169
171
+ /h/hangar/outdoor 170
172
+ /h/harbor 171
173
+ /h/hardware_store 172
174
+ /h/hayfield 173
175
+ /h/heliport 174
176
+ /h/highway 175
177
+ /h/home_office 176
178
+ /h/home_theater 177
179
+ /h/hospital 178
180
+ /h/hospital_room 179
181
+ /h/hot_spring 180
182
+ /h/hotel/outdoor 181
183
+ /h/hotel_room 182
184
+ /h/house 183
185
+ /h/hunting_lodge/outdoor 184
186
+ /i/ice_cream_parlor 185
187
+ /i/ice_floe 186
188
+ /i/ice_shelf 187
189
+ /i/ice_skating_rink/indoor 188
190
+ /i/ice_skating_rink/outdoor 189
191
+ /i/iceberg 190
192
+ /i/igloo 191
193
+ /i/industrial_area 192
194
+ /i/inn/outdoor 193
195
+ /i/islet 194
196
+ /j/jacuzzi/indoor 195
197
+ /j/jail_cell 196
198
+ /j/japanese_garden 197
199
+ /j/jewelry_shop 198
200
+ /j/junkyard 199
201
+ /k/kasbah 200
202
+ /k/kennel/outdoor 201
203
+ /k/kindergarden_classroom 202
204
+ /k/kitchen 203
205
+ /l/lagoon 204
206
+ /l/lake/natural 205
207
+ /l/landfill 206
208
+ /l/landing_deck 207
209
+ /l/laundromat 208
210
+ /l/lawn 209
211
+ /l/lecture_room 210
212
+ /l/legislative_chamber 211
213
+ /l/library/indoor 212
214
+ /l/library/outdoor 213
215
+ /l/lighthouse 214
216
+ /l/living_room 215
217
+ /l/loading_dock 216
218
+ /l/lobby 217
219
+ /l/lock_chamber 218
220
+ /l/locker_room 219
221
+ /m/mansion 220
222
+ /m/manufactured_home 221
223
+ /m/market/indoor 222
224
+ /m/market/outdoor 223
225
+ /m/marsh 224
226
+ /m/martial_arts_gym 225
227
+ /m/mausoleum 226
228
+ /m/medina 227
229
+ /m/mezzanine 228
230
+ /m/moat/water 229
231
+ /m/mosque/outdoor 230
232
+ /m/motel 231
233
+ /m/mountain 232
234
+ /m/mountain_path 233
235
+ /m/mountain_snowy 234
236
+ /m/movie_theater/indoor 235
237
+ /m/museum/indoor 236
238
+ /m/museum/outdoor 237
239
+ /m/music_studio 238
240
+ /n/natural_history_museum 239
241
+ /n/nursery 240
242
+ /n/nursing_home 241
243
+ /o/oast_house 242
244
+ /o/ocean 243
245
+ /o/office 244
246
+ /o/office_building 245
247
+ /o/office_cubicles 246
248
+ /o/oilrig 247
249
+ /o/operating_room 248
250
+ /o/orchard 249
251
+ /o/orchestra_pit 250
252
+ /p/pagoda 251
253
+ /p/palace 252
254
+ /p/pantry 253
255
+ /p/park 254
256
+ /p/parking_garage/indoor 255
257
+ /p/parking_garage/outdoor 256
258
+ /p/parking_lot 257
259
+ /p/pasture 258
260
+ /p/patio 259
261
+ /p/pavilion 260
262
+ /p/pet_shop 261
263
+ /p/pharmacy 262
264
+ /p/phone_booth 263
265
+ /p/physics_laboratory 264
266
+ /p/picnic_area 265
267
+ /p/pier 266
268
+ /p/pizzeria 267
269
+ /p/playground 268
270
+ /p/playroom 269
271
+ /p/plaza 270
272
+ /p/pond 271
273
+ /p/porch 272
274
+ /p/promenade 273
275
+ /p/pub/indoor 274
276
+ /r/racecourse 275
277
+ /r/raceway 276
278
+ /r/raft 277
279
+ /r/railroad_track 278
280
+ /r/rainforest 279
281
+ /r/reception 280
282
+ /r/recreation_room 281
283
+ /r/repair_shop 282
284
+ /r/residential_neighborhood 283
285
+ /r/restaurant 284
286
+ /r/restaurant_kitchen 285
287
+ /r/restaurant_patio 286
288
+ /r/rice_paddy 287
289
+ /r/river 288
290
+ /r/rock_arch 289
291
+ /r/roof_garden 290
292
+ /r/rope_bridge 291
293
+ /r/ruin 292
294
+ /r/runway 293
295
+ /s/sandbox 294
296
+ /s/sauna 295
297
+ /s/schoolhouse 296
298
+ /s/science_museum 297
299
+ /s/server_room 298
300
+ /s/shed 299
301
+ /s/shoe_shop 300
302
+ /s/shopfront 301
303
+ /s/shopping_mall/indoor 302
304
+ /s/shower 303
305
+ /s/ski_resort 304
306
+ /s/ski_slope 305
307
+ /s/sky 306
308
+ /s/skyscraper 307
309
+ /s/slum 308
310
+ /s/snowfield 309
311
+ /s/soccer_field 310
312
+ /s/stable 311
313
+ /s/stadium/baseball 312
314
+ /s/stadium/football 313
315
+ /s/stadium/soccer 314
316
+ /s/stage/indoor 315
317
+ /s/stage/outdoor 316
318
+ /s/staircase 317
319
+ /s/storage_room 318
320
+ /s/street 319
321
+ /s/subway_station/platform 320
322
+ /s/supermarket 321
323
+ /s/sushi_bar 322
324
+ /s/swamp 323
325
+ /s/swimming_hole 324
326
+ /s/swimming_pool/indoor 325
327
+ /s/swimming_pool/outdoor 326
328
+ /s/synagogue/outdoor 327
329
+ /t/television_room 328
330
+ /t/television_studio 329
331
+ /t/temple/asia 330
332
+ /t/throne_room 331
333
+ /t/ticket_booth 332
334
+ /t/topiary_garden 333
335
+ /t/tower 334
336
+ /t/toyshop 335
337
+ /t/train_interior 336
338
+ /t/train_station/platform 337
339
+ /t/tree_farm 338
340
+ /t/tree_house 339
341
+ /t/trench 340
342
+ /t/tundra 341
343
+ /u/underwater/ocean_deep 342
344
+ /u/utility_room 343
345
+ /v/valley 344
346
+ /v/vegetable_garden 345
347
+ /v/veterinarians_office 346
348
+ /v/viaduct 347
349
+ /v/village 348
350
+ /v/vineyard 349
351
+ /v/volcano 350
352
+ /v/volleyball_court/outdoor 351
353
+ /w/waiting_room 352
354
+ /w/water_park 353
355
+ /w/water_tower 354
356
+ /w/waterfall 355
357
+ /w/watering_hole 356
358
+ /w/wave 357
359
+ /w/wet_bar 358
360
+ /w/wheat_field 359
361
+ /w/wind_farm 360
362
+ /w/windmill 361
363
+ /y/yard 362
364
+ /y/youth_hostel 363
365
+ /z/zen_garden 364
data/places365_io.txt ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /a/airfield 2
2
+ /a/airplane_cabin 1
3
+ /a/airport_terminal 1
4
+ /a/alcove 1
5
+ /a/alley 2
6
+ /a/amphitheater 2
7
+ /a/amusement_arcade 1
8
+ /a/amusement_park 2
9
+ /a/apartment_building/outdoor 2
10
+ /a/aquarium 1
11
+ /a/aqueduct 2
12
+ /a/arcade 1
13
+ /a/arch 2
14
+ /a/archaelogical_excavation 1
15
+ /a/archive 1
16
+ /a/arena/hockey 1
17
+ /a/arena/performance 1
18
+ /a/arena/rodeo 1
19
+ /a/army_base 2
20
+ /a/art_gallery 1
21
+ /a/art_school 1
22
+ /a/art_studio 1
23
+ /a/artists_loft 1
24
+ /a/assembly_line 1
25
+ /a/athletic_field/outdoor 2
26
+ /a/atrium/public 1
27
+ /a/attic 1
28
+ /a/auditorium 1
29
+ /a/auto_factory 1
30
+ /a/auto_showroom 1
31
+ /b/badlands 2
32
+ /b/bakery/shop 1
33
+ /b/balcony/exterior 2
34
+ /b/balcony/interior 2
35
+ /b/ball_pit 1
36
+ /b/ballroom 1
37
+ /b/bamboo_forest 2
38
+ /b/bank_vault 1
39
+ /b/banquet_hall 1
40
+ /b/bar 1
41
+ /b/barn 2
42
+ /b/barndoor 2
43
+ /b/baseball_field 2
44
+ /b/basement 1
45
+ /b/basketball_court/indoor 1
46
+ /b/bathroom 1
47
+ /b/bazaar/indoor 1
48
+ /b/bazaar/outdoor 2
49
+ /b/beach 2
50
+ /b/beach_house 2
51
+ /b/beauty_salon 1
52
+ /b/bedchamber 1
53
+ /b/bedroom 1
54
+ /b/beer_garden 2
55
+ /b/beer_hall 1
56
+ /b/berth 1
57
+ /b/biology_laboratory 1
58
+ /b/boardwalk 2
59
+ /b/boat_deck 2
60
+ /b/boathouse 2
61
+ /b/bookstore 1
62
+ /b/booth/indoor 1
63
+ /b/botanical_garden 2
64
+ /b/bow_window/indoor 1
65
+ /b/bowling_alley 1
66
+ /b/boxing_ring 1
67
+ /b/bridge 2
68
+ /b/building_facade 2
69
+ /b/bullring 2
70
+ /b/burial_chamber 1
71
+ /b/bus_interior 1
72
+ /b/bus_station/indoor 1
73
+ /b/butchers_shop 1
74
+ /b/butte 2
75
+ /c/cabin/outdoor 2
76
+ /c/cafeteria 1
77
+ /c/campsite 2
78
+ /c/campus 2
79
+ /c/canal/natural 2
80
+ /c/canal/urban 2
81
+ /c/candy_store 1
82
+ /c/canyon 2
83
+ /c/car_interior 1
84
+ /c/carrousel 2
85
+ /c/castle 2
86
+ /c/catacomb 1
87
+ /c/cemetery 2
88
+ /c/chalet 2
89
+ /c/chemistry_lab 1
90
+ /c/childs_room 1
91
+ /c/church/indoor 1
92
+ /c/church/outdoor 2
93
+ /c/classroom 1
94
+ /c/clean_room 1
95
+ /c/cliff 2
96
+ /c/closet 1
97
+ /c/clothing_store 1
98
+ /c/coast 2
99
+ /c/cockpit 1
100
+ /c/coffee_shop 1
101
+ /c/computer_room 1
102
+ /c/conference_center 1
103
+ /c/conference_room 1
104
+ /c/construction_site 2
105
+ /c/corn_field 2
106
+ /c/corral 2
107
+ /c/corridor 1
108
+ /c/cottage 2
109
+ /c/courthouse 2
110
+ /c/courtyard 2
111
+ /c/creek 2
112
+ /c/crevasse 2
113
+ /c/crosswalk 2
114
+ /d/dam 2
115
+ /d/delicatessen 1
116
+ /d/department_store 1
117
+ /d/desert/sand 2
118
+ /d/desert/vegetation 2
119
+ /d/desert_road 2
120
+ /d/diner/outdoor 2
121
+ /d/dining_hall 1
122
+ /d/dining_room 1
123
+ /d/discotheque 1
124
+ /d/doorway/outdoor 2
125
+ /d/dorm_room 1
126
+ /d/downtown 2
127
+ /d/dressing_room 1
128
+ /d/driveway 2
129
+ /d/drugstore 1
130
+ /e/elevator/door 1
131
+ /e/elevator_lobby 1
132
+ /e/elevator_shaft 1
133
+ /e/embassy 2
134
+ /e/engine_room 1
135
+ /e/entrance_hall 1
136
+ /e/escalator/indoor 1
137
+ /e/excavation 2
138
+ /f/fabric_store 1
139
+ /f/farm 2
140
+ /f/fastfood_restaurant 1
141
+ /f/field/cultivated 2
142
+ /f/field/wild 2
143
+ /f/field_road 2
144
+ /f/fire_escape 2
145
+ /f/fire_station 2
146
+ /f/fishpond 2
147
+ /f/flea_market/indoor 1
148
+ /f/florist_shop/indoor 1
149
+ /f/food_court 1
150
+ /f/football_field 2
151
+ /f/forest/broadleaf 2
152
+ /f/forest_path 2
153
+ /f/forest_road 2
154
+ /f/formal_garden 2
155
+ /f/fountain 2
156
+ /g/galley 1
157
+ /g/garage/indoor 1
158
+ /g/garage/outdoor 2
159
+ /g/gas_station 2
160
+ /g/gazebo/exterior 2
161
+ /g/general_store/indoor 1
162
+ /g/general_store/outdoor 2
163
+ /g/gift_shop 1
164
+ /g/glacier 2
165
+ /g/golf_course 2
166
+ /g/greenhouse/indoor 1
167
+ /g/greenhouse/outdoor 2
168
+ /g/grotto 2
169
+ /g/gymnasium/indoor 1
170
+ /h/hangar/indoor 1
171
+ /h/hangar/outdoor 2
172
+ /h/harbor 2
173
+ /h/hardware_store 1
174
+ /h/hayfield 2
175
+ /h/heliport 2
176
+ /h/highway 2
177
+ /h/home_office 1
178
+ /h/home_theater 1
179
+ /h/hospital 2
180
+ /h/hospital_room 1
181
+ /h/hot_spring 2
182
+ /h/hotel/outdoor 2
183
+ /h/hotel_room 1
184
+ /h/house 2
185
+ /h/hunting_lodge/outdoor 2
186
+ /i/ice_cream_parlor 1
187
+ /i/ice_floe 2
188
+ /i/ice_shelf 2
189
+ /i/ice_skating_rink/indoor 1
190
+ /i/ice_skating_rink/outdoor 2
191
+ /i/iceberg 2
192
+ /i/igloo 2
193
+ /i/industrial_area 2
194
+ /i/inn/outdoor 2
195
+ /i/islet 2
196
+ /j/jacuzzi/indoor 1
197
+ /j/jail_cell 1
198
+ /j/japanese_garden 2
199
+ /j/jewelry_shop 1
200
+ /j/junkyard 2
201
+ /k/kasbah 2
202
+ /k/kennel/outdoor 2
203
+ /k/kindergarden_classroom 1
204
+ /k/kitchen 1
205
+ /l/lagoon 2
206
+ /l/lake/natural 2
207
+ /l/landfill 2
208
+ /l/landing_deck 2
209
+ /l/laundromat 1
210
+ /l/lawn 2
211
+ /l/lecture_room 1
212
+ /l/legislative_chamber 1
213
+ /l/library/indoor 1
214
+ /l/library/outdoor 2
215
+ /l/lighthouse 2
216
+ /l/living_room 1
217
+ /l/loading_dock 2
218
+ /l/lobby 1
219
+ /l/lock_chamber 2
220
+ /l/locker_room 1
221
+ /m/mansion 2
222
+ /m/manufactured_home 2
223
+ /m/market/indoor 1
224
+ /m/market/outdoor 2
225
+ /m/marsh 2
226
+ /m/martial_arts_gym 1
227
+ /m/mausoleum 2
228
+ /m/medina 2
229
+ /m/mezzanine 1
230
+ /m/moat/water 2
231
+ /m/mosque/outdoor 2
232
+ /m/motel 2
233
+ /m/mountain 2
234
+ /m/mountain_path 2
235
+ /m/mountain_snowy 2
236
+ /m/movie_theater/indoor 1
237
+ /m/museum/indoor 1
238
+ /m/museum/outdoor 2
239
+ /m/music_studio 1
240
+ /n/natural_history_museum 1
241
+ /n/nursery 1
242
+ /n/nursing_home 1
243
+ /o/oast_house 2
244
+ /o/ocean 2
245
+ /o/office 1
246
+ /o/office_building 2
247
+ /o/office_cubicles 1
248
+ /o/oilrig 2
249
+ /o/operating_room 1
250
+ /o/orchard 2
251
+ /o/orchestra_pit 1
252
+ /p/pagoda 2
253
+ /p/palace 2
254
+ /p/pantry 1
255
+ /p/park 2
256
+ /p/parking_garage/indoor 1
257
+ /p/parking_garage/outdoor 2
258
+ /p/parking_lot 2
259
+ /p/pasture 2
260
+ /p/patio 2
261
+ /p/pavilion 2
262
+ /p/pet_shop 1
263
+ /p/pharmacy 1
264
+ /p/phone_booth 2
265
+ /p/physics_laboratory 1
266
+ /p/picnic_area 2
267
+ /p/pier 2
268
+ /p/pizzeria 1
269
+ /p/playground 2
270
+ /p/playroom 1
271
+ /p/plaza 2
272
+ /p/pond 2
273
+ /p/porch 2
274
+ /p/promenade 2
275
+ /p/pub/indoor 1
276
+ /r/racecourse 2
277
+ /r/raceway 2
278
+ /r/raft 2
279
+ /r/railroad_track 2
280
+ /r/rainforest 2
281
+ /r/reception 1
282
+ /r/recreation_room 1
283
+ /r/repair_shop 1
284
+ /r/residential_neighborhood 2
285
+ /r/restaurant 1
286
+ /r/restaurant_kitchen 1
287
+ /r/restaurant_patio 2
288
+ /r/rice_paddy 2
289
+ /r/river 2
290
+ /r/rock_arch 2
291
+ /r/roof_garden 2
292
+ /r/rope_bridge 2
293
+ /r/ruin 2
294
+ /r/runway 2
295
+ /s/sandbox 2
296
+ /s/sauna 1
297
+ /s/schoolhouse 2
298
+ /s/science_museum 1
299
+ /s/server_room 1
300
+ /s/shed 2
301
+ /s/shoe_shop 1
302
+ /s/shopfront 2
303
+ /s/shopping_mall/indoor 1
304
+ /s/shower 1
305
+ /s/ski_resort 2
306
+ /s/ski_slope 2
307
+ /s/sky 2
308
+ /s/skyscraper 2
309
+ /s/slum 2
310
+ /s/snowfield 2
311
+ /s/soccer_field 2
312
+ /s/stable 1
313
+ /s/stadium/baseball 2
314
+ /s/stadium/football 2
315
+ /s/stadium/soccer 2
316
+ /s/stage/indoor 1
317
+ /s/stage/outdoor 2
318
+ /s/staircase 1
319
+ /s/storage_room 1
320
+ /s/street 2
321
+ /s/subway_station/platform 1
322
+ /s/supermarket 1
323
+ /s/sushi_bar 1
324
+ /s/swamp 2
325
+ /s/swimming_hole 1
326
+ /s/swimming_pool/indoor 1
327
+ /s/swimming_pool/outdoor 2
328
+ /s/synagogue/outdoor 2
329
+ /t/television_room 1
330
+ /t/television_studio 1
331
+ /t/temple/asia 2
332
+ /t/throne_room 1
333
+ /t/ticket_booth 1
334
+ /t/topiary_garden 2
335
+ /t/tower 2
336
+ /t/toyshop 1
337
+ /t/train_interior 1
338
+ /t/train_station/platform 1
339
+ /t/tree_farm 2
340
+ /t/tree_house 2
341
+ /t/trench 2
342
+ /t/tundra 2
343
+ /u/underwater/ocean_deep 2
344
+ /u/utility_room 1
345
+ /v/valley 2
346
+ /v/vegetable_garden 2
347
+ /v/veterinarians_office 1
348
+ /v/viaduct 2
349
+ /v/village 2
350
+ /v/vineyard 2
351
+ /v/volcano 2
352
+ /v/volleyball_court/outdoor 2
353
+ /w/waiting_room 1
354
+ /w/water_park 2
355
+ /w/water_tower 2
356
+ /w/waterfall 2
357
+ /w/watering_hole 2
358
+ /w/wave 2
359
+ /w/wet_bar 1
360
+ /w/wheat_field 2
361
+ /w/wind_farm 2
362
+ /w/windmill 2
363
+ /y/yard 2
364
+ /y/youth_hostel 1
365
+ /z/zen_garden 2
docs/DATASETS.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Getting the datasets
2
+
3
+ Where to download each dataset, where to unpack it, and the command that prepares it. Paths are relative to the
4
+ repository unless they start with `/data` (change those with the scripts' `--root` options). Reference numbers [n]
5
+ are those of the main README. Respect each dataset's licence.
6
+
7
+ | Dataset | Download from | Put it in | Prepare with |
8
+ |---|---|---|---|
9
+ | YFCC100M street videos [1] | YFCC100M metadata (`yfcc100m_dataset.sql`, `video_length.txt`) from the Multimedia Commons release; the selected mp4s are fetched by the pipeline from the public Multimedia Commons S3 mirror | `/data/soundscape_generator_datasets/yfcc100m/metadata/` | `./runners/run_yfcc_expansion.sh --pool nogeo --max-videos 21105` (selects, downloads and screens the videos) |
10
+ | 360+x outdoor [2] | Hugging Face `quchenyuan/360x_dataset_LR` (gated: request access, then log in) | `data/360x_dataset_lr/` | `python scripts/data_preparation/datasets/download_360x_outdoor.py` (selects the outdoor recordings and downloads them), then `python scripts/data_preparation/datasets/prepare_360x_outdoor.py` and `python scripts/data_preparation/assemble/normalize_external_model_manifest.py --input data/360x_outdoor_synchronized_manifest.csv --output data/all_360x_outdoor_base.csv --dataset 360x_outdoor` |
11
+ | TAU Urban Audio-Visual Scenes 2021 [3] | Zenodo, doi:10.5281/zenodo.4477542 (development set) | unzip into `data/tau_urban_audio_visual_2021/extracted/` | `./runners/run_external_av_datasets.sh --dataset tau` |
12
+ | Urban Soundscapes of the World [4] | Zenodo, doi:10.5281/zenodo.10106181 | unzip into `data/urban_soundscapes_world/extracted/`, `USotW_metadata.csv` in `data/urban_soundscapes_world/` | `./runners/run_external_av_datasets.sh --dataset urban`, then `python scripts/data_preparation/datasets/rebuild_usotw_views.py` (4 views, six 10-s clips per recording) |
13
+ | Urbansas [5] | Zenodo, doi:10.5281/zenodo.6658386 (annotations, audio, video) | unzip into `data/urbansas/extracted/` | `./runners/run_urbansas_whole_prepare.sh` (after TAU: it removes clips that overlap TAU) |
14
+ | Lion City Soundscapes [6] | NTU research data repository (DR-NTU Data), hdl:10356/178828: per site the 1-min Insta360 video and the SQobold binaural recording | `data/lion_city_soundscapes/one_minute/<site>/`, `metadata.tsv` in `data/lion_city_soundscapes/` | `./runners/run_external_av_datasets.sh --dataset lion` |
15
+ | SonicUrban city walks [7] | Hugging Face `gisenselab/SounDiT_SoundingSVI_SonicUrban` (https://huggingface.co/datasets/gisenselab/SounDiT_SoundingSVI_SonicUrban; `SonicUrban_clean`: 10-s segments as `.wav` + `.jpg`) | `/data/SonicUrban/SonicUrban_clean/` | `./runners/run_sonicurban.sh --root /data/SonicUrban/SonicUrban_clean ...` (see README Usage) |
16
+ | ETH Zurich binaural 360 dataset [12] | `data.zip` linked from github.com/arunbalajeev/binaural-sound-perception (CC BY-NC 4.0, research use) | `/data/binaural_sound_perception/dataset_public/` (`scene0001` ... `scene0165`) | `python scripts/data_preparation/datasets/prepare_eth_binaural.py` |
17
+ | Singapore field recordings (Zhao et al. 2023) [13] | github.com/ualsg/Visual-soundscapes; street view images and field data on figshare (linked there); CC BY-NC-SA 4.0 | `dataset/Singapore/` | `./runners/run_singapore_prepare.sh` |
18
+ | Open sound-image pair data (built here) [8]-[11] | built from Aporee / Freesound recordings and Mapillary / Flickr photos; see below | `/data/SIPset_paired_4622/` (recordings bundle), output `/data/open_sound_image_pairs/` | see below |
19
+ | Michigan recordings, Taiwan sound survey | not public | - | - |
20
+
21
+ ## Open sound-image pair data
22
+
23
+ Built with openSIP (install it into the environment: `pip install -e <path to open_sound_image_pair>`). The recordings
24
+ bundle (`/data/SIPset_paired_4622`: the Aporee / Freesound recordings, their 10-s clips and the Flickr photos already
25
+ collected near them) is the starting point. Mapillary and Flickr need your own API keys, read from environment
26
+ variables; never write them into a file.
27
+
28
+ ```bash
29
+ export MAPILLARY_API_KEY=... # https://www.mapillary.com/dashboard/developers
30
+ export FLICKR_API_KEY=... # only to refresh dead Flickr photo URLs
31
+ python scripts/data_preparation/open_sound_image_pairs/build_open_sound_image_pairs.py collect # Mapillary panoramas + photos near each recording
32
+ python scripts/data_preparation/open_sound_image_pairs/build_open_sound_image_pairs.py flickr # retry failed Flickr downloads
33
+ python scripts/data_preparation/open_sound_image_pairs/build_open_sound_image_pairs.py pair # street-view screen, ImageBind similarity, one-to-one pairs
34
+ python scripts/data_preparation/open_sound_image_pairs/prepare_open_sound_image_pairs.py --output data/open_sound_image_pairs_synchronized_manifest.csv
35
+ ```
36
+
37
+ ## Human-rating sets (checks only, never used for training)
38
+
39
+ - SATP [16]: Zenodo, doi:10.5281/zenodo.6914434 (access on request).
40
+ - Mumbai audio-visual perception [17]: Mendeley Data, doi:10.17632/3hrb6gsgyn.2.
41
+ - ARAUS [15]: see the ARAUS paper for the data release.
docs/figures/place_average.png ADDED

Git LFS Details

  • SHA256: ccc05a5cda43fc44842a53a2678874750a77e05d9626f26ce1e8540a8f69ac2b
  • Pointer size: 131 Bytes
  • Size of remote file: 232 kB
docs/figures/scene_type_contrasts.png ADDED

Git LFS Details

  • SHA256: 1692124dbe93076e188438861fa94724c234b752e68298590cc92652df1df015
  • Pointer size: 131 Bytes
  • Size of remote file: 156 kB
environment.yml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: viewing-sound-paq
2
+ channels:
3
+ - conda-forge
4
+ dependencies:
5
+ - python=3.11
6
+ - pip>=24
7
+ - ffmpeg
8
+ - libsndfile
9
+ - git
10
+ variables:
11
+ PYTORCH_ALLOC_CONF: expandable_segments:True
models/final/model_siglip_krr_pe.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8a896ccc4ffbb6cd7fc6d9a20067432ac63a27cbcd0e12f1a8b559a12d15a02
3
+ size 287132216
models/soundscape_models/__init__.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ """Core data, feature, model, and training utilities for the two-stage baseline."""
2
+
3
+ __version__ = "0.1.0"
models/soundscape_models/audio.py ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import hashlib
4
+ import json
5
+ from pathlib import Path
6
+
7
+ import librosa
8
+ import numpy as np
9
+ import pyloudnorm as pyln
10
+ import soundfile as sf
11
+
12
+
13
+ SOUNDAQNET_FEATURE_KEYS = (
14
+ "feature_profile",
15
+ "sample_rate",
16
+ "n_fft",
17
+ "win_length",
18
+ "hop_length",
19
+ "n_mels",
20
+ "f_min",
21
+ "f_max",
22
+ "window",
23
+ "center",
24
+ "pad_mode",
25
+ "power",
26
+ "ref",
27
+ "amin",
28
+ "top_db",
29
+ )
30
+
31
+
32
+ def audio_feature_signature(config: dict) -> str:
33
+ canonical = {key: config.get(key) for key in SOUNDAQNET_FEATURE_KEYS}
34
+ payload = json.dumps(canonical, sort_keys=True, separators=(",", ":"))
35
+ return hashlib.sha256(payload.encode()).hexdigest()[:16]
36
+
37
+
38
+ def load_mono_audio(path: str | Path, sample_rate: int) -> np.ndarray:
39
+ waveform, source_rate = sf.read(path, dtype="float32", always_2d=True)
40
+ waveform = waveform.mean(axis=1)
41
+ if source_rate != sample_rate:
42
+ waveform = librosa.resample(
43
+ waveform, orig_sr=source_rate, target_sr=sample_rate, res_type="soxr_hq"
44
+ )
45
+ return np.asarray(waveform, dtype=np.float32)
46
+
47
+
48
+ def fix_duration(
49
+ waveform: np.ndarray,
50
+ target_samples: int,
51
+ mode: str,
52
+ identifier: str,
53
+ seed: int,
54
+ ) -> tuple[np.ndarray, int]:
55
+ if waveform.size < target_samples:
56
+ return np.pad(waveform, (0, target_samples - waveform.size)), 0
57
+ if waveform.size == target_samples:
58
+ return waveform, 0
59
+ maximum_start = waveform.size - target_samples
60
+ if mode == "start":
61
+ start = 0
62
+ elif mode == "center":
63
+ start = maximum_start // 2
64
+ elif mode == "deterministic-random":
65
+ digest = hashlib.sha256(f"{identifier}:{seed}".encode()).digest()
66
+ start = int.from_bytes(digest[:8], "little") % (maximum_start + 1)
67
+ else:
68
+ raise ValueError(f"Unknown crop mode: {mode}")
69
+ return waveform[start : start + target_samples], start
70
+
71
+
72
+ def log_mel_spectrogram(
73
+ waveform: np.ndarray,
74
+ sample_rate: int,
75
+ n_fft: int,
76
+ hop_length: int,
77
+ win_length: int,
78
+ n_mels: int,
79
+ f_min: float,
80
+ f_max: float,
81
+ window: str = "hann",
82
+ center: bool = True,
83
+ pad_mode: str = "reflect",
84
+ power: float = 2.0,
85
+ ref: float = 1.0,
86
+ amin: float = 1e-10,
87
+ top_db: float | None = None,
88
+ ) -> np.ndarray:
89
+ mel_power = librosa.feature.melspectrogram(
90
+ y=waveform,
91
+ sr=sample_rate,
92
+ n_fft=n_fft,
93
+ hop_length=hop_length,
94
+ win_length=win_length,
95
+ n_mels=n_mels,
96
+ fmin=f_min,
97
+ fmax=f_max,
98
+ window=window,
99
+ power=power,
100
+ center=center,
101
+ pad_mode=pad_mode,
102
+ )
103
+ return librosa.power_to_db(
104
+ mel_power,
105
+ ref=ref,
106
+ amin=amin,
107
+ top_db=top_db,
108
+ ).astype(np.float32)
109
+
110
+
111
+ def frame_loudness_db(
112
+ waveform: np.ndarray, n_fft: int, hop_length: int, floor_db: float
113
+ ) -> np.ndarray:
114
+ rms = librosa.feature.rms(
115
+ y=waveform,
116
+ frame_length=n_fft,
117
+ hop_length=hop_length,
118
+ center=True,
119
+ pad_mode="reflect",
120
+ )[0]
121
+ db = 20.0 * np.log10(np.maximum(rms, 10 ** (floor_db / 20.0)))
122
+ return np.maximum(db, floor_db).astype(np.float32)
123
+
124
+
125
+ def integrated_lufs(waveform: np.ndarray, sample_rate: int) -> float:
126
+ if not np.any(np.abs(waveform) > 1e-8):
127
+ return float("nan")
128
+ meter = pyln.Meter(sample_rate)
129
+ try:
130
+ value = float(meter.integrated_loudness(waveform.astype(np.float64)))
131
+ except Exception:
132
+ return float("nan")
133
+ if np.isfinite(value):
134
+ return value
135
+
136
+ # BS.1770 uses an absolute gate, so a valid but unusually low-level recording can
137
+ # be reported as -inf. Measure a temporarily boosted copy and subtract the exact
138
+ # boost afterward. Targeting a -20 dBFS peak leaves ample headroom and does not
139
+ # alter ordinary recordings, which already returned a finite value above.
140
+ peak = float(np.max(np.abs(waveform)))
141
+ if not np.isfinite(peak) or peak <= 1e-8:
142
+ return float("nan")
143
+ peak_db = float(20.0 * np.log10(peak))
144
+ boost_db = min(100.0, max(0.0, -20.0 - peak_db))
145
+ if boost_db <= 0.0:
146
+ return float("nan")
147
+ boosted = waveform.astype(np.float64) * (10.0 ** (boost_db / 20.0))
148
+ try:
149
+ boosted_value = float(meter.integrated_loudness(boosted))
150
+ except Exception:
151
+ return float("nan")
152
+ return boosted_value - boost_db if np.isfinite(boosted_value) else float("nan")
153
+
154
+
155
+ def analyze_audio(
156
+ path: str | Path,
157
+ identifier: str,
158
+ config: dict,
159
+ crop_mode: str,
160
+ seed: int,
161
+ ) -> dict[str, np.ndarray | float | int]:
162
+ sample_rate = int(config["sample_rate"])
163
+ target_samples = int(round(sample_rate * float(config["duration_seconds"])))
164
+ waveform = load_mono_audio(path, sample_rate)
165
+ original_samples = int(waveform.size)
166
+ waveform, crop_start = fix_duration(
167
+ waveform, target_samples, crop_mode, identifier=identifier, seed=seed
168
+ )
169
+ waveform = np.nan_to_num(waveform, nan=0.0, posinf=1.0, neginf=-1.0)
170
+ waveform = np.clip(waveform, -1.0, 1.0).astype(np.float32)
171
+ source_lufs = integrated_lufs(waveform, sample_rate)
172
+ level_gain_db, peak_limited = 0.0, False
173
+ target_lufs = config.get("level_normalization_lufs")
174
+ mode = config.get("level_normalization_mode", "clip")
175
+ if mode == "group" and config.get("fixed_gain_db") is not None:
176
+ # One gain per recording group (e.g. city/recorder): keeps loudness differences between
177
+ # places, removes only the group's recorder gain. Set per clip by extract_audio_targets.
178
+ level_gain_db = float(config["fixed_gain_db"])
179
+ elif mode == "clip" and target_lufs is not None and np.isfinite(source_lufs):
180
+ # Remove uncalibrated recording gain: bring every clip to the same integrated loudness.
181
+ level_gain_db = float(target_lufs) - source_lufs
182
+ if level_gain_db != 0.0:
183
+ waveform = waveform * np.float32(10.0 ** (level_gain_db / 20.0))
184
+ peak = float(np.max(np.abs(waveform)))
185
+ if peak > 0.999:
186
+ waveform = waveform * np.float32(0.999 / peak)
187
+ level_gain_db += float(20.0 * np.log10(0.999 / peak))
188
+ peak_limited = True
189
+ waveform = waveform.astype(np.float32)
190
+ mel = log_mel_spectrogram(
191
+ waveform,
192
+ sample_rate,
193
+ int(config["n_fft"]),
194
+ int(config["hop_length"]),
195
+ int(config["win_length"]),
196
+ int(config["n_mels"]),
197
+ float(config["f_min"]),
198
+ float(config["f_max"]),
199
+ str(config.get("window", "hann")),
200
+ bool(config.get("center", True)),
201
+ str(config.get("pad_mode", "reflect")),
202
+ float(config.get("power", 2.0)),
203
+ float(config.get("ref", 1.0)),
204
+ float(config.get("amin", 1e-10)),
205
+ config.get("top_db"),
206
+ )
207
+ loudness = frame_loudness_db(
208
+ waveform,
209
+ int(config["n_fft"]),
210
+ int(config["hop_length"]),
211
+ float(config["loudness_floor_db"]),
212
+ )
213
+ frames = min(mel.shape[1], loudness.shape[0])
214
+ mel = mel[:, :frames]
215
+ loudness = loudness[:frames]
216
+ return {
217
+ "waveform": waveform,
218
+ "mel": mel,
219
+ "loudness_db": loudness,
220
+ "lufs": integrated_lufs(waveform, sample_rate),
221
+ "source_lufs": source_lufs,
222
+ "level_gain_db": level_gain_db,
223
+ "peak_limited": peak_limited,
224
+ "crop_start_sample": crop_start,
225
+ "original_samples": original_samples,
226
+ "sample_rate": sample_rate,
227
+ }
228
+
229
+
230
+ def write_float_wav(path: str | Path, waveform: np.ndarray, sample_rate: int) -> None:
231
+ path = Path(path)
232
+ path.parent.mkdir(parents=True, exist_ok=True)
233
+ sf.write(path, waveform, sample_rate, subtype="FLOAT")
models/soundscape_models/utils.py ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ import math
5
+ import os
6
+ import random
7
+ import time
8
+ import uuid
9
+ from pathlib import Path
10
+ from typing import Any
11
+
12
+ import numpy as np
13
+ import torch
14
+ import yaml
15
+
16
+
17
+ def load_config(path: str | Path) -> dict[str, Any]:
18
+ with Path(path).open("r", encoding="utf-8") as handle:
19
+ return yaml.safe_load(handle)
20
+
21
+
22
+ def save_json(data: Any, path: str | Path) -> None:
23
+ path = Path(path)
24
+ path.parent.mkdir(parents=True, exist_ok=True)
25
+ with path.open("w", encoding="utf-8") as handle:
26
+ json.dump(data, handle, indent=2, sort_keys=True)
27
+
28
+
29
+ def load_json(path: str | Path) -> Any:
30
+ with Path(path).open("r", encoding="utf-8") as handle:
31
+ return json.load(handle)
32
+
33
+
34
+ def resolve_manifest_path(
35
+ value: str | Path,
36
+ *,
37
+ asset_root: str | Path | None = None,
38
+ manifest: str | Path | None = None,
39
+ ) -> Path:
40
+ """Resolve a manifest path without requiring the caller's working directory."""
41
+ path = Path(value).expanduser()
42
+ if path.is_absolute():
43
+ return path.resolve()
44
+ if asset_root is not None and str(asset_root).strip():
45
+ return (Path(asset_root).expanduser() / path).resolve()
46
+ if manifest is not None:
47
+ return (Path(manifest).expanduser().resolve().parent / path).resolve()
48
+ raise ValueError(
49
+ f"Cannot resolve relative path {value!s}: no asset_root or manifest was supplied"
50
+ )
51
+
52
+
53
+ def seed_everything(seed: int) -> None:
54
+ random.seed(seed)
55
+ np.random.seed(seed)
56
+ torch.manual_seed(seed)
57
+ if torch.cuda.is_available():
58
+ torch.cuda.manual_seed_all(seed)
59
+
60
+
61
+ def select_device(requested: str = "cuda") -> torch.device:
62
+ requested = requested.lower()
63
+ if requested == "cuda":
64
+ if not torch.cuda.is_available():
65
+ raise RuntimeError(
66
+ "CUDA is the default device but no CUDA GPU is available. Check the PyTorch "
67
+ "CUDA build, NVIDIA driver, and GPU passthrough. Use --device cpu only for an "
68
+ "intentional CPU run."
69
+ )
70
+ return torch.device("cuda")
71
+ if requested == "auto":
72
+ if torch.cuda.is_available():
73
+ return torch.device("cuda")
74
+ if getattr(torch.backends, "mps", None) and torch.backends.mps.is_available():
75
+ return torch.device("mps")
76
+ return torch.device("cpu")
77
+ if requested == "mps":
78
+ if not getattr(torch.backends, "mps", None) or not torch.backends.mps.is_available():
79
+ raise RuntimeError("MPS was requested but is unavailable")
80
+ return torch.device("mps")
81
+ return torch.device(requested)
82
+
83
+
84
+ def autocast_context(device: torch.device):
85
+ if device.type == "cuda":
86
+ dtype = torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
87
+ return torch.amp.autocast("cuda", dtype=dtype)
88
+ return torch.amp.autocast(device.type, enabled=False)
89
+
90
+
91
+ def grad_scaler_enabled(device: torch.device) -> bool:
92
+ return device.type == "cuda" and not torch.cuda.is_bf16_supported()
93
+
94
+
95
+ def configure_torch_runtime(device: torch.device) -> None:
96
+ torch.set_float32_matmul_precision("high")
97
+ if device.type == "cuda":
98
+ torch.backends.cudnn.benchmark = True
99
+ torch.backends.cuda.matmul.allow_tf32 = True
100
+ torch.backends.cudnn.allow_tf32 = True
101
+
102
+
103
+ def cosine_warmup_multiplier(step: int, total_steps: int, warmup_steps: int) -> float:
104
+ if warmup_steps > 0 and step < warmup_steps:
105
+ return float(step + 1) / float(warmup_steps)
106
+ if total_steps <= warmup_steps:
107
+ return 1.0
108
+ progress = (step - warmup_steps) / max(1, total_steps - warmup_steps)
109
+ return 0.5 * (1.0 + math.cos(math.pi * min(max(progress, 0.0), 1.0)))
110
+
111
+
112
+ def atomic_torch_save(payload: dict[str, Any], path: str | Path) -> None:
113
+ path = Path(path)
114
+ path.parent.mkdir(parents=True, exist_ok=True)
115
+ # A fixed ``.tmp`` name is vulnerable to stale files and Windows scanners
116
+ # briefly opening either the source or destination. Use a unique sibling
117
+ # and retry atomic replacement while transient handles are released.
118
+ temporary = path.with_name(
119
+ f"{path.name}.{os.getpid()}.{uuid.uuid4().hex}.tmp"
120
+ )
121
+ torch.save(payload, temporary)
122
+ attempts = 12
123
+ for attempt in range(attempts):
124
+ try:
125
+ os.replace(temporary, path)
126
+ return
127
+ except PermissionError:
128
+ if attempt + 1 == attempts:
129
+ try:
130
+ temporary.unlink(missing_ok=True)
131
+ except OSError:
132
+ pass
133
+ raise
134
+ time.sleep(min(0.05 * (2**attempt), 1.0))
135
+
136
+
137
+ class RunningMoments:
138
+ def __init__(self) -> None:
139
+ self.count = 0
140
+ self.total = 0.0
141
+ self.total_sq = 0.0
142
+ self.minimum = float("inf")
143
+ self.maximum = float("-inf")
144
+
145
+ def update(self, values: np.ndarray | float) -> None:
146
+ array = np.asarray(values, dtype=np.float64)
147
+ finite = array[np.isfinite(array)]
148
+ if finite.size == 0:
149
+ return
150
+ self.count += int(finite.size)
151
+ self.total += float(finite.sum())
152
+ self.total_sq += float(np.square(finite).sum())
153
+ self.minimum = min(self.minimum, float(finite.min()))
154
+ self.maximum = max(self.maximum, float(finite.max()))
155
+
156
+ def as_dict(self) -> dict[str, float | int]:
157
+ if self.count == 0:
158
+ return {"count": 0, "mean": 0.0, "std": 1.0, "min": 0.0, "max": 0.0}
159
+ mean = self.total / self.count
160
+ variance = max(self.total_sq / self.count - mean * mean, 1e-12)
161
+ return {
162
+ "count": self.count,
163
+ "mean": mean,
164
+ "std": math.sqrt(variance),
165
+ "min": self.minimum,
166
+ "max": self.maximum,
167
+ }
models/third_party/ImageBind/.assets/bird_audio.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8b0c17e3b8b3e5b1324d83a8f598ac9129998877b697d32c194b2a1fe11681a
3
+ size 882078
models/third_party/ImageBind/.assets/bird_image.jpg ADDED

Git LFS Details

  • SHA256: 1d9d891f7785a0a7b85556f5c8e7bedd82edce78b46b7f55a569f4b2f3e9e5d1
  • Pointer size: 131 Bytes
  • Size of remote file: 115 kB
models/third_party/ImageBind/.assets/car_audio.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79e2335cf1fa4b0a6be7d2a93007f630acd89e178405ae2fabf45ee3af801fda
3
+ size 441044
models/third_party/ImageBind/.assets/car_image.jpg ADDED
models/third_party/ImageBind/.assets/dog_audio.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b4dca689971840c140e4d206ad43dc35ecf7c2c1b661f478268bc6de9ad50b3
3
+ size 460518
models/third_party/ImageBind/.assets/dog_image.jpg ADDED
models/third_party/ImageBind/.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ **__pycache__
2
+ .vscode
3
+ .idea/
4
+ .python-version
5
+ build/
6
+ imagebind.egg-info
7
+ .DS_Store
8
+ venv/
models/third_party/ImageBind/CODE_OF_CONDUCT.md ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to make participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies within all project spaces, and it also applies when
49
+ an individual is representing the project or its community in public spaces.
50
+ Examples of representing a project or community include using an official
51
+ project e-mail address, posting via an official social media account, or acting
52
+ as an appointed representative at an online or offline event. Representation of
53
+ a project may be further defined and clarified by project maintainers.
54
+
55
+ This Code of Conduct also applies outside the project spaces when there is a
56
+ reasonable belief that an individual's behavior may have a negative impact on
57
+ the project or its community.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported by contacting the project team at <opensource-conduct@fb.com>. All
63
+ complaints will be reviewed and investigated and will result in a response that
64
+ is deemed necessary and appropriate to the circumstances. The project team is
65
+ obligated to maintain confidentiality with regard to the reporter of an incident.
66
+ Further details of specific enforcement policies may be posted separately.
67
+
68
+ Project maintainers who do not follow or enforce the Code of Conduct in good
69
+ faith may face temporary or permanent repercussions as determined by other
70
+ members of the project's leadership.
71
+
72
+ ## Attribution
73
+
74
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
75
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
76
+
77
+ [homepage]: https://www.contributor-covenant.org
78
+
79
+ For answers to common questions about this code of conduct, see
80
+ https://www.contributor-covenant.org/faq
models/third_party/ImageBind/CONTRIBUTING.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing to ImageBind
2
+ We want to make contributing to this project as easy and transparent as
3
+ possible.
4
+
5
+ ## Pull Requests
6
+ We actively welcome your pull requests.
7
+
8
+ 1. Fork the repo and create your branch from `main`.
9
+ 2. If you've added code that should be tested, add tests.
10
+ 3. If you've changed APIs, update the documentation.
11
+ 4. Ensure the test suite passes.
12
+ 5. Make sure your code lints.
13
+ 6. If you haven't already, complete the Contributor License Agreement ("CLA").
14
+
15
+ ## Contributor License Agreement ("CLA")
16
+ In order to accept your pull request, we need you to submit a CLA. You only need
17
+ to do this once to work on any of Meta's open source projects.
18
+
19
+ Complete your CLA here: <https://code.facebook.com/cla>
20
+
21
+ ## Issues
22
+ We use GitHub issues to track public bugs. Please ensure your description is
23
+ clear and has sufficient instructions to be able to reproduce the issue.
24
+
25
+ Meta has a [bounty program](https://www.facebook.com/whitehat/) for the safe
26
+ disclosure of security bugs. In those cases, please go through the process
27
+ outlined on that page and do not file a public issue.
28
+
29
+ ## License
30
+ By contributing to Omnivore, you agree that your contributions will be licensed
31
+ under the [LICENSE](LICENSE) file in the root directory of this source tree.
models/third_party/ImageBind/LICENSE ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Attribution-NonCommercial-ShareAlike 4.0 International
2
+
3
+ =======================================================================
4
+
5
+ Creative Commons Corporation ("Creative Commons") is not a law firm and
6
+ does not provide legal services or legal advice. Distribution of
7
+ Creative Commons public licenses does not create a lawyer-client or
8
+ other relationship. Creative Commons makes its licenses and related
9
+ information available on an "as-is" basis. Creative Commons gives no
10
+ warranties regarding its licenses, any material licensed under their
11
+ terms and conditions, or any related information. Creative Commons
12
+ disclaims all liability for damages resulting from their use to the
13
+ fullest extent possible.
14
+
15
+ Using Creative Commons Public Licenses
16
+
17
+ Creative Commons public licenses provide a standard set of terms and
18
+ conditions that creators and other rights holders may use to share
19
+ original works of authorship and other material subject to copyright
20
+ and certain other rights specified in the public license below. The
21
+ following considerations are for informational purposes only, are not
22
+ exhaustive, and do not form part of our licenses.
23
+
24
+ Considerations for licensors: Our public licenses are
25
+ intended for use by those authorized to give the public
26
+ permission to use material in ways otherwise restricted by
27
+ copyright and certain other rights. Our licenses are
28
+ irrevocable. Licensors should read and understand the terms
29
+ and conditions of the license they choose before applying it.
30
+ Licensors should also secure all rights necessary before
31
+ applying our licenses so that the public can reuse the
32
+ material as expected. Licensors should clearly mark any
33
+ material not subject to the license. This includes other CC-
34
+ licensed material, or material used under an exception or
35
+ limitation to copyright. More considerations for licensors:
36
+ wiki.creativecommons.org/Considerations_for_licensors
37
+
38
+ Considerations for the public: By using one of our public
39
+ licenses, a licensor grants the public permission to use the
40
+ licensed material under specified terms and conditions. If
41
+ the licensor's permission is not necessary for any reason--for
42
+ example, because of any applicable exception or limitation to
43
+ copyright--then that use is not regulated by the license. Our
44
+ licenses grant only permissions under copyright and certain
45
+ other rights that a licensor has authority to grant. Use of
46
+ the licensed material may still be restricted for other
47
+ reasons, including because others have copyright or other
48
+ rights in the material. A licensor may make special requests,
49
+ such as asking that all changes be marked or described.
50
+ Although not required by our licenses, you are encouraged to
51
+ respect those requests where reasonable. More considerations
52
+ for the public:
53
+ wiki.creativecommons.org/Considerations_for_licensees
54
+
55
+ =======================================================================
56
+
57
+ Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
58
+ Public License
59
+
60
+ By exercising the Licensed Rights (defined below), You accept and agree
61
+ to be bound by the terms and conditions of this Creative Commons
62
+ Attribution-NonCommercial-ShareAlike 4.0 International Public License
63
+ ("Public License"). To the extent this Public License may be
64
+ interpreted as a contract, You are granted the Licensed Rights in
65
+ consideration of Your acceptance of these terms and conditions, and the
66
+ Licensor grants You such rights in consideration of benefits the
67
+ Licensor receives from making the Licensed Material available under
68
+ these terms and conditions.
69
+
70
+
71
+ Section 1 -- Definitions.
72
+
73
+ a. Adapted Material means material subject to Copyright and Similar
74
+ Rights that is derived from or based upon the Licensed Material
75
+ and in which the Licensed Material is translated, altered,
76
+ arranged, transformed, or otherwise modified in a manner requiring
77
+ permission under the Copyright and Similar Rights held by the
78
+ Licensor. For purposes of this Public License, where the Licensed
79
+ Material is a musical work, performance, or sound recording,
80
+ Adapted Material is always produced where the Licensed Material is
81
+ synched in timed relation with a moving image.
82
+
83
+ b. Adapter's License means the license You apply to Your Copyright
84
+ and Similar Rights in Your contributions to Adapted Material in
85
+ accordance with the terms and conditions of this Public License.
86
+
87
+ c. BY-NC-SA Compatible License means a license listed at
88
+ creativecommons.org/compatiblelicenses, approved by Creative
89
+ Commons as essentially the equivalent of this Public License.
90
+
91
+ d. Copyright and Similar Rights means copyright and/or similar rights
92
+ closely related to copyright including, without limitation,
93
+ performance, broadcast, sound recording, and Sui Generis Database
94
+ Rights, without regard to how the rights are labeled or
95
+ categorized. For purposes of this Public License, the rights
96
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
97
+ Rights.
98
+
99
+ e. Effective Technological Measures means those measures that, in the
100
+ absence of proper authority, may not be circumvented under laws
101
+ fulfilling obligations under Article 11 of the WIPO Copyright
102
+ Treaty adopted on December 20, 1996, and/or similar international
103
+ agreements.
104
+
105
+ f. Exceptions and Limitations means fair use, fair dealing, and/or
106
+ any other exception or limitation to Copyright and Similar Rights
107
+ that applies to Your use of the Licensed Material.
108
+
109
+ g. License Elements means the license attributes listed in the name
110
+ of a Creative Commons Public License. The License Elements of this
111
+ Public License are Attribution, NonCommercial, and ShareAlike.
112
+
113
+ h. Licensed Material means the artistic or literary work, database,
114
+ or other material to which the Licensor applied this Public
115
+ License.
116
+
117
+ i. Licensed Rights means the rights granted to You subject to the
118
+ terms and conditions of this Public License, which are limited to
119
+ all Copyright and Similar Rights that apply to Your use of the
120
+ Licensed Material and that the Licensor has authority to license.
121
+
122
+ j. Licensor means the individual(s) or entity(ies) granting rights
123
+ under this Public License.
124
+
125
+ k. NonCommercial means not primarily intended for or directed towards
126
+ commercial advantage or monetary compensation. For purposes of
127
+ this Public License, the exchange of the Licensed Material for
128
+ other material subject to Copyright and Similar Rights by digital
129
+ file-sharing or similar means is NonCommercial provided there is
130
+ no payment of monetary compensation in connection with the
131
+ exchange.
132
+
133
+ l. Share means to provide material to the public by any means or
134
+ process that requires permission under the Licensed Rights, such
135
+ as reproduction, public display, public performance, distribution,
136
+ dissemination, communication, or importation, and to make material
137
+ available to the public including in ways that members of the
138
+ public may access the material from a place and at a time
139
+ individually chosen by them.
140
+
141
+ m. Sui Generis Database Rights means rights other than copyright
142
+ resulting from Directive 96/9/EC of the European Parliament and of
143
+ the Council of 11 March 1996 on the legal protection of databases,
144
+ as amended and/or succeeded, as well as other essentially
145
+ equivalent rights anywhere in the world.
146
+
147
+ n. You means the individual or entity exercising the Licensed Rights
148
+ under this Public License. Your has a corresponding meaning.
149
+
150
+
151
+ Section 2 -- Scope.
152
+
153
+ a. License grant.
154
+
155
+ 1. Subject to the terms and conditions of this Public License,
156
+ the Licensor hereby grants You a worldwide, royalty-free,
157
+ non-sublicensable, non-exclusive, irrevocable license to
158
+ exercise the Licensed Rights in the Licensed Material to:
159
+
160
+ a. reproduce and Share the Licensed Material, in whole or
161
+ in part, for NonCommercial purposes only; and
162
+
163
+ b. produce, reproduce, and Share Adapted Material for
164
+ NonCommercial purposes only.
165
+
166
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
167
+ Exceptions and Limitations apply to Your use, this Public
168
+ License does not apply, and You do not need to comply with
169
+ its terms and conditions.
170
+
171
+ 3. Term. The term of this Public License is specified in Section
172
+ 6(a).
173
+
174
+ 4. Media and formats; technical modifications allowed. The
175
+ Licensor authorizes You to exercise the Licensed Rights in
176
+ all media and formats whether now known or hereafter created,
177
+ and to make technical modifications necessary to do so. The
178
+ Licensor waives and/or agrees not to assert any right or
179
+ authority to forbid You from making technical modifications
180
+ necessary to exercise the Licensed Rights, including
181
+ technical modifications necessary to circumvent Effective
182
+ Technological Measures. For purposes of this Public License,
183
+ simply making modifications authorized by this Section 2(a)
184
+ (4) never produces Adapted Material.
185
+
186
+ 5. Downstream recipients.
187
+
188
+ a. Offer from the Licensor -- Licensed Material. Every
189
+ recipient of the Licensed Material automatically
190
+ receives an offer from the Licensor to exercise the
191
+ Licensed Rights under the terms and conditions of this
192
+ Public License.
193
+
194
+ b. Additional offer from the Licensor -- Adapted Material.
195
+ Every recipient of Adapted Material from You
196
+ automatically receives an offer from the Licensor to
197
+ exercise the Licensed Rights in the Adapted Material
198
+ under the conditions of the Adapter's License You apply.
199
+
200
+ c. No downstream restrictions. You may not offer or impose
201
+ any additional or different terms or conditions on, or
202
+ apply any Effective Technological Measures to, the
203
+ Licensed Material if doing so restricts exercise of the
204
+ Licensed Rights by any recipient of the Licensed
205
+ Material.
206
+
207
+ 6. No endorsement. Nothing in this Public License constitutes or
208
+ may be construed as permission to assert or imply that You
209
+ are, or that Your use of the Licensed Material is, connected
210
+ with, or sponsored, endorsed, or granted official status by,
211
+ the Licensor or others designated to receive attribution as
212
+ provided in Section 3(a)(1)(A)(i).
213
+
214
+ b. Other rights.
215
+
216
+ 1. Moral rights, such as the right of integrity, are not
217
+ licensed under this Public License, nor are publicity,
218
+ privacy, and/or other similar personality rights; however, to
219
+ the extent possible, the Licensor waives and/or agrees not to
220
+ assert any such rights held by the Licensor to the limited
221
+ extent necessary to allow You to exercise the Licensed
222
+ Rights, but not otherwise.
223
+
224
+ 2. Patent and trademark rights are not licensed under this
225
+ Public License.
226
+
227
+ 3. To the extent possible, the Licensor waives any right to
228
+ collect royalties from You for the exercise of the Licensed
229
+ Rights, whether directly or through a collecting society
230
+ under any voluntary or waivable statutory or compulsory
231
+ licensing scheme. In all other cases the Licensor expressly
232
+ reserves any right to collect such royalties, including when
233
+ the Licensed Material is used other than for NonCommercial
234
+ purposes.
235
+
236
+
237
+ Section 3 -- License Conditions.
238
+
239
+ Your exercise of the Licensed Rights is expressly made subject to the
240
+ following conditions.
241
+
242
+ a. Attribution.
243
+
244
+ 1. If You Share the Licensed Material (including in modified
245
+ form), You must:
246
+
247
+ a. retain the following if it is supplied by the Licensor
248
+ with the Licensed Material:
249
+
250
+ i. identification of the creator(s) of the Licensed
251
+ Material and any others designated to receive
252
+ attribution, in any reasonable manner requested by
253
+ the Licensor (including by pseudonym if
254
+ designated);
255
+
256
+ ii. a copyright notice;
257
+
258
+ iii. a notice that refers to this Public License;
259
+
260
+ iv. a notice that refers to the disclaimer of
261
+ warranties;
262
+
263
+ v. a URI or hyperlink to the Licensed Material to the
264
+ extent reasonably practicable;
265
+
266
+ b. indicate if You modified the Licensed Material and
267
+ retain an indication of any previous modifications; and
268
+
269
+ c. indicate the Licensed Material is licensed under this
270
+ Public License, and include the text of, or the URI or
271
+ hyperlink to, this Public License.
272
+
273
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
274
+ reasonable manner based on the medium, means, and context in
275
+ which You Share the Licensed Material. For example, it may be
276
+ reasonable to satisfy the conditions by providing a URI or
277
+ hyperlink to a resource that includes the required
278
+ information.
279
+ 3. If requested by the Licensor, You must remove any of the
280
+ information required by Section 3(a)(1)(A) to the extent
281
+ reasonably practicable.
282
+
283
+ b. ShareAlike.
284
+
285
+ In addition to the conditions in Section 3(a), if You Share
286
+ Adapted Material You produce, the following conditions also apply.
287
+
288
+ 1. The Adapter's License You apply must be a Creative Commons
289
+ license with the same License Elements, this version or
290
+ later, or a BY-NC-SA Compatible License.
291
+
292
+ 2. You must include the text of, or the URI or hyperlink to, the
293
+ Adapter's License You apply. You may satisfy this condition
294
+ in any reasonable manner based on the medium, means, and
295
+ context in which You Share Adapted Material.
296
+
297
+ 3. You may not offer or impose any additional or different terms
298
+ or conditions on, or apply any Effective Technological
299
+ Measures to, Adapted Material that restrict exercise of the
300
+ rights granted under the Adapter's License You apply.
301
+
302
+
303
+ Section 4 -- Sui Generis Database Rights.
304
+
305
+ Where the Licensed Rights include Sui Generis Database Rights that
306
+ apply to Your use of the Licensed Material:
307
+
308
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
309
+ to extract, reuse, reproduce, and Share all or a substantial
310
+ portion of the contents of the database for NonCommercial purposes
311
+ only;
312
+
313
+ b. if You include all or a substantial portion of the database
314
+ contents in a database in which You have Sui Generis Database
315
+ Rights, then the database in which You have Sui Generis Database
316
+ Rights (but not its individual contents) is Adapted Material,
317
+ including for purposes of Section 3(b); and
318
+
319
+ c. You must comply with the conditions in Section 3(a) if You Share
320
+ all or a substantial portion of the contents of the database.
321
+
322
+ For the avoidance of doubt, this Section 4 supplements and does not
323
+ replace Your obligations under this Public License where the Licensed
324
+ Rights include other Copyright and Similar Rights.
325
+
326
+
327
+ Section 5 -- Disclaimer of Warranties and Limitation of Liability.
328
+
329
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
330
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
331
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
332
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
333
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
334
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
335
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
336
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
337
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
338
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
339
+
340
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
341
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
342
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
343
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
344
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
345
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
346
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
347
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
348
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
349
+
350
+ c. The disclaimer of warranties and limitation of liability provided
351
+ above shall be interpreted in a manner that, to the extent
352
+ possible, most closely approximates an absolute disclaimer and
353
+ waiver of all liability.
354
+
355
+
356
+ Section 6 -- Term and Termination.
357
+
358
+ a. This Public License applies for the term of the Copyright and
359
+ Similar Rights licensed here. However, if You fail to comply with
360
+ this Public License, then Your rights under this Public License
361
+ terminate automatically.
362
+
363
+ b. Where Your right to use the Licensed Material has terminated under
364
+ Section 6(a), it reinstates:
365
+
366
+ 1. automatically as of the date the violation is cured, provided
367
+ it is cured within 30 days of Your discovery of the
368
+ violation; or
369
+
370
+ 2. upon express reinstatement by the Licensor.
371
+
372
+ For the avoidance of doubt, this Section 6(b) does not affect any
373
+ right the Licensor may have to seek remedies for Your violations
374
+ of this Public License.
375
+
376
+ c. For the avoidance of doubt, the Licensor may also offer the
377
+ Licensed Material under separate terms or conditions or stop
378
+ distributing the Licensed Material at any time; however, doing so
379
+ will not terminate this Public License.
380
+
381
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
382
+ License.
383
+
384
+
385
+ Section 7 -- Other Terms and Conditions.
386
+
387
+ a. The Licensor shall not be bound by any additional or different
388
+ terms or conditions communicated by You unless expressly agreed.
389
+
390
+ b. Any arrangements, understandings, or agreements regarding the
391
+ Licensed Material not stated herein are separate from and
392
+ independent of the terms and conditions of this Public License.
393
+
394
+
395
+ Section 8 -- Interpretation.
396
+
397
+ a. For the avoidance of doubt, this Public License does not, and
398
+ shall not be interpreted to, reduce, limit, restrict, or impose
399
+ conditions on any use of the Licensed Material that could lawfully
400
+ be made without permission under this Public License.
401
+
402
+ b. To the extent possible, if any provision of this Public License is
403
+ deemed unenforceable, it shall be automatically reformed to the
404
+ minimum extent necessary to make it enforceable. If the provision
405
+ cannot be reformed, it shall be severed from this Public License
406
+ without affecting the enforceability of the remaining terms and
407
+ conditions.
408
+
409
+ c. No term or condition of this Public License will be waived and no
410
+ failure to comply consented to unless expressly agreed to by the
411
+ Licensor.
412
+
413
+ d. Nothing in this Public License constitutes or may be interpreted
414
+ as a limitation upon, or waiver of, any privileges and immunities
415
+ that apply to the Licensor or You, including from the legal
416
+ processes of any jurisdiction or authority.
417
+
418
+ =======================================================================
419
+
420
+ Creative Commons is not a party to its public
421
+ licenses. Notwithstanding, Creative Commons may elect to apply one of
422
+ its public licenses to material it publishes and in those instances
423
+ will be considered the “Licensor.” The text of the Creative Commons
424
+ public licenses is dedicated to the public domain under the CC0 Public
425
+ Domain Dedication. Except for the limited purpose of indicating that
426
+ material is shared under a Creative Commons public license or as
427
+ otherwise permitted by the Creative Commons policies published at
428
+ creativecommons.org/policies, Creative Commons does not authorize the
429
+ use of the trademark "Creative Commons" or any other trademark or logo
430
+ of Creative Commons without its prior written consent including,
431
+ without limitation, in connection with any unauthorized modifications
432
+ to any of its public licenses or any other arrangements,
433
+ understandings, or agreements concerning use of licensed material. For
434
+ the avoidance of doubt, this paragraph does not form part of the
435
+ public licenses.
436
+
437
+ Creative Commons may be contacted at creativecommons.org.
models/third_party/ImageBind/README.md ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ImageBind: One Embedding Space To Bind Them All
2
+
3
+ **[FAIR, Meta AI](https://ai.facebook.com/research/)**
4
+
5
+ Rohit Girdhar*,
6
+ Alaaeldin El-Nouby*,
7
+ Zhuang Liu,
8
+ Mannat Singh,
9
+ Kalyan Vasudev Alwala,
10
+ Armand Joulin,
11
+ Ishan Misra*
12
+
13
+ To appear at CVPR 2023 (*Highlighted paper*)
14
+
15
+ [[`Paper`](https://facebookresearch.github.io/ImageBind/paper)] [[`Blog`](https://ai.facebook.com/blog/imagebind-six-modalities-binding-ai/)] [[`Demo`](https://imagebind.metademolab.com/)] [[`Supplementary Video`](https://dl.fbaipublicfiles.com/imagebind/imagebind_video.mp4)] [[`BibTex`](#citing-imagebind)]
16
+
17
+ PyTorch implementation and pretrained models for ImageBind. For details, see the paper: **[ImageBind: One Embedding Space To Bind Them All](https://facebookresearch.github.io/ImageBind/paper)**.
18
+
19
+ ImageBind learns a joint embedding across six different modalities - images, text, audio, depth, thermal, and IMU data. It enables novel emergent applications ‘out-of-the-box’ including cross-modal retrieval, composing modalities with arithmetic, cross-modal detection and generation.
20
+
21
+
22
+
23
+ ![ImageBind](https://user-images.githubusercontent.com/8495451/236859695-ffa13364-3e39-4d99-a8da-fbfab17f9a6b.gif)
24
+
25
+ ## ImageBind model
26
+
27
+ Emergent zero-shot classification performance.
28
+
29
+ <table style="margin: auto">
30
+ <tr>
31
+ <th>Model</th>
32
+ <th><span style="color:blue">IN1k</span></th>
33
+ <th><span style="color:purple">K400</span></th>
34
+ <th><span style="color:green">NYU-D</span></th>
35
+ <th><span style="color:LightBlue">ESC</span></th>
36
+ <th><span style="color:orange">LLVIP</span></th>
37
+ <th><span style="color:purple">Ego4D</span></th>
38
+ <th>download</th>
39
+ </tr>
40
+ <tr>
41
+ <td>imagebind_huge</td>
42
+ <td align="right">77.7</td>
43
+ <td align="right">50.0</td>
44
+ <td align="right">54.0</td>
45
+ <td align="right">66.9</td>
46
+ <td align="right">63.4</td>
47
+ <td align="right">25.0</td>
48
+ <td><a href="https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth">checkpoint</a></td>
49
+ </tr>
50
+
51
+ </table>
52
+
53
+ ## Usage
54
+
55
+ Install pytorch 2.0+ and other 3rd party dependencies.
56
+
57
+ ```shell
58
+ conda create --name imagebind python=3.10 -y
59
+ conda activate imagebind
60
+
61
+ pip install .
62
+ ```
63
+
64
+ For windows users, you might need to install `soundfile` for reading/writing audio files. (Thanks @congyue1977)
65
+
66
+ ```
67
+ pip install soundfile
68
+ ```
69
+
70
+
71
+ Extract and compare features across modalities (e.g. Image, Text and Audio).
72
+
73
+ ```python
74
+ from imagebind import data
75
+ import torch
76
+ from imagebind.models import imagebind_model
77
+ from imagebind.models.imagebind_model import ModalityType
78
+
79
+ text_list=["A dog.", "A car", "A bird"]
80
+ image_paths=[".assets/dog_image.jpg", ".assets/car_image.jpg", ".assets/bird_image.jpg"]
81
+ audio_paths=[".assets/dog_audio.wav", ".assets/car_audio.wav", ".assets/bird_audio.wav"]
82
+
83
+ device = "cuda:0" if torch.cuda.is_available() else "cpu"
84
+
85
+ # Instantiate model
86
+ model = imagebind_model.imagebind_huge(pretrained=True)
87
+ model.eval()
88
+ model.to(device)
89
+
90
+ # Load data
91
+ inputs = {
92
+ ModalityType.TEXT: data.load_and_transform_text(text_list, device),
93
+ ModalityType.VISION: data.load_and_transform_vision_data(image_paths, device),
94
+ ModalityType.AUDIO: data.load_and_transform_audio_data(audio_paths, device),
95
+ }
96
+
97
+ with torch.no_grad():
98
+ embeddings = model(inputs)
99
+
100
+ print(
101
+ "Vision x Text: ",
102
+ torch.softmax(embeddings[ModalityType.VISION] @ embeddings[ModalityType.TEXT].T, dim=-1),
103
+ )
104
+ print(
105
+ "Audio x Text: ",
106
+ torch.softmax(embeddings[ModalityType.AUDIO] @ embeddings[ModalityType.TEXT].T, dim=-1),
107
+ )
108
+ print(
109
+ "Vision x Audio: ",
110
+ torch.softmax(embeddings[ModalityType.VISION] @ embeddings[ModalityType.AUDIO].T, dim=-1),
111
+ )
112
+
113
+ # Expected output:
114
+ #
115
+ # Vision x Text:
116
+ # tensor([[9.9761e-01, 2.3694e-03, 1.8612e-05],
117
+ # [3.3836e-05, 9.9994e-01, 2.4118e-05],
118
+ # [4.7997e-05, 1.3496e-02, 9.8646e-01]])
119
+ #
120
+ # Audio x Text:
121
+ # tensor([[1., 0., 0.],
122
+ # [0., 1., 0.],
123
+ # [0., 0., 1.]])
124
+ #
125
+ # Vision x Audio:
126
+ # tensor([[0.8070, 0.1088, 0.0842],
127
+ # [0.1036, 0.7884, 0.1079],
128
+ # [0.0018, 0.0022, 0.9960]])
129
+
130
+ ```
131
+
132
+ ## Model card
133
+ Please see the [model card](model_card.md) for details.
134
+
135
+ ## License
136
+
137
+ ImageBind code and model weights are released under the CC-BY-NC 4.0 license. See [LICENSE](LICENSE) for additional details.
138
+
139
+ ## Contributing
140
+
141
+ See [contributing](CONTRIBUTING.md) and the [code of conduct](CODE_OF_CONDUCT.md).
142
+
143
+ ## Citing ImageBind
144
+
145
+ If you find this repository useful, please consider giving a star :star: and citation
146
+
147
+ ```
148
+ @inproceedings{girdhar2023imagebind,
149
+ title={ImageBind: One Embedding Space To Bind Them All},
150
+ author={Girdhar, Rohit and El-Nouby, Alaaeldin and Liu, Zhuang
151
+ and Singh, Mannat and Alwala, Kalyan Vasudev and Joulin, Armand and Misra, Ishan},
152
+ booktitle={CVPR},
153
+ year={2023}
154
+ }
155
+ ```
models/third_party/ImageBind/imagebind/__init__.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ from imagebind import data
2
+ from imagebind.models import imagebind_model
3
+ from imagebind.models.imagebind_model import ModalityType
models/third_party/ImageBind/imagebind/bpe/bpe_simple_vocab_16e6.txt.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:924691ac288e54409236115652ad4aa250f48203de50a9e4722a6ecd48d6804a
3
+ size 1356917
models/third_party/ImageBind/imagebind/data.py ADDED
@@ -0,0 +1,357 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # Portions Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+
5
+ # This source code is licensed under the license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
8
+ import logging
9
+ import math
10
+ import pkg_resources
11
+
12
+ import torch
13
+ import torch.nn as nn
14
+ import torchaudio
15
+ from PIL import Image
16
+ from pytorchvideo import transforms as pv_transforms
17
+ from pytorchvideo.data.clip_sampling import ConstantClipsPerVideoSampler
18
+ from pytorchvideo.data.encoded_video import EncodedVideo
19
+ from torchvision import transforms
20
+
21
+ from imagebind.models.multimodal_preprocessors import SimpleTokenizer
22
+
23
+ DEFAULT_AUDIO_FRAME_SHIFT_MS = 10 # in milliseconds
24
+
25
+
26
+ def return_bpe_path():
27
+ return pkg_resources.resource_filename(
28
+ "imagebind", "bpe/bpe_simple_vocab_16e6.txt.gz"
29
+ )
30
+
31
+
32
+ def waveform2melspec(waveform, sample_rate, num_mel_bins, target_length):
33
+ # Based on https://github.com/YuanGongND/ast/blob/d7d8b4b8e06cdaeb6c843cdb38794c1c7692234c/src/dataloader.py#L102
34
+ waveform -= waveform.mean()
35
+ fbank = torchaudio.compliance.kaldi.fbank(
36
+ waveform,
37
+ htk_compat=True,
38
+ sample_frequency=sample_rate,
39
+ use_energy=False,
40
+ window_type="hanning",
41
+ num_mel_bins=num_mel_bins,
42
+ dither=0.0,
43
+ frame_length=25,
44
+ frame_shift=DEFAULT_AUDIO_FRAME_SHIFT_MS,
45
+ )
46
+ # Convert to [mel_bins, num_frames] shape
47
+ fbank = fbank.transpose(0, 1)
48
+ # Pad to target_length
49
+ n_frames = fbank.size(1)
50
+ p = target_length - n_frames
51
+ # if p is too large (say >20%), flash a warning
52
+ if abs(p) / n_frames > 0.2:
53
+ logging.warning(
54
+ "Large gap between audio n_frames(%d) and "
55
+ "target_length (%d). Is the audio_target_length "
56
+ "setting correct?",
57
+ n_frames,
58
+ target_length,
59
+ )
60
+ # cut and pad
61
+ if p > 0:
62
+ fbank = torch.nn.functional.pad(fbank, (0, p), mode="constant", value=0)
63
+ elif p < 0:
64
+ fbank = fbank[:, 0:target_length]
65
+ # Convert to [1, mel_bins, num_frames] shape, essentially like a 1
66
+ # channel image
67
+ fbank = fbank.unsqueeze(0)
68
+ return fbank
69
+
70
+
71
+ def get_clip_timepoints(clip_sampler, duration):
72
+ # Read out all clips in this video
73
+ all_clips_timepoints = []
74
+ is_last_clip = False
75
+ end = 0.0
76
+ while not is_last_clip:
77
+ start, end, _, _, is_last_clip = clip_sampler(end, duration, annotation=None)
78
+ all_clips_timepoints.append((start, end))
79
+ return all_clips_timepoints
80
+
81
+
82
+ def load_and_transform_vision_data(image_paths, device):
83
+ if image_paths is None:
84
+ return None
85
+
86
+ image_outputs = []
87
+
88
+ data_transform = transforms.Compose(
89
+ [
90
+ transforms.Resize(224, interpolation=transforms.InterpolationMode.BICUBIC),
91
+ transforms.CenterCrop(224),
92
+ transforms.ToTensor(),
93
+ transforms.Normalize(
94
+ mean=(0.48145466, 0.4578275, 0.40821073),
95
+ std=(0.26862954, 0.26130258, 0.27577711),
96
+ ),
97
+ ]
98
+ )
99
+
100
+ for image_path in image_paths:
101
+ with open(image_path, "rb") as fopen:
102
+ image = Image.open(fopen).convert("RGB")
103
+
104
+ image = data_transform(image).to(device)
105
+ image_outputs.append(image)
106
+ return torch.stack(image_outputs, dim=0)
107
+
108
+
109
+ def load_and_transform_text(text, device):
110
+ if text is None:
111
+ return None
112
+ tokenizer = SimpleTokenizer(bpe_path=return_bpe_path())
113
+ tokens = [tokenizer(t).unsqueeze(0).to(device) for t in text]
114
+ tokens = torch.cat(tokens, dim=0)
115
+ return tokens
116
+
117
+
118
+ def load_and_transform_audio_data(
119
+ audio_paths,
120
+ device,
121
+ num_mel_bins=128,
122
+ target_length=204,
123
+ sample_rate=16000,
124
+ clip_duration=2,
125
+ clips_per_video=3,
126
+ mean=-4.268,
127
+ std=9.138,
128
+ ):
129
+ if audio_paths is None:
130
+ return None
131
+
132
+ audio_outputs = []
133
+ clip_sampler = ConstantClipsPerVideoSampler(
134
+ clip_duration=clip_duration, clips_per_video=clips_per_video
135
+ )
136
+
137
+ for audio_path in audio_paths:
138
+ waveform, sr = torchaudio.load(audio_path)
139
+ if sample_rate != sr:
140
+ waveform = torchaudio.functional.resample(
141
+ waveform, orig_freq=sr, new_freq=sample_rate
142
+ )
143
+ all_clips_timepoints = get_clip_timepoints(
144
+ clip_sampler, waveform.size(1) / sample_rate
145
+ )
146
+ all_clips = []
147
+ for clip_timepoints in all_clips_timepoints:
148
+ waveform_clip = waveform[
149
+ :,
150
+ int(clip_timepoints[0] * sample_rate) : int(
151
+ clip_timepoints[1] * sample_rate
152
+ ),
153
+ ]
154
+ waveform_melspec = waveform2melspec(
155
+ waveform_clip, sample_rate, num_mel_bins, target_length
156
+ )
157
+ all_clips.append(waveform_melspec)
158
+
159
+ normalize = transforms.Normalize(mean=mean, std=std)
160
+ all_clips = [normalize(ac).to(device) for ac in all_clips]
161
+
162
+ all_clips = torch.stack(all_clips, dim=0)
163
+ audio_outputs.append(all_clips)
164
+
165
+ return torch.stack(audio_outputs, dim=0)
166
+
167
+
168
+ def crop_boxes(boxes, x_offset, y_offset):
169
+ """
170
+ Perform crop on the bounding boxes given the offsets.
171
+ Args:
172
+ boxes (ndarray or None): bounding boxes to perform crop. The dimension
173
+ is `num boxes` x 4.
174
+ x_offset (int): cropping offset in the x axis.
175
+ y_offset (int): cropping offset in the y axis.
176
+ Returns:
177
+ cropped_boxes (ndarray or None): the cropped boxes with dimension of
178
+ `num boxes` x 4.
179
+ """
180
+ cropped_boxes = boxes.copy()
181
+ cropped_boxes[:, [0, 2]] = boxes[:, [0, 2]] - x_offset
182
+ cropped_boxes[:, [1, 3]] = boxes[:, [1, 3]] - y_offset
183
+
184
+ return cropped_boxes
185
+
186
+
187
+ def uniform_crop(images, size, spatial_idx, boxes=None, scale_size=None):
188
+ """
189
+ Perform uniform spatial sampling on the images and corresponding boxes.
190
+ Args:
191
+ images (tensor): images to perform uniform crop. The dimension is
192
+ `num frames` x `channel` x `height` x `width`.
193
+ size (int): size of height and weight to crop the images.
194
+ spatial_idx (int): 0, 1, or 2 for left, center, and right crop if width
195
+ is larger than height. Or 0, 1, or 2 for top, center, and bottom
196
+ crop if height is larger than width.
197
+ boxes (ndarray or None): optional. Corresponding boxes to images.
198
+ Dimension is `num boxes` x 4.
199
+ scale_size (int): optinal. If not None, resize the images to scale_size before
200
+ performing any crop.
201
+ Returns:
202
+ cropped (tensor): images with dimension of
203
+ `num frames` x `channel` x `size` x `size`.
204
+ cropped_boxes (ndarray or None): the cropped boxes with dimension of
205
+ `num boxes` x 4.
206
+ """
207
+ assert spatial_idx in [0, 1, 2]
208
+ ndim = len(images.shape)
209
+ if ndim == 3:
210
+ images = images.unsqueeze(0)
211
+ height = images.shape[2]
212
+ width = images.shape[3]
213
+
214
+ if scale_size is not None:
215
+ if width <= height:
216
+ width, height = scale_size, int(height / width * scale_size)
217
+ else:
218
+ width, height = int(width / height * scale_size), scale_size
219
+ images = torch.nn.functional.interpolate(
220
+ images,
221
+ size=(height, width),
222
+ mode="bilinear",
223
+ align_corners=False,
224
+ )
225
+
226
+ y_offset = int(math.ceil((height - size) / 2))
227
+ x_offset = int(math.ceil((width - size) / 2))
228
+
229
+ if height > width:
230
+ if spatial_idx == 0:
231
+ y_offset = 0
232
+ elif spatial_idx == 2:
233
+ y_offset = height - size
234
+ else:
235
+ if spatial_idx == 0:
236
+ x_offset = 0
237
+ elif spatial_idx == 2:
238
+ x_offset = width - size
239
+ cropped = images[:, :, y_offset : y_offset + size, x_offset : x_offset + size]
240
+ cropped_boxes = crop_boxes(boxes, x_offset, y_offset) if boxes is not None else None
241
+ if ndim == 3:
242
+ cropped = cropped.squeeze(0)
243
+ return cropped, cropped_boxes
244
+
245
+
246
+ class SpatialCrop(nn.Module):
247
+ """
248
+ Convert the video into 3 smaller clips spatially. Must be used after the
249
+ temporal crops to get spatial crops, and should be used with
250
+ -2 in the spatial crop at the slowfast augmentation stage (so full
251
+ frames are passed in here). Will return a larger list with the
252
+ 3x spatial crops as well.
253
+ """
254
+
255
+ def __init__(self, crop_size: int = 224, num_crops: int = 3):
256
+ super().__init__()
257
+ self.crop_size = crop_size
258
+ if num_crops == 3:
259
+ self.crops_to_ext = [0, 1, 2]
260
+ self.flipped_crops_to_ext = []
261
+ elif num_crops == 1:
262
+ self.crops_to_ext = [1]
263
+ self.flipped_crops_to_ext = []
264
+ else:
265
+ raise NotImplementedError("Nothing else supported yet")
266
+
267
+ def forward(self, videos):
268
+ """
269
+ Args:
270
+ videos: A list of C, T, H, W videos.
271
+ Returns:
272
+ videos: A list with 3x the number of elements. Each video converted
273
+ to C, T, H', W' by spatial cropping.
274
+ """
275
+ assert isinstance(videos, list), "Must be a list of videos after temporal crops"
276
+ assert all([video.ndim == 4 for video in videos]), "Must be (C,T,H,W)"
277
+ res = []
278
+ for video in videos:
279
+ for spatial_idx in self.crops_to_ext:
280
+ res.append(uniform_crop(video, self.crop_size, spatial_idx)[0])
281
+ if not self.flipped_crops_to_ext:
282
+ continue
283
+ flipped_video = transforms.functional.hflip(video)
284
+ for spatial_idx in self.flipped_crops_to_ext:
285
+ res.append(uniform_crop(flipped_video, self.crop_size, spatial_idx)[0])
286
+ return res
287
+
288
+
289
+ class NormalizeVideo:
290
+ def __init__(self, mean, std, inplace=False):
291
+ self.mean = mean
292
+ self.std = std
293
+ self.inplace = inplace
294
+
295
+ def __call__(self, clip):
296
+ if not self.inplace:
297
+ clip = clip.clone()
298
+ mean = torch.as_tensor(self.mean, dtype=clip.dtype, device=clip.device)
299
+ std = torch.as_tensor(self.std, dtype=clip.dtype, device=clip.device)
300
+ clip.sub_(mean[:, None, None, None]).div_(std[:, None, None, None])
301
+ return clip
302
+
303
+
304
+ def load_and_transform_video_data(
305
+ video_paths,
306
+ device,
307
+ clip_duration=2,
308
+ clips_per_video=5,
309
+ sample_rate=16000,
310
+ ):
311
+ if video_paths is None:
312
+ return None
313
+
314
+ video_outputs = []
315
+ video_transform = transforms.Compose(
316
+ [
317
+ pv_transforms.ShortSideScale(224),
318
+ NormalizeVideo(
319
+ mean=(0.48145466, 0.4578275, 0.40821073),
320
+ std=(0.26862954, 0.26130258, 0.27577711),
321
+ ),
322
+ ]
323
+ )
324
+
325
+ clip_sampler = ConstantClipsPerVideoSampler(
326
+ clip_duration=clip_duration, clips_per_video=clips_per_video
327
+ )
328
+ frame_sampler = pv_transforms.UniformTemporalSubsample(num_samples=clip_duration)
329
+
330
+ for video_path in video_paths:
331
+ video = EncodedVideo.from_path(
332
+ video_path,
333
+ decoder="decord",
334
+ decode_audio=False,
335
+ **{"sample_rate": sample_rate},
336
+ )
337
+
338
+ all_clips_timepoints = get_clip_timepoints(clip_sampler, video.duration)
339
+
340
+ all_video = []
341
+ for clip_timepoints in all_clips_timepoints:
342
+ # Read the clip, get frames
343
+ clip = video.get_clip(clip_timepoints[0], clip_timepoints[1])
344
+ if clip is None:
345
+ raise ValueError("No clip found")
346
+ video_clip = frame_sampler(clip["video"])
347
+ video_clip = video_clip / 255.0 # since this is float, need 0-1
348
+
349
+ all_video.append(video_clip)
350
+
351
+ all_video = [video_transform(clip) for clip in all_video]
352
+ all_video = SpatialCrop(224, num_crops=3)(all_video)
353
+
354
+ all_video = torch.stack(all_video, dim=0)
355
+ video_outputs.append(all_video)
356
+
357
+ return torch.stack(video_outputs, dim=0).to(device)
models/third_party/ImageBind/imagebind/models/__init__.py ADDED
File without changes
models/third_party/ImageBind/imagebind/models/helpers.py ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # Portions Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+
5
+ # This source code is licensed under the license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
8
+
9
+ import einops
10
+ import numpy as np
11
+ import torch
12
+ import torch.nn as nn
13
+
14
+
15
+ class Normalize(nn.Module):
16
+ def __init__(self, dim: int) -> None:
17
+ super().__init__()
18
+ self.dim = dim
19
+
20
+ def forward(self, x):
21
+ return torch.nn.functional.normalize(x, dim=self.dim, p=2)
22
+
23
+
24
+ class LearnableLogitScaling(nn.Module):
25
+ def __init__(
26
+ self,
27
+ logit_scale_init: float = 1 / 0.07,
28
+ learnable: bool = True,
29
+ max_logit_scale: float = 100,
30
+ ) -> None:
31
+ super().__init__()
32
+ self.max_logit_scale = max_logit_scale
33
+ self.logit_scale_init = logit_scale_init
34
+ self.learnable = learnable
35
+ log_logit_scale = torch.ones([]) * np.log(self.logit_scale_init)
36
+ if learnable:
37
+ self.log_logit_scale = nn.Parameter(log_logit_scale)
38
+ else:
39
+ self.register_buffer("log_logit_scale", log_logit_scale)
40
+
41
+ def forward(self, x):
42
+ return torch.clip(self.log_logit_scale.exp(), max=self.max_logit_scale) * x
43
+
44
+ def extra_repr(self):
45
+ st = f"logit_scale_init={self.logit_scale_init},learnable={self.learnable}," \
46
+ f" max_logit_scale={self.max_logit_scale}"
47
+ return st
48
+
49
+
50
+ class EinOpsRearrange(nn.Module):
51
+ def __init__(self, rearrange_expr: str, **kwargs) -> None:
52
+ super().__init__()
53
+ self.rearrange_expr = rearrange_expr
54
+ self.kwargs = kwargs
55
+
56
+ def forward(self, x):
57
+ assert isinstance(x, torch.Tensor)
58
+ return einops.rearrange(x, self.rearrange_expr, **self.kwargs)
59
+
60
+
61
+ class VerboseNNModule(nn.Module):
62
+ """
63
+ Wrapper around nn.Module that prints registered buffers and parameter names.
64
+ """
65
+
66
+ @staticmethod
67
+ def get_readable_tensor_repr(name: str, tensor: torch.Tensor) -> str:
68
+ st = (
69
+ "("
70
+ + name
71
+ + "): "
72
+ + "tensor("
73
+ + str(tuple(tensor[1].shape))
74
+ + ", requires_grad="
75
+ + str(tensor[1].requires_grad)
76
+ + ")\n"
77
+ )
78
+ return st
79
+
80
+ def extra_repr(self) -> str:
81
+ named_modules = set()
82
+ for p in self.named_modules():
83
+ named_modules.update([p[0]])
84
+ named_modules = list(named_modules)
85
+
86
+ string_repr = ""
87
+ for p in self.named_parameters():
88
+ name = p[0].split(".")[0]
89
+ if name not in named_modules:
90
+ string_repr += self.get_readable_tensor_repr(name, p)
91
+
92
+ for p in self.named_buffers():
93
+ name = p[0].split(".")[0]
94
+ string_repr += self.get_readable_tensor_repr(name, p)
95
+
96
+ return string_repr
97
+
98
+
99
+ def cast_if_src_dtype(
100
+ tensor: torch.Tensor, src_dtype: torch.dtype, tgt_dtype: torch.dtype
101
+ ):
102
+ updated = False
103
+ if tensor.dtype == src_dtype:
104
+ tensor = tensor.to(dtype=tgt_dtype)
105
+ updated = True
106
+ return tensor, updated
107
+
108
+
109
+ class QuickGELU(nn.Module):
110
+ # From https://github.com/openai/CLIP/blob/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1/clip/model.py#L166
111
+ def forward(self, x: torch.Tensor):
112
+ return x * torch.sigmoid(1.702 * x)
113
+
114
+
115
+ class SelectElement(nn.Module):
116
+ def __init__(self, index) -> None:
117
+ super().__init__()
118
+ self.index = index
119
+
120
+ def forward(self, x):
121
+ assert x.ndim >= 3
122
+ return x[:, self.index, ...]
123
+
124
+
125
+ class SelectEOSAndProject(nn.Module):
126
+ """
127
+ Text Pooling used in OpenCLIP
128
+ """
129
+
130
+ def __init__(self, proj: nn.Module) -> None:
131
+ super().__init__()
132
+ self.proj = proj
133
+
134
+ def forward(self, x, seq_len):
135
+ assert x.ndim == 3
136
+ # x is of shape B x L x D
137
+ # take features from the eot embedding (eot_token is the highest number in each sequence)
138
+ x = x[torch.arange(x.shape[0]), seq_len]
139
+ x = self.proj(x)
140
+ return x
models/third_party/ImageBind/imagebind/models/imagebind_model.py ADDED
@@ -0,0 +1,506 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # Portions Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+
5
+ # This source code is licensed under the license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
8
+
9
+ import os
10
+ from functools import partial
11
+ from types import SimpleNamespace
12
+
13
+ import torch
14
+ import torch.nn as nn
15
+
16
+ from imagebind.models.helpers import (EinOpsRearrange, LearnableLogitScaling, Normalize,
17
+ SelectElement, SelectEOSAndProject)
18
+ from imagebind.models.multimodal_preprocessors import (AudioPreprocessor,
19
+ IMUPreprocessor, PadIm2Video,
20
+ PatchEmbedGeneric,
21
+ RGBDTPreprocessor,
22
+ SpatioTemporalPosEmbeddingHelper,
23
+ TextPreprocessor,
24
+ ThermalPreprocessor)
25
+ from imagebind.models.transformer import MultiheadAttention, SimpleTransformer
26
+
27
+ ModalityType = SimpleNamespace(
28
+ VISION="vision",
29
+ TEXT="text",
30
+ AUDIO="audio",
31
+ THERMAL="thermal",
32
+ DEPTH="depth",
33
+ IMU="imu",
34
+ )
35
+
36
+
37
+ class ImageBindModel(nn.Module):
38
+ def __init__(
39
+ self,
40
+ video_frames=2,
41
+ kernel_size=(2, 14, 14),
42
+ audio_kernel_size=16,
43
+ audio_stride=10,
44
+ out_embed_dim=768,
45
+ vision_embed_dim=1024,
46
+ vision_num_blocks=24,
47
+ vision_num_heads=16,
48
+ audio_embed_dim=768,
49
+ audio_num_blocks=12,
50
+ audio_num_heads=12,
51
+ audio_num_mel_bins=128,
52
+ audio_target_len=204,
53
+ audio_drop_path=0.1,
54
+ text_embed_dim=768,
55
+ text_num_blocks=12,
56
+ text_num_heads=12,
57
+ depth_embed_dim=384,
58
+ depth_kernel_size=16,
59
+ depth_num_blocks=12,
60
+ depth_num_heads=8,
61
+ depth_drop_path=0.0,
62
+ thermal_embed_dim=768,
63
+ thermal_kernel_size=16,
64
+ thermal_num_blocks=12,
65
+ thermal_num_heads=12,
66
+ thermal_drop_path=0.0,
67
+ imu_embed_dim=512,
68
+ imu_kernel_size=8,
69
+ imu_num_blocks=6,
70
+ imu_num_heads=8,
71
+ imu_drop_path=0.7,
72
+ ):
73
+ super().__init__()
74
+
75
+ self.modality_preprocessors = self._create_modality_preprocessors(
76
+ video_frames,
77
+ vision_embed_dim,
78
+ kernel_size,
79
+ text_embed_dim,
80
+ audio_embed_dim,
81
+ audio_kernel_size,
82
+ audio_stride,
83
+ audio_num_mel_bins,
84
+ audio_target_len,
85
+ depth_embed_dim,
86
+ depth_kernel_size,
87
+ thermal_embed_dim,
88
+ thermal_kernel_size,
89
+ imu_embed_dim,
90
+ )
91
+
92
+ self.modality_trunks = self._create_modality_trunks(
93
+ vision_embed_dim,
94
+ vision_num_blocks,
95
+ vision_num_heads,
96
+ text_embed_dim,
97
+ text_num_blocks,
98
+ text_num_heads,
99
+ audio_embed_dim,
100
+ audio_num_blocks,
101
+ audio_num_heads,
102
+ audio_drop_path,
103
+ depth_embed_dim,
104
+ depth_num_blocks,
105
+ depth_num_heads,
106
+ depth_drop_path,
107
+ thermal_embed_dim,
108
+ thermal_num_blocks,
109
+ thermal_num_heads,
110
+ thermal_drop_path,
111
+ imu_embed_dim,
112
+ imu_num_blocks,
113
+ imu_num_heads,
114
+ imu_drop_path,
115
+ )
116
+
117
+ self.modality_heads = self._create_modality_heads(
118
+ out_embed_dim,
119
+ vision_embed_dim,
120
+ text_embed_dim,
121
+ audio_embed_dim,
122
+ depth_embed_dim,
123
+ thermal_embed_dim,
124
+ imu_embed_dim,
125
+ )
126
+
127
+ self.modality_postprocessors = self._create_modality_postprocessors(
128
+ out_embed_dim
129
+ )
130
+
131
+ def _create_modality_preprocessors(
132
+ self,
133
+ video_frames=2,
134
+ vision_embed_dim=1024,
135
+ kernel_size=(2, 14, 14),
136
+ text_embed_dim=768,
137
+ audio_embed_dim=768,
138
+ audio_kernel_size=16,
139
+ audio_stride=10,
140
+ audio_num_mel_bins=128,
141
+ audio_target_len=204,
142
+ depth_embed_dim=768,
143
+ depth_kernel_size=16,
144
+ thermal_embed_dim=768,
145
+ thermal_kernel_size=16,
146
+ imu_embed_dim=512,
147
+ ):
148
+ rgbt_stem = PatchEmbedGeneric(
149
+ proj_stem=[
150
+ PadIm2Video(pad_type="repeat", ntimes=2),
151
+ nn.Conv3d(
152
+ in_channels=3,
153
+ kernel_size=kernel_size,
154
+ out_channels=vision_embed_dim,
155
+ stride=kernel_size,
156
+ bias=False,
157
+ ),
158
+ ]
159
+ )
160
+ rgbt_preprocessor = RGBDTPreprocessor(
161
+ img_size=[3, video_frames, 224, 224],
162
+ num_cls_tokens=1,
163
+ pos_embed_fn=partial(SpatioTemporalPosEmbeddingHelper, learnable=True),
164
+ rgbt_stem=rgbt_stem,
165
+ depth_stem=None,
166
+ )
167
+
168
+ text_preprocessor = TextPreprocessor(
169
+ context_length=77,
170
+ vocab_size=49408,
171
+ embed_dim=text_embed_dim,
172
+ causal_masking=True,
173
+ )
174
+
175
+ audio_stem = PatchEmbedGeneric(
176
+ proj_stem=[
177
+ nn.Conv2d(
178
+ in_channels=1,
179
+ kernel_size=audio_kernel_size,
180
+ stride=audio_stride,
181
+ out_channels=audio_embed_dim,
182
+ bias=False,
183
+ ),
184
+ ],
185
+ norm_layer=nn.LayerNorm(normalized_shape=audio_embed_dim),
186
+ )
187
+ audio_preprocessor = AudioPreprocessor(
188
+ img_size=[1, audio_num_mel_bins, audio_target_len],
189
+ num_cls_tokens=1,
190
+ pos_embed_fn=partial(SpatioTemporalPosEmbeddingHelper, learnable=True),
191
+ audio_stem=audio_stem,
192
+ )
193
+
194
+ depth_stem = PatchEmbedGeneric(
195
+ [
196
+ nn.Conv2d(
197
+ kernel_size=depth_kernel_size,
198
+ in_channels=1,
199
+ out_channels=depth_embed_dim,
200
+ stride=depth_kernel_size,
201
+ bias=False,
202
+ ),
203
+ ],
204
+ norm_layer=nn.LayerNorm(normalized_shape=depth_embed_dim),
205
+ )
206
+
207
+ depth_preprocessor = RGBDTPreprocessor(
208
+ img_size=[1, 224, 224],
209
+ num_cls_tokens=1,
210
+ pos_embed_fn=partial(SpatioTemporalPosEmbeddingHelper, learnable=True),
211
+ rgbt_stem=None,
212
+ depth_stem=depth_stem,
213
+ )
214
+
215
+ thermal_stem = PatchEmbedGeneric(
216
+ [
217
+ nn.Conv2d(
218
+ kernel_size=thermal_kernel_size,
219
+ in_channels=1,
220
+ out_channels=thermal_embed_dim,
221
+ stride=thermal_kernel_size,
222
+ bias=False,
223
+ ),
224
+ ],
225
+ norm_layer=nn.LayerNorm(normalized_shape=thermal_embed_dim),
226
+ )
227
+ thermal_preprocessor = ThermalPreprocessor(
228
+ img_size=[1, 224, 224],
229
+ num_cls_tokens=1,
230
+ pos_embed_fn=partial(SpatioTemporalPosEmbeddingHelper, learnable=True),
231
+ thermal_stem=thermal_stem,
232
+ )
233
+
234
+ imu_stem = PatchEmbedGeneric(
235
+ [
236
+ nn.Linear(
237
+ in_features=48,
238
+ out_features=imu_embed_dim,
239
+ bias=False,
240
+ ),
241
+ ],
242
+ norm_layer=nn.LayerNorm(normalized_shape=imu_embed_dim),
243
+ )
244
+
245
+ imu_preprocessor = IMUPreprocessor(
246
+ img_size=[6, 2000],
247
+ num_cls_tokens=1,
248
+ kernel_size=8,
249
+ embed_dim=imu_embed_dim,
250
+ pos_embed_fn=partial(SpatioTemporalPosEmbeddingHelper, learnable=True),
251
+ imu_stem=imu_stem,
252
+ )
253
+
254
+ modality_preprocessors = {
255
+ ModalityType.VISION: rgbt_preprocessor,
256
+ ModalityType.TEXT: text_preprocessor,
257
+ ModalityType.AUDIO: audio_preprocessor,
258
+ ModalityType.DEPTH: depth_preprocessor,
259
+ ModalityType.THERMAL: thermal_preprocessor,
260
+ ModalityType.IMU: imu_preprocessor,
261
+ }
262
+
263
+ return nn.ModuleDict(modality_preprocessors)
264
+
265
+ def _create_modality_trunks(
266
+ self,
267
+ vision_embed_dim=1024,
268
+ vision_num_blocks=24,
269
+ vision_num_heads=16,
270
+ text_embed_dim=768,
271
+ text_num_blocks=12,
272
+ text_num_heads=12,
273
+ audio_embed_dim=768,
274
+ audio_num_blocks=12,
275
+ audio_num_heads=12,
276
+ audio_drop_path=0.0,
277
+ depth_embed_dim=768,
278
+ depth_num_blocks=12,
279
+ depth_num_heads=12,
280
+ depth_drop_path=0.0,
281
+ thermal_embed_dim=768,
282
+ thermal_num_blocks=12,
283
+ thermal_num_heads=12,
284
+ thermal_drop_path=0.0,
285
+ imu_embed_dim=512,
286
+ imu_num_blocks=6,
287
+ imu_num_heads=8,
288
+ imu_drop_path=0.7,
289
+ ):
290
+ def instantiate_trunk(
291
+ embed_dim, num_blocks, num_heads, pre_transformer_ln, add_bias_kv, drop_path
292
+ ):
293
+ return SimpleTransformer(
294
+ embed_dim=embed_dim,
295
+ num_blocks=num_blocks,
296
+ ffn_dropout_rate=0.0,
297
+ drop_path_rate=drop_path,
298
+ attn_target=partial(
299
+ MultiheadAttention,
300
+ embed_dim=embed_dim,
301
+ num_heads=num_heads,
302
+ bias=True,
303
+ add_bias_kv=add_bias_kv,
304
+ ),
305
+ pre_transformer_layer=nn.Sequential(
306
+ nn.LayerNorm(embed_dim, eps=1e-6)
307
+ if pre_transformer_ln
308
+ else nn.Identity(),
309
+ EinOpsRearrange("b l d -> l b d"),
310
+ ),
311
+ post_transformer_layer=EinOpsRearrange("l b d -> b l d"),
312
+ )
313
+
314
+ modality_trunks = {}
315
+ modality_trunks[ModalityType.VISION] = instantiate_trunk(
316
+ vision_embed_dim,
317
+ vision_num_blocks,
318
+ vision_num_heads,
319
+ pre_transformer_ln=True,
320
+ add_bias_kv=False,
321
+ drop_path=0.0,
322
+ )
323
+ modality_trunks[ModalityType.TEXT] = instantiate_trunk(
324
+ text_embed_dim,
325
+ text_num_blocks,
326
+ text_num_heads,
327
+ pre_transformer_ln=False,
328
+ add_bias_kv=False,
329
+ drop_path=0.0,
330
+ )
331
+ modality_trunks[ModalityType.AUDIO] = instantiate_trunk(
332
+ audio_embed_dim,
333
+ audio_num_blocks,
334
+ audio_num_heads,
335
+ pre_transformer_ln=False,
336
+ add_bias_kv=True,
337
+ drop_path=audio_drop_path,
338
+ )
339
+ modality_trunks[ModalityType.DEPTH] = instantiate_trunk(
340
+ depth_embed_dim,
341
+ depth_num_blocks,
342
+ depth_num_heads,
343
+ pre_transformer_ln=False,
344
+ add_bias_kv=True,
345
+ drop_path=depth_drop_path,
346
+ )
347
+ modality_trunks[ModalityType.THERMAL] = instantiate_trunk(
348
+ thermal_embed_dim,
349
+ thermal_num_blocks,
350
+ thermal_num_heads,
351
+ pre_transformer_ln=False,
352
+ add_bias_kv=True,
353
+ drop_path=thermal_drop_path,
354
+ )
355
+ modality_trunks[ModalityType.IMU] = instantiate_trunk(
356
+ imu_embed_dim,
357
+ imu_num_blocks,
358
+ imu_num_heads,
359
+ pre_transformer_ln=False,
360
+ add_bias_kv=True,
361
+ drop_path=imu_drop_path,
362
+ )
363
+
364
+ return nn.ModuleDict(modality_trunks)
365
+
366
+ def _create_modality_heads(
367
+ self,
368
+ out_embed_dim,
369
+ vision_embed_dim,
370
+ text_embed_dim,
371
+ audio_embed_dim,
372
+ depth_embed_dim,
373
+ thermal_embed_dim,
374
+ imu_embed_dim,
375
+ ):
376
+ modality_heads = {}
377
+
378
+ modality_heads[ModalityType.VISION] = nn.Sequential(
379
+ nn.LayerNorm(normalized_shape=vision_embed_dim, eps=1e-6),
380
+ SelectElement(index=0),
381
+ nn.Linear(vision_embed_dim, out_embed_dim, bias=False),
382
+ )
383
+
384
+ modality_heads[ModalityType.TEXT] = SelectEOSAndProject(
385
+ proj=nn.Sequential(
386
+ nn.LayerNorm(normalized_shape=text_embed_dim, eps=1e-6),
387
+ nn.Linear(text_embed_dim, out_embed_dim, bias=False),
388
+ )
389
+ )
390
+
391
+ modality_heads[ModalityType.AUDIO] = nn.Sequential(
392
+ nn.LayerNorm(normalized_shape=audio_embed_dim, eps=1e-6),
393
+ SelectElement(index=0),
394
+ nn.Linear(audio_embed_dim, out_embed_dim, bias=False),
395
+ )
396
+
397
+ modality_heads[ModalityType.DEPTH] = nn.Sequential(
398
+ nn.LayerNorm(normalized_shape=depth_embed_dim, eps=1e-6),
399
+ SelectElement(index=0),
400
+ nn.Linear(depth_embed_dim, out_embed_dim, bias=False),
401
+ )
402
+
403
+ modality_heads[ModalityType.THERMAL] = nn.Sequential(
404
+ nn.LayerNorm(normalized_shape=thermal_embed_dim, eps=1e-6),
405
+ SelectElement(index=0),
406
+ nn.Linear(thermal_embed_dim, out_embed_dim, bias=False),
407
+ )
408
+
409
+ modality_heads[ModalityType.IMU] = nn.Sequential(
410
+ nn.LayerNorm(normalized_shape=imu_embed_dim, eps=1e-6),
411
+ SelectElement(index=0),
412
+ nn.Dropout(p=0.5),
413
+ nn.Linear(imu_embed_dim, out_embed_dim, bias=False),
414
+ )
415
+
416
+ return nn.ModuleDict(modality_heads)
417
+
418
+ def _create_modality_postprocessors(self, out_embed_dim):
419
+ modality_postprocessors = {}
420
+
421
+ modality_postprocessors[ModalityType.VISION] = Normalize(dim=-1)
422
+ modality_postprocessors[ModalityType.TEXT] = nn.Sequential(
423
+ Normalize(dim=-1), LearnableLogitScaling(learnable=True)
424
+ )
425
+ modality_postprocessors[ModalityType.AUDIO] = nn.Sequential(
426
+ Normalize(dim=-1),
427
+ LearnableLogitScaling(logit_scale_init=20.0, learnable=False),
428
+ )
429
+ modality_postprocessors[ModalityType.DEPTH] = nn.Sequential(
430
+ Normalize(dim=-1),
431
+ LearnableLogitScaling(logit_scale_init=5.0, learnable=False),
432
+ )
433
+ modality_postprocessors[ModalityType.THERMAL] = nn.Sequential(
434
+ Normalize(dim=-1),
435
+ LearnableLogitScaling(logit_scale_init=10.0, learnable=False),
436
+ )
437
+ modality_postprocessors[ModalityType.IMU] = nn.Sequential(
438
+ Normalize(dim=-1),
439
+ LearnableLogitScaling(logit_scale_init=5.0, learnable=False),
440
+ )
441
+
442
+ return nn.ModuleDict(modality_postprocessors)
443
+
444
+ def forward(self, inputs):
445
+ outputs = {}
446
+ for modality_key, modality_value in inputs.items():
447
+ reduce_list = (
448
+ modality_value.ndim >= 5
449
+ ) # Audio and Video inputs consist of multiple clips
450
+ if reduce_list:
451
+ B, S = modality_value.shape[:2]
452
+ modality_value = modality_value.reshape(
453
+ B * S, *modality_value.shape[2:]
454
+ )
455
+
456
+ if modality_value is not None:
457
+ modality_value = self.modality_preprocessors[modality_key](
458
+ **{modality_key: modality_value}
459
+ )
460
+ trunk_inputs = modality_value["trunk"]
461
+ head_inputs = modality_value["head"]
462
+ modality_value = self.modality_trunks[modality_key](**trunk_inputs)
463
+ modality_value = self.modality_heads[modality_key](
464
+ modality_value, **head_inputs
465
+ )
466
+ modality_value = self.modality_postprocessors[modality_key](
467
+ modality_value
468
+ )
469
+
470
+ if reduce_list:
471
+ modality_value = modality_value.reshape(B, S, -1)
472
+ modality_value = modality_value.mean(dim=1)
473
+
474
+ outputs[modality_key] = modality_value
475
+
476
+ return outputs
477
+
478
+
479
+ def imagebind_huge(pretrained=False):
480
+ model = ImageBindModel(
481
+ vision_embed_dim=1280,
482
+ vision_num_blocks=32,
483
+ vision_num_heads=16,
484
+ text_embed_dim=1024,
485
+ text_num_blocks=24,
486
+ text_num_heads=16,
487
+ out_embed_dim=1024,
488
+ audio_drop_path=0.1,
489
+ imu_drop_path=0.7,
490
+ )
491
+
492
+ if pretrained:
493
+ if not os.path.exists(".checkpoints/imagebind_huge.pth"):
494
+ print(
495
+ "Downloading imagebind weights to .checkpoints/imagebind_huge.pth ..."
496
+ )
497
+ os.makedirs(".checkpoints", exist_ok=True)
498
+ torch.hub.download_url_to_file(
499
+ "https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth",
500
+ ".checkpoints/imagebind_huge.pth",
501
+ progress=True,
502
+ )
503
+
504
+ model.load_state_dict(torch.load(".checkpoints/imagebind_huge.pth", weights_only=True))
505
+
506
+ return model
models/third_party/ImageBind/imagebind/models/multimodal_preprocessors.py ADDED
@@ -0,0 +1,685 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # Portions Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+
5
+ # This source code is licensed under the license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
8
+ import gzip
9
+ import html
10
+ import io
11
+ import math
12
+ from functools import lru_cache
13
+ from typing import Callable, List, Optional, Tuple
14
+
15
+ import ftfy
16
+ import numpy as np
17
+ import regex as re
18
+ import torch
19
+ import torch.nn as nn
20
+ from iopath.common.file_io import g_pathmgr
21
+ from timm.layers import trunc_normal_
22
+
23
+ from imagebind.models.helpers import VerboseNNModule, cast_if_src_dtype
24
+
25
+
26
+ def get_sinusoid_encoding_table(n_position, d_hid):
27
+ """Sinusoid position encoding table"""
28
+
29
+ # TODO: make it with torch instead of numpy
30
+ def get_position_angle_vec(position):
31
+ return [
32
+ position / np.power(10000, 2 * (hid_j // 2) / d_hid)
33
+ for hid_j in range(d_hid)
34
+ ]
35
+
36
+ sinusoid_table = np.array(
37
+ [get_position_angle_vec(pos_i) for pos_i in range(n_position)]
38
+ )
39
+ sinusoid_table[:, 0::2] = np.sin(sinusoid_table[:, 0::2]) # dim 2i
40
+ sinusoid_table[:, 1::2] = np.cos(sinusoid_table[:, 1::2]) # dim 2i+1
41
+
42
+ return torch.FloatTensor(sinusoid_table).unsqueeze(0)
43
+
44
+
45
+ def interpolate_pos_encoding_2d(target_spatial_size, pos_embed):
46
+ N = pos_embed.shape[1]
47
+ if N == target_spatial_size:
48
+ return pos_embed
49
+ dim = pos_embed.shape[-1]
50
+ # nn.functional.interpolate doesn't work with bfloat16 so we cast to float32
51
+ pos_embed, updated = cast_if_src_dtype(pos_embed, torch.bfloat16, torch.float32)
52
+ pos_embed = nn.functional.interpolate(
53
+ pos_embed.reshape(1, int(math.sqrt(N)), int(math.sqrt(N)), dim).permute(
54
+ 0, 3, 1, 2
55
+ ),
56
+ scale_factor=math.sqrt(target_spatial_size / N),
57
+ mode="bicubic",
58
+ )
59
+ if updated:
60
+ pos_embed, _ = cast_if_src_dtype(pos_embed, torch.float32, torch.bfloat16)
61
+ pos_embed = pos_embed.permute(0, 2, 3, 1).view(1, -1, dim)
62
+ return pos_embed
63
+
64
+
65
+ def interpolate_pos_encoding(
66
+ npatch_per_img,
67
+ pos_embed,
68
+ patches_layout,
69
+ input_shape=None,
70
+ first_patch_idx=1,
71
+ ):
72
+ assert first_patch_idx == 0 or first_patch_idx == 1, "there is 1 CLS token or none"
73
+ N = pos_embed.shape[1] - first_patch_idx # since it's 1 if cls_token exists
74
+ if npatch_per_img == N:
75
+ return pos_embed
76
+
77
+ assert (
78
+ patches_layout[-1] == patches_layout[-2]
79
+ ), "Interpolation of pos embed not supported for non-square layouts"
80
+
81
+ class_emb = pos_embed[:, :first_patch_idx]
82
+ pos_embed = pos_embed[:, first_patch_idx:]
83
+
84
+ if input_shape is None or patches_layout[0] == 1:
85
+ # simple 2D pos embedding, no temporal component
86
+ pos_embed = interpolate_pos_encoding_2d(npatch_per_img, pos_embed)
87
+ elif patches_layout[0] > 1:
88
+ # pos embed has a temporal component
89
+ assert len(input_shape) == 4, "temporal interpolation not supported"
90
+ # we only support 2D interpolation in this case
91
+ num_frames = patches_layout[0]
92
+ num_spatial_tokens = patches_layout[1] * patches_layout[2]
93
+ pos_embed = pos_embed.view(1, num_frames, num_spatial_tokens, -1)
94
+ # interpolate embedding for zeroth frame
95
+ pos_embed = interpolate_pos_encoding_2d(
96
+ npatch_per_img, pos_embed[0, 0, ...].unsqueeze(0)
97
+ )
98
+ else:
99
+ raise ValueError("This type of interpolation isn't implemented")
100
+
101
+ return torch.cat((class_emb, pos_embed), dim=1)
102
+
103
+
104
+ def _get_pos_embedding(
105
+ npatch_per_img,
106
+ pos_embed,
107
+ patches_layout,
108
+ input_shape,
109
+ first_patch_idx=1,
110
+ ):
111
+ pos_embed = interpolate_pos_encoding(
112
+ npatch_per_img,
113
+ pos_embed,
114
+ patches_layout,
115
+ input_shape=input_shape,
116
+ first_patch_idx=first_patch_idx,
117
+ )
118
+ return pos_embed
119
+
120
+
121
+ class PatchEmbedGeneric(nn.Module):
122
+ """
123
+ PatchEmbed from Hydra
124
+ """
125
+
126
+ def __init__(self, proj_stem, norm_layer: Optional[nn.Module] = None):
127
+ super().__init__()
128
+
129
+ if len(proj_stem) > 1:
130
+ self.proj = nn.Sequential(*proj_stem)
131
+ else:
132
+ # Special case to be able to load pre-trained models that were
133
+ # trained with a standard stem
134
+ self.proj = proj_stem[0]
135
+ self.norm_layer = norm_layer
136
+
137
+ def get_patch_layout(self, img_size):
138
+ with torch.no_grad():
139
+ dummy_img = torch.zeros(
140
+ [
141
+ 1,
142
+ ]
143
+ + img_size
144
+ )
145
+ dummy_out = self.proj(dummy_img)
146
+ embed_dim = dummy_out.shape[1]
147
+ patches_layout = tuple(dummy_out.shape[2:])
148
+ num_patches = np.prod(patches_layout)
149
+ return patches_layout, num_patches, embed_dim
150
+
151
+ def forward(self, x):
152
+ x = self.proj(x)
153
+ # B C (T) H W -> B (T)HW C
154
+ x = x.flatten(2).transpose(1, 2)
155
+ if self.norm_layer is not None:
156
+ x = self.norm_layer(x)
157
+ return x
158
+
159
+
160
+ class SpatioTemporalPosEmbeddingHelper(VerboseNNModule):
161
+ def __init__(
162
+ self,
163
+ patches_layout: List,
164
+ num_patches: int,
165
+ num_cls_tokens: int,
166
+ embed_dim: int,
167
+ learnable: bool,
168
+ ) -> None:
169
+ super().__init__()
170
+ self.num_cls_tokens = num_cls_tokens
171
+ self.patches_layout = patches_layout
172
+ self.num_patches = num_patches
173
+ self.num_tokens = num_cls_tokens + num_patches
174
+ self.learnable = learnable
175
+ if self.learnable:
176
+ self.pos_embed = nn.Parameter(torch.zeros(1, self.num_tokens, embed_dim))
177
+ trunc_normal_(self.pos_embed, std=0.02)
178
+ else:
179
+ self.register_buffer(
180
+ "pos_embed", get_sinusoid_encoding_table(self.num_tokens, embed_dim)
181
+ )
182
+
183
+ def get_pos_embedding(self, vision_input, all_vision_tokens):
184
+ input_shape = vision_input.shape
185
+ pos_embed = _get_pos_embedding(
186
+ all_vision_tokens.size(1) - self.num_cls_tokens,
187
+ pos_embed=self.pos_embed,
188
+ patches_layout=self.patches_layout,
189
+ input_shape=input_shape,
190
+ first_patch_idx=self.num_cls_tokens,
191
+ )
192
+ return pos_embed
193
+
194
+
195
+ class RGBDTPreprocessor(VerboseNNModule):
196
+ def __init__(
197
+ self,
198
+ rgbt_stem: PatchEmbedGeneric,
199
+ depth_stem: Optional[PatchEmbedGeneric],
200
+ img_size: Tuple = (3, 224, 224),
201
+ num_cls_tokens: int = 1,
202
+ pos_embed_fn: Optional[Callable] = None,
203
+ use_type_embed: bool = False,
204
+ init_param_style: str = "openclip",
205
+ ) -> None:
206
+ super().__init__()
207
+ stem = rgbt_stem if rgbt_stem is not None else depth_stem
208
+ (
209
+ self.patches_layout,
210
+ self.num_patches,
211
+ self.embed_dim,
212
+ ) = stem.get_patch_layout(img_size)
213
+ self.rgbt_stem = rgbt_stem
214
+ self.depth_stem = depth_stem
215
+ self.use_pos_embed = pos_embed_fn is not None
216
+ self.use_type_embed = use_type_embed
217
+ self.num_cls_tokens = num_cls_tokens
218
+
219
+ if self.use_pos_embed:
220
+ self.pos_embedding_helper = pos_embed_fn(
221
+ patches_layout=self.patches_layout,
222
+ num_cls_tokens=num_cls_tokens,
223
+ num_patches=self.num_patches,
224
+ embed_dim=self.embed_dim,
225
+ )
226
+ if self.num_cls_tokens > 0:
227
+ self.cls_token = nn.Parameter(
228
+ torch.zeros(1, self.num_cls_tokens, self.embed_dim)
229
+ )
230
+ if self.use_type_embed:
231
+ self.type_embed = nn.Parameter(torch.zeros(1, 1, self.embed_dim))
232
+
233
+ self.init_parameters(init_param_style)
234
+
235
+ @torch.no_grad()
236
+ def init_parameters(self, init_param_style):
237
+ if init_param_style == "openclip":
238
+ # OpenCLIP style initialization
239
+ scale = self.embed_dim**-0.5
240
+ if self.use_pos_embed:
241
+ nn.init.normal_(self.pos_embedding_helper.pos_embed)
242
+ self.pos_embedding_helper.pos_embed *= scale
243
+
244
+ if self.num_cls_tokens > 0:
245
+ nn.init.normal_(self.cls_token)
246
+ self.cls_token *= scale
247
+ elif init_param_style == "vit":
248
+ self.cls_token.data.fill_(0)
249
+ else:
250
+ raise ValueError(f"Unknown init {init_param_style}")
251
+
252
+ if self.use_type_embed:
253
+ nn.init.normal_(self.type_embed)
254
+
255
+ def tokenize_input_and_cls_pos(self, input, stem, mask):
256
+ # tokens is of shape B x L x D
257
+ tokens = stem(input)
258
+ assert tokens.ndim == 3
259
+ assert tokens.shape[2] == self.embed_dim
260
+ B = tokens.shape[0]
261
+ if self.num_cls_tokens > 0:
262
+ class_tokens = self.cls_token.expand(
263
+ B, -1, -1
264
+ ) # stole class_tokens impl from Phil Wang, thanks
265
+ tokens = torch.cat((class_tokens, tokens), dim=1)
266
+ if self.use_pos_embed:
267
+ pos_embed = self.pos_embedding_helper.get_pos_embedding(input, tokens)
268
+ tokens = tokens + pos_embed
269
+ if self.use_type_embed:
270
+ tokens = tokens + self.type_embed.expand(B, -1, -1)
271
+ return tokens
272
+
273
+ def forward(self, vision=None, depth=None, patch_mask=None):
274
+ if patch_mask is not None:
275
+ raise NotImplementedError()
276
+
277
+ if vision is not None:
278
+ vision_tokens = self.tokenize_input_and_cls_pos(
279
+ vision, self.rgbt_stem, patch_mask
280
+ )
281
+
282
+ if depth is not None:
283
+ depth_tokens = self.tokenize_input_and_cls_pos(
284
+ depth, self.depth_stem, patch_mask
285
+ )
286
+
287
+ # aggregate tokens
288
+ if vision is not None and depth is not None:
289
+ final_tokens = vision_tokens + depth_tokens
290
+ else:
291
+ final_tokens = vision_tokens if vision is not None else depth_tokens
292
+ return_dict = {
293
+ "trunk": {
294
+ "tokens": final_tokens,
295
+ },
296
+ "head": {},
297
+ }
298
+ return return_dict
299
+
300
+
301
+ class AudioPreprocessor(RGBDTPreprocessor):
302
+ def __init__(self, audio_stem: PatchEmbedGeneric, **kwargs) -> None:
303
+ super().__init__(rgbt_stem=audio_stem, depth_stem=None, **kwargs)
304
+
305
+ def forward(self, audio=None):
306
+ return super().forward(vision=audio)
307
+
308
+
309
+ class ThermalPreprocessor(RGBDTPreprocessor):
310
+ def __init__(self, thermal_stem: PatchEmbedGeneric, **kwargs) -> None:
311
+ super().__init__(rgbt_stem=thermal_stem, depth_stem=None, **kwargs)
312
+
313
+ def forward(self, thermal=None):
314
+ return super().forward(vision=thermal)
315
+
316
+
317
+ def build_causal_attention_mask(context_length):
318
+ # lazily create causal attention mask, with full attention between the vision tokens
319
+ # pytorch uses additive attention mask; fill with -inf
320
+ mask = torch.empty(context_length, context_length, requires_grad=False)
321
+ mask.fill_(float("-inf"))
322
+ mask.triu_(1) # zero out the lower diagonal
323
+ return mask
324
+
325
+
326
+ class TextPreprocessor(VerboseNNModule):
327
+ def __init__(
328
+ self,
329
+ vocab_size: int,
330
+ context_length: int,
331
+ embed_dim: int,
332
+ causal_masking: bool,
333
+ supply_seq_len_to_head: bool = True,
334
+ num_cls_tokens: int = 0,
335
+ init_param_style: str = "openclip",
336
+ ) -> None:
337
+ super().__init__()
338
+ self.vocab_size = vocab_size
339
+ self.context_length = context_length
340
+ self.token_embedding = nn.Embedding(vocab_size, embed_dim)
341
+ self.pos_embed = nn.Parameter(
342
+ torch.empty(1, self.context_length + num_cls_tokens, embed_dim)
343
+ )
344
+ self.causal_masking = causal_masking
345
+ if self.causal_masking:
346
+ mask = build_causal_attention_mask(self.context_length)
347
+ # register the mask as a buffer so it can be moved to the right device
348
+ self.register_buffer("mask", mask)
349
+
350
+ self.supply_seq_len_to_head = supply_seq_len_to_head
351
+ self.num_cls_tokens = num_cls_tokens
352
+ self.embed_dim = embed_dim
353
+ if num_cls_tokens > 0:
354
+ assert self.causal_masking is False, "Masking + CLS token isn't implemented"
355
+ self.cls_token = nn.Parameter(
356
+ torch.zeros(1, self.num_cls_tokens, embed_dim)
357
+ )
358
+
359
+ self.init_parameters(init_param_style)
360
+
361
+ @torch.no_grad()
362
+ def init_parameters(self, init_param_style="openclip"):
363
+ # OpenCLIP style initialization
364
+ nn.init.normal_(self.token_embedding.weight, std=0.02)
365
+ nn.init.normal_(self.pos_embed, std=0.01)
366
+
367
+ if init_param_style == "openclip":
368
+ # OpenCLIP style initialization
369
+ scale = self.embed_dim**-0.5
370
+ if self.num_cls_tokens > 0:
371
+ nn.init.normal_(self.cls_token)
372
+ self.cls_token *= scale
373
+ elif init_param_style == "vit":
374
+ self.cls_token.data.fill_(0)
375
+ else:
376
+ raise ValueError(f"Unknown init {init_param_style}")
377
+
378
+ def forward(self, text):
379
+ # text tokens are of shape B x L x D
380
+ text_tokens = self.token_embedding(text)
381
+ # concat CLS tokens if any
382
+ if self.num_cls_tokens > 0:
383
+ B = text_tokens.shape[0]
384
+ class_tokens = self.cls_token.expand(
385
+ B, -1, -1
386
+ ) # stole class_tokens impl from Phil Wang, thanks
387
+ text_tokens = torch.cat((class_tokens, text_tokens), dim=1)
388
+ text_tokens = text_tokens + self.pos_embed
389
+ return_dict = {
390
+ "trunk": {
391
+ "tokens": text_tokens,
392
+ },
393
+ "head": {},
394
+ }
395
+ # Compute sequence length after adding CLS tokens
396
+ if self.supply_seq_len_to_head:
397
+ text_lengths = text.argmax(dim=-1)
398
+ return_dict["head"] = {
399
+ "seq_len": text_lengths,
400
+ }
401
+ if self.causal_masking:
402
+ return_dict["trunk"].update({"attn_mask": self.mask})
403
+ return return_dict
404
+
405
+
406
+ class Im2Video(nn.Module):
407
+ """Convert an image into a trivial video."""
408
+
409
+ def __init__(self, time_dim=2):
410
+ super().__init__()
411
+ self.time_dim = time_dim
412
+
413
+ def forward(self, x):
414
+ if x.ndim == 4:
415
+ # B, C, H, W -> B, C, T, H, W
416
+ return x.unsqueeze(self.time_dim)
417
+ elif x.ndim == 5:
418
+ return x
419
+ else:
420
+ raise ValueError(f"Dimension incorrect {x.shape}")
421
+
422
+
423
+ class PadIm2Video(Im2Video):
424
+ def __init__(self, ntimes, pad_type, time_dim=2):
425
+ super().__init__(time_dim=time_dim)
426
+ assert ntimes > 0
427
+ assert pad_type in ["zero", "repeat"]
428
+ self.ntimes = ntimes
429
+ self.pad_type = pad_type
430
+
431
+ def forward(self, x):
432
+ x = super().forward(x)
433
+ if x.shape[self.time_dim] == 1:
434
+ if self.pad_type == "repeat":
435
+ new_shape = [1] * len(x.shape)
436
+ new_shape[self.time_dim] = self.ntimes
437
+ x = x.repeat(new_shape)
438
+ elif self.pad_type == "zero":
439
+ padarg = [0, 0] * len(x.shape)
440
+ padarg[2 * self.time_dim + 1] = self.ntimes - x.shape[self.time_dim]
441
+ x = nn.functional.pad(x, padarg)
442
+ return x
443
+
444
+
445
+ # Modified from github.com/openai/CLIP
446
+ @lru_cache()
447
+ def bytes_to_unicode():
448
+ """
449
+ Returns list of utf-8 byte and a corresponding list of unicode strings.
450
+ The reversible bpe codes work on unicode strings.
451
+ This means you need a large # of unicode characters in your vocab if you want to avoid UNKs.
452
+ When you're at something like a 10B token dataset you end up needing around 5K for decent coverage.
453
+ This is a signficant percentage of your normal, say, 32K bpe vocab.
454
+ To avoid that, we want lookup tables between utf-8 bytes and unicode strings.
455
+ And avoids mapping to whitespace/control characters the bpe code barfs on.
456
+ """
457
+ bs = (
458
+ list(range(ord("!"), ord("~") + 1))
459
+ + list(range(ord("¡"), ord("¬") + 1))
460
+ + list(range(ord("®"), ord("ÿ") + 1))
461
+ )
462
+ cs = bs[:]
463
+ n = 0
464
+ for b in range(2**8):
465
+ if b not in bs:
466
+ bs.append(b)
467
+ cs.append(2**8 + n)
468
+ n += 1
469
+ cs = [chr(n) for n in cs]
470
+ return dict(zip(bs, cs))
471
+
472
+
473
+ def get_pairs(word):
474
+ """Return set of symbol pairs in a word.
475
+ Word is represented as tuple of symbols (symbols being variable-length strings).
476
+ """
477
+ pairs = set()
478
+ prev_char = word[0]
479
+ for char in word[1:]:
480
+ pairs.add((prev_char, char))
481
+ prev_char = char
482
+ return pairs
483
+
484
+
485
+ def basic_clean(text):
486
+ text = ftfy.fix_text(text)
487
+ text = html.unescape(html.unescape(text))
488
+ return text.strip()
489
+
490
+
491
+ def whitespace_clean(text):
492
+ text = re.sub(r"\s+", " ", text)
493
+ text = text.strip()
494
+ return text
495
+
496
+
497
+ class SimpleTokenizer(object):
498
+ def __init__(self, bpe_path: str, context_length=77):
499
+ self.byte_encoder = bytes_to_unicode()
500
+ self.byte_decoder = {v: k for k, v in self.byte_encoder.items()}
501
+
502
+ with g_pathmgr.open(bpe_path, "rb") as fh:
503
+ bpe_bytes = io.BytesIO(fh.read())
504
+ merges: List[str] = gzip.open(bpe_bytes).read().decode("utf-8").split("\n")
505
+ merges = merges[1 : 49152 - 256 - 2 + 1]
506
+ merges: List[Tuple[str, ...]] = [tuple(merge.split()) for merge in merges]
507
+ vocab = list(bytes_to_unicode().values())
508
+ vocab = vocab + [v + "</w>" for v in vocab]
509
+ for merge in merges:
510
+ vocab.append("".join(merge))
511
+ vocab.extend(["<|startoftext|>", "<|endoftext|>"])
512
+ self.encoder = dict(zip(vocab, range(len(vocab))))
513
+ self.decoder = {v: k for k, v in self.encoder.items()}
514
+ self.bpe_ranks = dict(zip(merges, range(len(merges))))
515
+ self.cache = {
516
+ "<|startoftext|>": "<|startoftext|>",
517
+ "<|endoftext|>": "<|endoftext|>",
518
+ }
519
+ self.pat = re.compile(
520
+ r"""<\|startoftext\|>|<\|endoftext\|>|'s|'t|'re|'ve|'m|'ll|'d|[\p{L}]+|[\p{N}]|[^\s\p{L}\p{N}]+""",
521
+ re.IGNORECASE,
522
+ )
523
+ self.context_length = context_length
524
+
525
+ def bpe(self, token):
526
+ if token in self.cache:
527
+ return self.cache[token]
528
+ word = tuple(token[:-1]) + (token[-1] + "</w>",)
529
+ pairs = get_pairs(word)
530
+
531
+ if not pairs:
532
+ return token + "</w>"
533
+
534
+ while True:
535
+ bigram = min(pairs, key=lambda pair: self.bpe_ranks.get(pair, float("inf")))
536
+ if bigram not in self.bpe_ranks:
537
+ break
538
+ first, second = bigram
539
+ new_word = []
540
+ i = 0
541
+ while i < len(word):
542
+ try:
543
+ j = word.index(first, i)
544
+ new_word.extend(word[i:j])
545
+ i = j
546
+ except:
547
+ new_word.extend(word[i:])
548
+ break
549
+
550
+ if word[i] == first and i < len(word) - 1 and word[i + 1] == second:
551
+ new_word.append(first + second)
552
+ i += 2
553
+ else:
554
+ new_word.append(word[i])
555
+ i += 1
556
+ new_word = tuple(new_word)
557
+ word = new_word
558
+ if len(word) == 1:
559
+ break
560
+ else:
561
+ pairs = get_pairs(word)
562
+ word = " ".join(word)
563
+ self.cache[token] = word
564
+ return word
565
+
566
+ def encode(self, text):
567
+ bpe_tokens = []
568
+ text = whitespace_clean(basic_clean(text)).lower()
569
+ for token in re.findall(self.pat, text):
570
+ token = "".join(self.byte_encoder[b] for b in token.encode("utf-8"))
571
+ bpe_tokens.extend(
572
+ self.encoder[bpe_token] for bpe_token in self.bpe(token).split(" ")
573
+ )
574
+ return bpe_tokens
575
+
576
+ def decode(self, tokens):
577
+ text = "".join([self.decoder[token] for token in tokens])
578
+ text = (
579
+ bytearray([self.byte_decoder[c] for c in text])
580
+ .decode("utf-8", errors="replace")
581
+ .replace("</w>", " ")
582
+ )
583
+ return text
584
+
585
+ def __call__(self, texts, context_length=None):
586
+ if not context_length:
587
+ context_length = self.context_length
588
+
589
+ if isinstance(texts, str):
590
+ texts = [texts]
591
+
592
+ sot_token = self.encoder["<|startoftext|>"]
593
+ eot_token = self.encoder["<|endoftext|>"]
594
+ all_tokens = [[sot_token] + self.encode(text) for text in texts]
595
+ result = torch.zeros(len(all_tokens), context_length, dtype=torch.long)
596
+
597
+ for i, tokens in enumerate(all_tokens):
598
+ tokens = tokens[:context_length - 1] + [eot_token]
599
+ result[i, : len(tokens)] = torch.tensor(tokens)
600
+
601
+ if len(result) == 1:
602
+ return result[0]
603
+ return result
604
+
605
+
606
+ class IMUPreprocessor(VerboseNNModule):
607
+ def __init__(
608
+ self,
609
+ kernel_size: int,
610
+ imu_stem: PatchEmbedGeneric,
611
+ embed_dim: int,
612
+ img_size: Tuple = (6, 2000),
613
+ num_cls_tokens: int = 1,
614
+ pos_embed_fn: Optional[Callable] = None,
615
+ init_param_style: str = "openclip",
616
+ ) -> None:
617
+ super().__init__()
618
+ self.imu_stem = imu_stem
619
+ self.embed_dim = embed_dim
620
+ self.use_pos_embed = pos_embed_fn is not None
621
+ self.num_cls_tokens = num_cls_tokens
622
+ self.kernel_size = kernel_size
623
+ self.pos_embed = nn.Parameter(
624
+ torch.empty(1, (img_size[1] // kernel_size) + num_cls_tokens, embed_dim)
625
+ )
626
+
627
+ if self.num_cls_tokens > 0:
628
+ self.cls_token = nn.Parameter(
629
+ torch.zeros(1, self.num_cls_tokens, self.embed_dim)
630
+ )
631
+
632
+ self.init_parameters(init_param_style)
633
+
634
+ @torch.no_grad()
635
+ def init_parameters(self, init_param_style):
636
+ nn.init.normal_(self.pos_embed, std=0.01)
637
+
638
+ if init_param_style == "openclip":
639
+ # OpenCLIP style initialization
640
+ scale = self.embed_dim**-0.5
641
+
642
+ if self.num_cls_tokens > 0:
643
+ nn.init.normal_(self.cls_token)
644
+ self.cls_token *= scale
645
+ elif init_param_style == "vit":
646
+ self.cls_token.data.fill_(0)
647
+ else:
648
+ raise ValueError(f"Unknown init {init_param_style}")
649
+
650
+ def tokenize_input_and_cls_pos(self, input, stem):
651
+ # tokens is of shape B x L x D
652
+ tokens = stem.norm_layer(stem.proj(input))
653
+ assert tokens.ndim == 3
654
+ assert tokens.shape[2] == self.embed_dim
655
+ B = tokens.shape[0]
656
+ if self.num_cls_tokens > 0:
657
+ class_tokens = self.cls_token.expand(
658
+ B, -1, -1
659
+ ) # stole class_tokens impl from Phil Wang, thanks
660
+ tokens = torch.cat((class_tokens, tokens), dim=1)
661
+ if self.use_pos_embed:
662
+ tokens = tokens + self.pos_embed
663
+ return tokens
664
+
665
+ def forward(self, imu):
666
+ # Patchify
667
+ imu = imu.unfold(
668
+ -1,
669
+ self.kernel_size,
670
+ self.kernel_size,
671
+ ).permute(0, 2, 1, 3)
672
+ imu = imu.reshape(imu.size(0), imu.size(1), -1)
673
+
674
+ imu_tokens = self.tokenize_input_and_cls_pos(
675
+ imu,
676
+ self.imu_stem,
677
+ )
678
+
679
+ return_dict = {
680
+ "trunk": {
681
+ "tokens": imu_tokens,
682
+ },
683
+ "head": {},
684
+ }
685
+ return return_dict
models/third_party/ImageBind/imagebind/models/transformer.py ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ # Portions Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+
5
+ # This source code is licensed under the license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
8
+ # Code modified from
9
+ # https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py ;
10
+ # https://github.com/facebookresearch/deit/blob/main/models.py
11
+ # and https://github.com/facebookresearch/vissl/blob/main/vissl/models/trunks/vision_transformer.py
12
+
13
+
14
+ from functools import partial
15
+ from typing import Callable, List, Optional
16
+
17
+ import torch
18
+ import torch.nn as nn
19
+ import torch.utils.checkpoint as checkpoint
20
+ from timm.layers import DropPath, trunc_normal_
21
+
22
+
23
+ class Attention(nn.Module):
24
+ def __init__(
25
+ self,
26
+ dim,
27
+ num_heads=8,
28
+ qkv_bias=False,
29
+ qk_scale=None,
30
+ attn_drop=0.0,
31
+ proj_drop=0.0,
32
+ ):
33
+ super().__init__()
34
+ self.num_heads = num_heads
35
+ head_dim = dim // num_heads
36
+ # NOTE scale factor was wrong in my original version,
37
+ # can set manually to be compat with prev weights
38
+ self.scale = qk_scale or head_dim**-0.5
39
+
40
+ self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
41
+ self.attn_drop = nn.Dropout(attn_drop)
42
+ self.proj = nn.Linear(dim, dim)
43
+ self.proj_drop = nn.Dropout(proj_drop)
44
+
45
+ def forward(self, x):
46
+ B, N, C = x.shape
47
+ qkv = (
48
+ self.qkv(x)
49
+ .reshape(B, N, 3, self.num_heads, C // self.num_heads)
50
+ .permute(2, 0, 3, 1, 4)
51
+ )
52
+ q, k, v = (
53
+ qkv[0],
54
+ qkv[1],
55
+ qkv[2],
56
+ ) # make torchscript happy (cannot use tensor as tuple)
57
+
58
+ attn = (q @ k.transpose(-2, -1)) * self.scale
59
+ attn = attn.softmax(dim=-1)
60
+ attn = self.attn_drop(attn)
61
+
62
+ x = (attn @ v).transpose(1, 2).reshape(B, N, C)
63
+ x = self.proj(x)
64
+ x = self.proj_drop(x)
65
+ return x
66
+
67
+
68
+ class Mlp(nn.Module):
69
+ def __init__(
70
+ self,
71
+ in_features,
72
+ hidden_features=None,
73
+ out_features=None,
74
+ act_layer=nn.GELU,
75
+ drop=0.0,
76
+ ):
77
+ super().__init__()
78
+ out_features = out_features or in_features
79
+ hidden_features = hidden_features or in_features
80
+ self.fc1 = nn.Linear(in_features, hidden_features)
81
+ self.act = act_layer()
82
+ self.fc2 = nn.Linear(hidden_features, out_features)
83
+ self.drop = nn.Dropout(drop)
84
+
85
+ def forward(self, x):
86
+ x = self.fc1(x)
87
+ x = self.act(x)
88
+ x = self.drop(x)
89
+ x = self.fc2(x)
90
+ x = self.drop(x)
91
+ return x
92
+
93
+
94
+ class MultiheadAttention(nn.MultiheadAttention):
95
+ def forward(self, x: torch.Tensor, attn_mask: torch.Tensor):
96
+ return super().forward(x, x, x, need_weights=False, attn_mask=attn_mask)[0]
97
+
98
+
99
+ class ViTAttention(Attention):
100
+ def forward(self, x: torch.Tensor, attn_mask: torch.Tensor):
101
+ assert attn_mask is None
102
+ return super().forward(x)
103
+
104
+
105
+ class BlockWithMasking(nn.Module):
106
+ def __init__(
107
+ self,
108
+ dim: int,
109
+ attn_target: Callable,
110
+ mlp_ratio: int = 4,
111
+ act_layer: Callable = nn.GELU,
112
+ norm_layer: Callable = nn.LayerNorm,
113
+ ffn_dropout_rate: float = 0.0,
114
+ drop_path: float = 0.0,
115
+ layer_scale_type: Optional[str] = None,
116
+ layer_scale_init_value: float = 1e-4,
117
+ ):
118
+ super().__init__()
119
+
120
+ assert not isinstance(
121
+ attn_target, nn.Module
122
+ ), "attn_target should be a Callable. Otherwise attn_target is shared across blocks!"
123
+ self.attn = attn_target()
124
+ if drop_path > 0.0:
125
+ self.drop_path = DropPath(drop_path)
126
+ else:
127
+ self.drop_path = nn.Identity()
128
+ self.norm_1 = norm_layer(dim)
129
+ mlp_hidden_dim = int(mlp_ratio * dim)
130
+ self.mlp = Mlp(
131
+ in_features=dim,
132
+ hidden_features=mlp_hidden_dim,
133
+ act_layer=act_layer,
134
+ drop=ffn_dropout_rate,
135
+ )
136
+ self.norm_2 = norm_layer(dim)
137
+ self.layer_scale_type = layer_scale_type
138
+ if self.layer_scale_type is not None:
139
+ assert self.layer_scale_type in [
140
+ "per_channel",
141
+ "scalar",
142
+ ], f"Found Layer scale type {self.layer_scale_type}"
143
+ if self.layer_scale_type == "per_channel":
144
+ # one gamma value per channel
145
+ gamma_shape = [1, 1, dim]
146
+ elif self.layer_scale_type == "scalar":
147
+ # single gamma value for all channels
148
+ gamma_shape = [1, 1, 1]
149
+ # two gammas: for each part of the fwd in the encoder
150
+ self.layer_scale_gamma1 = nn.Parameter(
151
+ torch.ones(size=gamma_shape) * layer_scale_init_value,
152
+ requires_grad=True,
153
+ )
154
+ self.layer_scale_gamma2 = nn.Parameter(
155
+ torch.ones(size=gamma_shape) * layer_scale_init_value,
156
+ requires_grad=True,
157
+ )
158
+
159
+ def forward(self, x: torch.Tensor, attn_mask: torch.Tensor):
160
+ if self.layer_scale_type is None:
161
+ x = x + self.drop_path(self.attn(self.norm_1(x), attn_mask))
162
+ x = x + self.drop_path(self.mlp(self.norm_2(x)))
163
+ else:
164
+ x = (
165
+ x
166
+ + self.drop_path(self.attn(self.norm_1(x), attn_mask))
167
+ * self.layer_scale_gamma1
168
+ )
169
+ x = x + self.drop_path(self.mlp(self.norm_2(x))) * self.layer_scale_gamma2
170
+ return x
171
+
172
+
173
+ _LAYER_NORM = partial(nn.LayerNorm, eps=1e-6)
174
+
175
+
176
+ class SimpleTransformer(nn.Module):
177
+ def __init__(
178
+ self,
179
+ attn_target: Callable,
180
+ embed_dim: int,
181
+ num_blocks: int,
182
+ block: Callable = BlockWithMasking,
183
+ pre_transformer_layer: Optional[Callable] = None,
184
+ post_transformer_layer: Optional[Callable] = None,
185
+ drop_path_rate: float = 0.0,
186
+ drop_path_type: str = "progressive",
187
+ norm_layer: Callable = _LAYER_NORM,
188
+ mlp_ratio: int = 4,
189
+ ffn_dropout_rate: float = 0.0,
190
+ layer_scale_type: Optional[str] = None, # from cait; possible values are None, "per_channel", "scalar"
191
+ layer_scale_init_value: float = 1e-4, # from cait; float
192
+ weight_init_style: str = "jax", # possible values jax or pytorch
193
+ ):
194
+ """
195
+ Simple Transformer with the following features
196
+ 1. Supports masked attention
197
+ 2. Supports DropPath
198
+ 3. Supports LayerScale
199
+ 4. Supports Dropout in Attention and FFN
200
+ 5. Makes few assumptions about the input except that it is a Tensor
201
+ """
202
+ super().__init__()
203
+ self.pre_transformer_layer = pre_transformer_layer
204
+ if drop_path_type == "progressive":
205
+ dpr = [x.item() for x in torch.linspace(0, drop_path_rate, num_blocks)]
206
+ elif drop_path_type == "uniform":
207
+ dpr = [drop_path_rate for i in range(num_blocks)]
208
+ else:
209
+ raise ValueError(f"Unknown drop_path_type: {drop_path_type}")
210
+
211
+ self.blocks = nn.Sequential(
212
+ *[
213
+ block(
214
+ dim=embed_dim,
215
+ attn_target=attn_target,
216
+ mlp_ratio=mlp_ratio,
217
+ ffn_dropout_rate=ffn_dropout_rate,
218
+ drop_path=dpr[i],
219
+ norm_layer=norm_layer,
220
+ layer_scale_type=layer_scale_type,
221
+ layer_scale_init_value=layer_scale_init_value,
222
+ )
223
+ for i in range(num_blocks)
224
+ ]
225
+ )
226
+ self.post_transformer_layer = post_transformer_layer
227
+ self.weight_init_style = weight_init_style
228
+ self.apply(self._init_weights)
229
+
230
+ def _init_weights(self, m):
231
+ if isinstance(m, nn.Linear):
232
+ if self.weight_init_style == "jax":
233
+ # Based on MAE and official Jax ViT implementation
234
+ torch.nn.init.xavier_uniform_(m.weight)
235
+ elif self.weight_init_style == "pytorch":
236
+ # PyTorch ViT uses trunc_normal_
237
+ trunc_normal_(m.weight, std=0.02)
238
+
239
+ if m.bias is not None:
240
+ nn.init.constant_(m.bias, 0)
241
+ elif isinstance(m, (nn.LayerNorm)):
242
+ nn.init.constant_(m.bias, 0)
243
+ nn.init.constant_(m.weight, 1.0)
244
+
245
+ def forward(
246
+ self,
247
+ tokens: torch.Tensor,
248
+ attn_mask: torch.Tensor = None,
249
+ use_checkpoint: bool = False,
250
+ checkpoint_every_n: int = 1,
251
+ checkpoint_blk_ids: Optional[List[int]] = None,
252
+ ):
253
+ """
254
+ Inputs
255
+ - tokens: data of shape N x L x D (or L x N x D depending on the attention implementation)
256
+ - attn: mask of shape L x L
257
+
258
+ Output
259
+ - x: data of shape N x L x D (or L x N x D depending on the attention implementation)
260
+ """
261
+ if self.pre_transformer_layer:
262
+ tokens = self.pre_transformer_layer(tokens)
263
+ if use_checkpoint and checkpoint_blk_ids is None:
264
+ checkpoint_blk_ids = [
265
+ blk_id
266
+ for blk_id in range(len(self.blocks))
267
+ if blk_id % checkpoint_every_n == 0
268
+ ]
269
+ if checkpoint_blk_ids:
270
+ checkpoint_blk_ids = set(checkpoint_blk_ids)
271
+ for blk_id, blk in enumerate(self.blocks):
272
+ if use_checkpoint and blk_id in checkpoint_blk_ids:
273
+ tokens = checkpoint.checkpoint(
274
+ blk, tokens, attn_mask, use_reentrant=False
275
+ )
276
+ else:
277
+ tokens = blk(tokens, attn_mask=attn_mask)
278
+ if self.post_transformer_layer:
279
+ tokens = self.post_transformer_layer(tokens)
280
+ return tokens
models/third_party/ImageBind/model_card.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Model Card for ImageBind
2
+
3
+ Multimodal joint embedding model for image/video, text, audio, depth, IMU, and thermal images.
4
+ Input any of the six modalities and get the same sized embedding that can be used for cross-modal and multimodal tasks.
5
+
6
+ # Model Details
7
+
8
+ ## Model Description
9
+
10
+ <!-- Provide a longer summary of what this model is/does. -->
11
+ Multimodal joint embedding model for image/video, text, audio, depth, IMU, and thermal images
12
+
13
+ - **Developed by:** Meta AI
14
+ - **Model type:** Multimodal model
15
+ - **Language(s) (NLP):** en
16
+ - **License:** CC BY-NC-SA 4.0
17
+ - **Resources for more information:**
18
+ - [GitHub Repo](https://github.com/facebookresearch/ImageBind)
19
+
20
+
21
+ # Uses
22
+
23
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
24
+ This model is intended only for research purposes. It provides a joint embedding space for different modalities -- image/video, text, audio, depth, IMU and thermal images.
25
+ We hope that these joint embeddings can be used for a variety of different cross-modal research, e.g., cross-modal retrieval and combining embeddings from different modalities.
26
+
27
+ ## Out-of-Scope Use
28
+
29
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
30
+ <!-- If the user enters content, print that. If not, but they enter a task in the list, use that. If neither, say "more info needed." -->
31
+
32
+ This model is *NOT* intended to be used in any real world application -- commercial or otherwise.
33
+ It may produce harmful associations with different inputs.
34
+ The model needs to be investigated and likely re-trained on specific data for any such application.
35
+ The model is expected to work better on web-based visual data since it was trained on such data.
36
+ The text encoder is likely to work only on English language text because of the underlying training datasets.
37
+
38
+ # Bias, Risks, and Limitations
39
+
40
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
41
+ Open-domain joint embedding models are prone to producing specific biases, e.g., study from [CLIP](https://github.com/openai/CLIP/blob/main/model-card.md#bias-and-fairness).
42
+ Since our model uses such models as initialization, it will exhibit such biases too.
43
+ Moreover, for learning joint embeddings for other modalities such as audio, thermal, depth, and IMU we leverage datasets that are relatively small. These joint embeddings are thus limited to the concepts present in the datasets. For example, the thermal datasets we used are limited to outdoor street scenes, while the depth datasets are limited to indoor scenes.
44
+
45
+
46
+
47
+ # Training Details
48
+
49
+ ## Training Data
50
+
51
+ <!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
52
+
53
+ ImageBind uses image-paired data for training -- (image, X) where X is one of text, audio, depth, IMU or thermal data.
54
+ In particular, we initialize and freeze the image and text encoders using an OpenCLIP ViT-H encoder.
55
+ We train audio embeddings using Audioset, depth embeddings using the SUN RGB-D dataset, IMU using the Ego4D dataset and thermal embeddings using the LLVIP dataset.
56
+ We provide the exact training data details in the paper.
57
+
58
+
59
+ ## Training Procedure
60
+
61
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
62
+ Please refer to the research paper and github repo for exact details on this.
63
+
64
+ # Evaluation
65
+
66
+ ## Testing Data, Factors & Metrics
67
+
68
+ We evaluate the model on a variety of different classification benchmarks for each modality.
69
+ The evaluation details are presented in the paper.
70
+ The models performance is measured using standard classification metrics such as accuracy and mAP.
71
+
72
+ # Citation
73
+
74
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
75
+
76
+ **BibTeX:**
77
+ ```
78
+ @inproceedings{girdhar2023imagebind,
79
+ title={ImageBind: One Embedding Space To Bind Them All},
80
+ author={Girdhar, Rohit and El-Nouby, Alaaeldin and Liu, Zhuang
81
+ and Singh, Mannat and Alwala, Kalyan Vasudev and Joulin, Armand and Misra, Ishan},
82
+ booktitle={CVPR},
83
+ year={2023}
84
+ }
85
+ ```
86
+
87
+
88
+ # Model Card Contact
89
+
90
+ Please reach out to the authors at: rgirdhar@meta.com imisra@meta.com alaaelnouby@gmail.com
91
+
92
+ # How to Get Started with the Model
93
+
94
+ Our github repo provides a simple example to extract embeddings from images, audio etc.
models/third_party/ImageBind/requirements.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ torch>=2.0.0
2
+ torchvision # because torch version already specific, the right torchvision will be derived automatically
3
+ torchaudio # because torch version already specific, the right torchaudio will be derived automatically
4
+ pytorchvideo @ git+https://github.com/facebookresearch/pytorchvideo.git@6cdc929315aab1b5674b6dcf73b16ec99147735f
5
+ timm
6
+ ftfy
7
+ regex
8
+ einops
9
+ iopath
10
+ numpy>=1.19
11
+ types-regex
models/third_party/ImageBind/setup.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from setuptools import setup, find_packages
2
+
3
+ with open('requirements.txt') as f:
4
+ required = f.read().splitlines()
5
+
6
+ setup(
7
+ name='imagebind',
8
+ version='0.1.0',
9
+ packages=find_packages(),
10
+ package_data={
11
+ 'imagebind': ['bpe/bpe_simple_vocab_16e6.txt.gz'],
12
+ },
13
+ description='A brief description of the package',
14
+ long_description=open('README.md', encoding='utf-8').read(),
15
+ long_description_content_type="text/markdown",
16
+ url='https://github.com/facebookresearch/ImageBind',
17
+ classifiers=[
18
+ 'Programming Language :: Python :: 3',
19
+ 'License :: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International',
20
+ ],
21
+ install_requires=required,
22
+ dependency_links=['https://download.pytorch.org/whl/cu113'],
23
+ )
models/third_party/classify_street_like_view/core/__init__.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Core modules for the street-view-like classifier."""
2
+
3
+ from .data import (
4
+ StreetViewDataset,
5
+ UnlabeledPhotoDataset,
6
+ collate_fn,
7
+ collate_unlabeled,
8
+ load_extra_npz,
9
+ load_labels,
10
+ make_split,
11
+ normalize_id,
12
+ resolve_from_row,
13
+ resolve_image_path,
14
+ )
15
+ from .metrics import evaluate, format_epoch_line, select_threshold
16
+ from .model import (
17
+ AttentionPool,
18
+ FocalLoss,
19
+ StreetViewLoRAModel,
20
+ build_criterion,
21
+ build_model,
22
+ load_trained_model,
23
+ save_trained_model,
24
+ )
25
+ from .utils import ensure_dir, human_bytes, parse_device, patch_torch_load_check
26
+
27
+ __all__ = [
28
+ "StreetViewDataset", "UnlabeledPhotoDataset", "collate_fn", "collate_unlabeled",
29
+ "load_extra_npz", "load_labels", "make_split", "normalize_id",
30
+ "resolve_from_row", "resolve_image_path",
31
+ "evaluate", "format_epoch_line", "select_threshold",
32
+ "AttentionPool", "FocalLoss", "StreetViewLoRAModel", "build_criterion",
33
+ "build_model", "load_trained_model", "save_trained_model",
34
+ "ensure_dir", "human_bytes", "parse_device", "patch_torch_load_check",
35
+ ]
models/third_party/classify_street_like_view/core/data.py ADDED
@@ -0,0 +1,245 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Dataset, splitting, image path resolution, and extra-feature loading."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from pathlib import Path
6
+
7
+ import numpy as np
8
+ import pandas as pd
9
+ import torch
10
+ from PIL import Image
11
+ from sklearn.model_selection import GroupShuffleSplit, StratifiedShuffleSplit
12
+ from torch.utils.data import Dataset
13
+
14
+ Image.MAX_IMAGE_PIXELS = None
15
+
16
+
17
+ # ───────────────────────────── id / path helpers ─────────────────────────────
18
+
19
+ def normalize_id(photo_id) -> str:
20
+ """'50416657451.0' -> '50416657451'. Non-numeric ids pass through sanitised."""
21
+ s = str(photo_id).strip()
22
+ try:
23
+ return str(int(float(s)))
24
+ except (TypeError, ValueError):
25
+ return s.replace("/", "_")
26
+
27
+
28
+ def resolve_image_path(photo_id: str, photos_dirs: list[Path]) -> Path | None:
29
+ """Search each directory for {photo_id}.jpg. Returns the first hit, else None."""
30
+ fname = f"{photo_id}.jpg"
31
+ for d in photos_dirs:
32
+ candidate = Path(d) / fname
33
+ if candidate.exists():
34
+ return candidate
35
+ return None
36
+
37
+
38
+ def resolve_from_row(row: pd.Series, photos_dirs: list[Path],
39
+ id_col: str = "id", path_col: str = "file_path") -> Path | None:
40
+ """
41
+ Prefer an explicit file_path column (relative paths resolved against each
42
+ photos_dir and its parent), then fall back to an id-based lookup.
43
+ """
44
+ raw = str(row.get(path_col, "") or "").strip()
45
+ if raw:
46
+ candidate = Path(raw)
47
+ if candidate.exists():
48
+ return candidate
49
+ for d in photos_dirs:
50
+ for base in (Path(d), Path(d).parent):
51
+ alt = base / candidate
52
+ if alt.exists():
53
+ return alt
54
+ return resolve_image_path(normalize_id(row[id_col]), photos_dirs)
55
+
56
+
57
+ # ───────────────────────────── extra features ────────────────────────────────
58
+
59
+ def load_extra_npz(paths: list[Path], verbose: bool = True) -> tuple[dict, int]:
60
+ """
61
+ Load and horizontally concatenate one or more extra-feature .npz files.
62
+
63
+ Each file must carry ids / embeddings / error arrays. Entries whose error
64
+ string is non-empty are skipped, so they fall back to zeros at lookup time.
65
+
66
+ Returns (id -> vector lookup, total concatenated dim).
67
+ """
68
+ if not paths:
69
+ return {}, 0
70
+
71
+ merged: dict[str, np.ndarray] = {}
72
+ total_dim = 0
73
+ for p in paths:
74
+ data = np.load(p, allow_pickle=True)
75
+ ids_arr = np.array([normalize_id(i) for i in data["ids"]])
76
+ embs = data["embeddings"].astype(np.float32)
77
+ errors = np.array([str(e) for e in data["error"]])
78
+ ok = errors == ""
79
+ total_dim += embs.shape[1]
80
+
81
+ for i, pid in enumerate(ids_arr):
82
+ if not ok[i]:
83
+ continue
84
+ if pid in merged:
85
+ merged[pid] = np.concatenate([merged[pid], embs[i]])
86
+ else:
87
+ merged[pid] = embs[i]
88
+
89
+ n_err = int((~ok).sum())
90
+ if n_err and verbose:
91
+ print(f"[Info] {n_err} error entries in {Path(p).name}; they will be zeros.",
92
+ flush=True)
93
+
94
+ # Drop any id that did not receive every source's block (ragged -> unusable)
95
+ if len(paths) > 1:
96
+ merged = {k: v for k, v in merged.items() if v.shape[0] == total_dim}
97
+
98
+ return merged, total_dim
99
+
100
+
101
+ # ───────────────────────────── splitting ─────────────────────────────────────
102
+
103
+ def make_split(df: pd.DataFrame, label_col: str, group_col: str | None,
104
+ val_size: float, seed: int, verbose: bool = True):
105
+ """
106
+ Grouped split by group_col when present (prevents a photographer's style from
107
+ leaking across the split), otherwise a stratified split.
108
+
109
+ Returns (train_idx, val_idx, is_grouped).
110
+ """
111
+ y = df[label_col].values
112
+ if group_col and group_col in df.columns:
113
+ groups = df[group_col].astype(str).values
114
+ splitter = GroupShuffleSplit(n_splits=1, test_size=val_size, random_state=seed)
115
+ train_idx, val_idx = next(splitter.split(df, y, groups=groups))
116
+ grouped = True
117
+ if verbose:
118
+ print(f"[Split] grouped by '{group_col}' "
119
+ f"train={len(train_idx)} val={len(val_idx)}", flush=True)
120
+ else:
121
+ splitter = StratifiedShuffleSplit(n_splits=1, test_size=val_size, random_state=seed)
122
+ train_idx, val_idx = next(splitter.split(df, y))
123
+ grouped = False
124
+ if verbose:
125
+ print(f"[Split] ungrouped train={len(train_idx)} val={len(val_idx)}", flush=True)
126
+
127
+ if verbose:
128
+ print(f" train positive rate: {y[train_idx].mean():.3f} "
129
+ f"val positive rate: {y[val_idx].mean():.3f}", flush=True)
130
+ return train_idx, val_idx, grouped
131
+
132
+
133
+ def load_labels(labels_csv: Path, id_col: str = "id", label_col: str = "label",
134
+ verbose: bool = True) -> pd.DataFrame:
135
+ """Read the label CSV, keeping only clean binary rows."""
136
+ df = pd.read_csv(labels_csv, dtype={id_col: str})
137
+ df = df[df[label_col].isin([0, 1, 0.0, 1.0])].copy()
138
+ df[label_col] = df[label_col].astype(int)
139
+ if verbose:
140
+ n_pos = int(df[label_col].sum())
141
+ print(f"[Data] {len(df)} labeled rows (pos={n_pos}, neg={len(df) - n_pos})",
142
+ flush=True)
143
+ return df
144
+
145
+
146
+ # ───────────────────────────── datasets ──────────────────────────────────────
147
+
148
+ class StreetViewDataset(Dataset):
149
+ """Labeled dataset for training/validation."""
150
+
151
+ def __init__(self, df: pd.DataFrame, photos_dirs: list[Path], processor,
152
+ extra_lookup: dict, extra_dim: int,
153
+ id_col: str = "id", label_col: str = "label"):
154
+ self.df = df.reset_index(drop=True)
155
+ self.photos_dirs = [Path(d) for d in photos_dirs]
156
+ self.processor = processor
157
+ self.extra_lookup = extra_lookup
158
+ self.extra_dim = extra_dim
159
+ self.id_col = id_col
160
+ self.label_col = label_col
161
+
162
+ def __len__(self) -> int:
163
+ return len(self.df)
164
+
165
+ def __getitem__(self, idx: int):
166
+ row = self.df.iloc[idx]
167
+ path = resolve_from_row(row, self.photos_dirs, self.id_col)
168
+
169
+ try:
170
+ image = Image.open(path).convert("RGB") if path else None
171
+ except Exception:
172
+ image = None
173
+ if image is None:
174
+ # Black placeholder keeps the batch shape intact on load failure.
175
+ image = Image.new("RGB", (224, 224), color=0)
176
+
177
+ pixel_values = self.processor(images=image, return_tensors="pt").pixel_values.squeeze(0)
178
+ label = torch.tensor(float(row[self.label_col]), dtype=torch.float32)
179
+
180
+ if self.extra_dim > 0:
181
+ pid = normalize_id(row[self.id_col])
182
+ vec = self.extra_lookup.get(pid)
183
+ if vec is None:
184
+ vec = np.zeros(self.extra_dim, dtype=np.float32)
185
+ extra = torch.tensor(vec, dtype=torch.float32)
186
+ else:
187
+ extra = torch.zeros(0)
188
+
189
+ return pixel_values, label, extra
190
+
191
+
192
+ class UnlabeledPhotoDataset(Dataset):
193
+ """Inference dataset over bare photo ids; reports whether each image loaded."""
194
+
195
+ def __init__(self, ids: list[str], photos_dirs: list[Path], processor,
196
+ extra_lookup: dict, extra_dim: int):
197
+ self.ids = ids
198
+ self.photos_dirs = [Path(d) for d in photos_dirs]
199
+ self.processor = processor
200
+ self.extra_lookup = extra_lookup
201
+ self.extra_dim = extra_dim
202
+
203
+ def __len__(self) -> int:
204
+ return len(self.ids)
205
+
206
+ def __getitem__(self, idx: int):
207
+ pid = self.ids[idx]
208
+ path = resolve_image_path(pid, self.photos_dirs)
209
+
210
+ load_ok = False
211
+ image = None
212
+ if path is not None:
213
+ try:
214
+ image = Image.open(path).convert("RGB")
215
+ load_ok = True
216
+ except Exception:
217
+ image = None
218
+ if image is None:
219
+ image = Image.new("RGB", (224, 224), color=0)
220
+
221
+ pixel_values = self.processor(images=image, return_tensors="pt").pixel_values.squeeze(0)
222
+
223
+ if self.extra_dim > 0:
224
+ vec = self.extra_lookup.get(pid)
225
+ if vec is None:
226
+ vec = np.zeros(self.extra_dim, dtype=np.float32)
227
+ extra = torch.tensor(vec, dtype=torch.float32)
228
+ else:
229
+ extra = torch.zeros(0)
230
+
231
+ return pixel_values, extra, load_ok
232
+
233
+
234
+ def collate_fn(batch):
235
+ pixels = torch.stack([b[0] for b in batch])
236
+ labels = torch.stack([b[1] for b in batch])
237
+ extras = torch.stack([b[2] for b in batch])
238
+ return pixels, labels, extras
239
+
240
+
241
+ def collate_unlabeled(batch):
242
+ pixels = torch.stack([b[0] for b in batch])
243
+ extras = torch.stack([b[1] for b in batch])
244
+ load_ok = [b[2] for b in batch]
245
+ return pixels, extras, load_ok
models/third_party/classify_street_like_view/core/features.py ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Extra-feature extractors: SegFormer GAP embeddings and Places365 scene priors.
3
+
4
+ Both write the same .npz schema so they can be stacked by load_extra_npz():
5
+ ids (N,) str
6
+ embeddings (N, D) float32
7
+ labels (N,) float32
8
+ file_paths (N,) str
9
+ error (N,) str -- '' on success
10
+ model_name scalar str
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ from pathlib import Path
16
+
17
+ import numpy as np
18
+ import torch
19
+ import torch.nn as nn
20
+ from PIL import Image
21
+
22
+ from .utils import load_with_hf_fallback, patch_torch_load_check
23
+
24
+ Image.MAX_IMAGE_PIXELS = None
25
+
26
+ SEGFORMER_MODEL = "nvidia/segformer-b0-finetuned-cityscapes-1024-1024"
27
+ SEGFORMER_DIM = 512 # 32 + 64 + 160 + 256 across the four encoder stages
28
+
29
+ PLACES365_URL = "http://places2.csail.mit.edu/models_places365/resnet50_places365.pth.tar"
30
+ PLACES365_FILENAME = "resnet50_places365.pth.tar"
31
+ PLACES365_CLASSES = 365
32
+ PLACES365_DIM = 365
33
+
34
+ _IMAGENET_MEAN = [0.485, 0.456, 0.406]
35
+ _IMAGENET_STD = [0.229, 0.224, 0.225]
36
+
37
+
38
+ # ───────────────────────────── SegFormer ─────────────────────────────────────
39
+
40
+ def load_segformer(model_name: str = SEGFORMER_MODEL, device=None):
41
+ """
42
+ Load SegFormer for dense feature extraction.
43
+
44
+ The cityscapes checkpoints ship only legacy .bin weights, so the transformers
45
+ torch>=2.6 guard is bypassed while loading from the local HF cache.
46
+ """
47
+ from transformers import SegformerForSemanticSegmentation, SegformerImageProcessor
48
+
49
+ with patch_torch_load_check():
50
+ processor = load_with_hf_fallback(
51
+ SegformerImageProcessor.from_pretrained, model_name)
52
+ model = load_with_hf_fallback(
53
+ SegformerForSemanticSegmentation.from_pretrained,
54
+ model_name, use_safetensors=False)
55
+
56
+ model.eval()
57
+ if device is not None:
58
+ model.to(device)
59
+ return processor, model
60
+
61
+
62
+ @torch.no_grad()
63
+ def segformer_embed(image: Image.Image, processor, model, device) -> np.ndarray:
64
+ """
65
+ Global-average-pool each encoder stage and concatenate.
66
+
67
+ Stage 0: (B, 32, H/4, W/4) -> 32
68
+ Stage 1: (B, 64, H/8, W/8) -> 64
69
+ Stage 2: (B, 160, H/16, W/16) -> 160
70
+ Stage 3: (B, 256, H/32, W/32) -> 256
71
+ = 512 dims (b0)
72
+
73
+ Preserves spatial-layout signal that per-class pixel ratios would collapse.
74
+ """
75
+ inputs = processor(images=image, return_tensors="pt").to(device)
76
+ outputs = model(**inputs, output_hidden_states=True)
77
+
78
+ states = outputs.hidden_states
79
+ pooled = [s.mean(dim=(2, 3)) for s in states] # GAP each stage
80
+ return torch.cat(pooled, dim=1).squeeze(0).cpu().float().numpy()
81
+
82
+
83
+ # ───────────────────────────── Places365 ─────────────────────────────────────
84
+
85
+ def download_places365_weights(cache_dir: Path) -> Path:
86
+ """Fetch the ResNet50-Places365 checkpoint (~100 MB) if not already cached."""
87
+ cache_dir = Path(cache_dir)
88
+ cache_dir.mkdir(parents=True, exist_ok=True)
89
+ dest = cache_dir / PLACES365_FILENAME
90
+
91
+ if dest.exists():
92
+ print(f"[Weights] using cached Places365 weights: {dest}", flush=True)
93
+ return dest
94
+
95
+ print("[Weights] downloading Places365 ResNet50 (~100 MB) from MIT CSAIL ...", flush=True)
96
+ import urllib.request
97
+
98
+ def _progress(count, block_size, total_size):
99
+ if total_size > 0:
100
+ pct = count * block_size * 100 / total_size
101
+ print(f"\r {min(pct, 100):.1f}%", end="", flush=True)
102
+
103
+ try:
104
+ urllib.request.urlretrieve(PLACES365_URL, dest, reporthook=_progress)
105
+ print(flush=True)
106
+ except Exception as exc:
107
+ raise SystemExit(
108
+ f"Failed to download Places365 weights from {PLACES365_URL}\n"
109
+ f"Error: {exc}\n"
110
+ f"Download manually and place at: {dest}"
111
+ )
112
+
113
+ print(f"[Weights] saved to {dest}", flush=True)
114
+ return dest
115
+
116
+
117
+ def load_places365(weights_path: Path, device=None, penultimate: bool = False):
118
+ """
119
+ ResNet50 trained on Places365.
120
+
121
+ penultimate=False -> 365-dim softmax over scene categories (street, plaza,
122
+ alley, crosswalk, ...). This is what the classifier uses.
123
+ penultimate=True -> 2048-dim avgpool features before the FC layer.
124
+ """
125
+ import torchvision.models as tvm
126
+ import torchvision.transforms as T
127
+
128
+ model = tvm.resnet50(weights=None)
129
+ model.fc = nn.Linear(model.fc.in_features, PLACES365_CLASSES)
130
+
131
+ checkpoint = torch.load(weights_path, map_location="cpu", weights_only=False)
132
+ state_dict = {k.replace("module.", ""): v for k, v in checkpoint["state_dict"].items()}
133
+ model.load_state_dict(state_dict)
134
+
135
+ if penultimate:
136
+ model.fc = nn.Identity()
137
+
138
+ model.eval()
139
+ if device is not None:
140
+ model.to(device)
141
+
142
+ transform = T.Compose([
143
+ T.Resize(256),
144
+ T.CenterCrop(224),
145
+ T.ToTensor(),
146
+ T.Normalize(mean=_IMAGENET_MEAN, std=_IMAGENET_STD),
147
+ ])
148
+ return model, transform
149
+
150
+
151
+ @torch.no_grad()
152
+ def places365_embed(image: Image.Image, model, transform, device,
153
+ penultimate: bool = False) -> np.ndarray:
154
+ tensor = transform(image).unsqueeze(0).to(device)
155
+ logits = model(tensor)
156
+ out = logits if penultimate else torch.softmax(logits, dim=1)
157
+ return out.squeeze(0).cpu().float().numpy()
158
+
159
+
160
+ # ───────────────────────────── npz checkpointing ─────────────────────────────
161
+
162
+ def load_npz_checkpoint(path: Path):
163
+ """Resume support: returns accumulated arrays plus the set of finished ids."""
164
+ path = Path(path)
165
+ if not path.exists():
166
+ return [], [], [], [], [], set()
167
+
168
+ data = np.load(path, allow_pickle=True)
169
+ ids = [str(i) for i in data["ids"]]
170
+ embeddings = [e for e in data["embeddings"]]
171
+ labels = [float(l) for l in data["labels"]]
172
+ file_paths = [str(f) for f in data["file_paths"]]
173
+ errors = [str(e) for e in data["error"]]
174
+ return ids, embeddings, labels, file_paths, errors, set(ids)
175
+
176
+
177
+ def save_npz_checkpoint(path: Path, ids, embeddings, labels, file_paths, errors,
178
+ model_name: str) -> None:
179
+ path = Path(path)
180
+ path.parent.mkdir(parents=True, exist_ok=True)
181
+ np.savez_compressed(
182
+ path,
183
+ ids=np.array(ids, dtype=object),
184
+ embeddings=np.array(embeddings, dtype=np.float32),
185
+ labels=np.array(labels, dtype=np.float32),
186
+ file_paths=np.array(file_paths, dtype=object),
187
+ error=np.array(errors, dtype=object),
188
+ model_name=np.array(model_name, dtype=object),
189
+ )
models/third_party/classify_street_like_view/core/metrics.py ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Threshold selection and evaluation under a precision floor."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import numpy as np
6
+ from sklearn.metrics import (
7
+ average_precision_score,
8
+ confusion_matrix,
9
+ precision_recall_curve,
10
+ roc_auc_score,
11
+ )
12
+
13
+
14
+ def select_threshold(y_true: np.ndarray, y_prob: np.ndarray,
15
+ min_precision: float = 0.90,
16
+ min_positive_support: int = 20) -> float:
17
+ """
18
+ Pick the threshold that maximises recall subject to precision >= min_precision.
19
+
20
+ Thresholds predicting fewer than min_positive_support positives are rejected:
21
+ without that floor the curve's tail yields degenerate 100%-precision points
22
+ backed by a handful of samples.
23
+ """
24
+ precision, recall, thresholds = precision_recall_curve(y_true, y_prob)
25
+ best_threshold, best_recall = 0.5, -1.0
26
+
27
+ for p, r, t in zip(precision[:-1], recall[:-1], thresholds):
28
+ if int((y_prob >= t).sum()) < min_positive_support:
29
+ continue
30
+ if p >= min_precision and r > best_recall:
31
+ best_recall, best_threshold = r, t
32
+
33
+ if best_recall < 0:
34
+ print(f"[Warn] no threshold reaches precision>={min_precision:.2f} with "
35
+ f">={min_positive_support} predicted positives; falling back to 0.5",
36
+ flush=True)
37
+ best_threshold = 0.5
38
+
39
+ return float(best_threshold)
40
+
41
+
42
+ def evaluate(y_true: np.ndarray, y_prob: np.ndarray, threshold: float) -> dict:
43
+ """Confusion matrix plus the standard scalar metrics at a fixed threshold."""
44
+ y_true = np.asarray(y_true).astype(int)
45
+ y_pred = (np.asarray(y_prob) >= threshold).astype(int)
46
+
47
+ tn, fp, fn, tp = confusion_matrix(y_true, y_pred, labels=[0, 1]).ravel()
48
+ precision = tp / (tp + fp) if (tp + fp) else float("nan")
49
+ recall = tp / (tp + fn) if (tp + fn) else float("nan")
50
+ specificity = tn / (tn + fp) if (tn + fp) else float("nan")
51
+ denom = precision + recall
52
+ f1 = (2 * precision * recall / denom) if denom else float("nan")
53
+
54
+ multiclass = len(set(y_true.tolist())) > 1
55
+ roc_auc = roc_auc_score(y_true, y_prob) if multiclass else float("nan")
56
+ ap = average_precision_score(y_true, y_prob) if multiclass else float("nan")
57
+
58
+ return {
59
+ "threshold": float(threshold),
60
+ "precision": float(precision),
61
+ "recall": float(recall),
62
+ "specificity": float(specificity),
63
+ "f1": float(f1),
64
+ "roc_auc": float(roc_auc),
65
+ "average_precision": float(ap),
66
+ "confusion_matrix": {"tn": int(tn), "fp": int(fp), "fn": int(fn), "tp": int(tp)},
67
+ }
68
+
69
+
70
+ def format_epoch_line(epoch: int, train_loss: float, val_loss: float, m: dict) -> str:
71
+ cm = m["confusion_matrix"]
72
+ return (
73
+ f"[Epoch {epoch:3d}] train_loss={train_loss:.4f} val_loss={val_loss:.4f} "
74
+ f"F1={m['f1']:.4f} Recall={m['recall']:.4f} Prec={m['precision']:.4f} "
75
+ f"ROC-AUC={m['roc_auc']:.4f} thresh={m['threshold']:.4f} "
76
+ f"TP={cm['tp']} FN={cm['fn']}"
77
+ )
models/third_party/classify_street_like_view/core/model.py ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Model definitions: LoRA backbone + optional attention pooling + head."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import torch
6
+ import torch.nn as nn
7
+ import torch.nn.functional as F
8
+
9
+
10
+ # ───────────────────────────── losses ────────────────────────────────────────
11
+
12
+ class FocalLoss(nn.Module):
13
+ """
14
+ Binary focal loss with optional pos_weight for class imbalance.
15
+
16
+ FL(p_t) = -(1 - p_t)^gamma * BCE(p_t)
17
+
18
+ gamma=0 reduces to standard BCE. gamma=2 is the RetinaNet default: it
19
+ down-weights easy examples (high p_t) so training focuses on hard ones.
20
+ pos_weight behaves exactly as in BCEWithLogitsLoss.
21
+ """
22
+
23
+ def __init__(self, gamma: float = 2.0, pos_weight: torch.Tensor | None = None):
24
+ super().__init__()
25
+ self.gamma = gamma
26
+ self.pos_weight = pos_weight
27
+
28
+ def forward(self, logits: torch.Tensor, targets: torch.Tensor) -> torch.Tensor:
29
+ bce = F.binary_cross_entropy_with_logits(
30
+ logits, targets, reduction="none", pos_weight=self.pos_weight
31
+ )
32
+ probs = torch.sigmoid(logits)
33
+ p_t = probs * targets + (1.0 - probs) * (1.0 - targets)
34
+ focal_weight = (1.0 - p_t) ** self.gamma
35
+ return (focal_weight * bce).mean()
36
+
37
+
38
+ def build_criterion(focal_gamma: float, pos_weight: torch.Tensor) -> nn.Module:
39
+ """BCE when focal_gamma <= 0, otherwise focal loss."""
40
+ if focal_gamma and focal_gamma > 0.0:
41
+ return FocalLoss(gamma=focal_gamma, pos_weight=pos_weight)
42
+ return nn.BCEWithLogitsLoss(pos_weight=pos_weight)
43
+
44
+
45
+ # ───────────────────────────── pooling ───────────────────────────────────────
46
+
47
+ class AttentionPool(nn.Module):
48
+ """
49
+ Learned soft-attention pooling over ViT patch tokens.
50
+
51
+ A single linear layer scores each patch token; softmax turns the scores into
52
+ an attention distribution; the output is the weighted sum. The CLS token
53
+ (index 0) is excluded -- it already encodes global context, while the patch
54
+ tokens carry the spatial signal.
55
+
56
+ NOTE (empirical): across the full 16-cell ablation this consistently *hurt*
57
+ (-0.006 to -0.027 F1). DINOv3-L's CLS token already aggregates spatial
58
+ context through 24 layers of self-attention, so an external pool competes
59
+ with the backbone rather than complementing it. Kept for reproducibility.
60
+ """
61
+
62
+ def __init__(self, dim: int):
63
+ super().__init__()
64
+ self.query = nn.Linear(dim, 1, bias=False)
65
+
66
+ def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
67
+ patches = hidden_states[:, 1:, :] # (B, N, D) -- drop CLS
68
+ scores = self.query(patches) # (B, N, 1)
69
+ weights = torch.softmax(scores, dim=1) # (B, N, 1)
70
+ return (weights * patches).sum(dim=1) # (B, D)
71
+
72
+
73
+ # ───────────────────────────── model ─────────────────────────────────────────
74
+
75
+ class StreetViewLoRAModel(nn.Module):
76
+ """
77
+ Backbone (with LoRA adapters) + optional attention pooling + classifier head.
78
+
79
+ Feature assembly:
80
+ use_attn_pool=False: [CLS] -> D
81
+ use_attn_pool=True : [CLS || attn_pool(patches)] -> 2D
82
+ + extra_dim (SegFormer GAP 512 + Place365 365 = 877) appended
83
+
84
+ Head is a single Linear when head_hidden is empty, otherwise an MLP with
85
+ ReLU between each hidden layer.
86
+ """
87
+
88
+ def __init__(
89
+ self,
90
+ backbone,
91
+ backbone_dim: int,
92
+ extra_dim: int = 0,
93
+ head_hidden: list | None = None,
94
+ use_attn_pool: bool = False,
95
+ ):
96
+ super().__init__()
97
+ self.backbone = backbone
98
+ self.extra_dim = extra_dim
99
+ self.head_hidden = list(head_hidden or [])
100
+ self.use_attn_pool = use_attn_pool
101
+
102
+ feat_dim = (2 * backbone_dim) if use_attn_pool else backbone_dim
103
+ total_dim = feat_dim + extra_dim
104
+ self.total_dim = total_dim
105
+
106
+ if use_attn_pool:
107
+ self.attn_pool = AttentionPool(backbone_dim)
108
+
109
+ if self.head_hidden:
110
+ layers, in_dim = [], total_dim
111
+ for h in self.head_hidden:
112
+ layers += [nn.Linear(in_dim, h), nn.ReLU()]
113
+ in_dim = h
114
+ layers.append(nn.Linear(in_dim, 1))
115
+ self.head = nn.Sequential(*layers)
116
+ else:
117
+ self.head = nn.Linear(total_dim, 1)
118
+
119
+ def describe_head(self) -> str:
120
+ pool_tag = "CLS+AttnPool" if self.use_attn_pool else "CLS"
121
+ if self.head_hidden:
122
+ dims = [self.total_dim] + self.head_hidden + [1]
123
+ return f"{pool_tag} -> MLP {dims}"
124
+ return f"{pool_tag} -> Linear ({self.total_dim} -> 1)"
125
+
126
+ def forward(self, pixel_values: torch.Tensor, extra: torch.Tensor) -> torch.Tensor:
127
+ outputs = self.backbone(pixel_values=pixel_values)
128
+ hidden = outputs.last_hidden_state # (B, 1+N, D)
129
+ cls = hidden[:, 0, :] # (B, D)
130
+
131
+ if self.use_attn_pool:
132
+ pooled = self.attn_pool(hidden)
133
+ feat = torch.cat([cls, pooled], dim=1)
134
+ else:
135
+ feat = cls
136
+
137
+ if self.extra_dim > 0 and extra.shape[1] > 0:
138
+ feat = torch.cat([feat, extra], dim=1)
139
+
140
+ return self.head(feat).squeeze(1) # (B,)
141
+
142
+
143
+ # ───────────────────────────── builders ──────────────────────────────────────
144
+
145
+ def build_backbone(model_name: str, lora_r: int, lora_alpha: int,
146
+ lora_dropout: float, target_modules: list[str], verbose: bool = True):
147
+ """Load a HF vision backbone and wrap it with LoRA adapters."""
148
+ from peft import LoraConfig, get_peft_model
149
+ from transformers import AutoImageProcessor, AutoModel
150
+
151
+ from .utils import load_with_hf_fallback
152
+ processor = load_with_hf_fallback(AutoImageProcessor.from_pretrained, model_name)
153
+ backbone = load_with_hf_fallback(AutoModel.from_pretrained, model_name)
154
+
155
+ lora_config = LoraConfig(
156
+ r=lora_r,
157
+ lora_alpha=lora_alpha,
158
+ lora_dropout=lora_dropout,
159
+ target_modules=list(target_modules),
160
+ bias="none",
161
+ )
162
+ backbone = get_peft_model(backbone, lora_config)
163
+ if verbose:
164
+ backbone.print_trainable_parameters()
165
+ return processor, backbone
166
+
167
+
168
+ def build_model(
169
+ model_name: str,
170
+ lora_r: int,
171
+ lora_alpha: int,
172
+ lora_dropout: float,
173
+ target_modules: list[str],
174
+ extra_dim: int,
175
+ head_hidden: list,
176
+ use_attn_pool: bool,
177
+ device: torch.device,
178
+ verbose: bool = True,
179
+ ):
180
+ """Full construction: processor + LoRA backbone + head, moved to device."""
181
+ processor, backbone = build_backbone(
182
+ model_name, lora_r, lora_alpha, lora_dropout, target_modules, verbose
183
+ )
184
+ backbone_dim = backbone.config.hidden_size
185
+ model = StreetViewLoRAModel(
186
+ backbone, backbone_dim, extra_dim, head_hidden, use_attn_pool
187
+ ).to(device)
188
+ if verbose:
189
+ print(f"[Head] {model.describe_head()}", flush=True)
190
+ return processor, model
191
+
192
+
193
+ def load_trained_model(model_dir, device: torch.device, verbose: bool = True):
194
+ """
195
+ Reconstruct a trained model from a directory containing:
196
+ lora_adapter/ -- peft adapter (save_pretrained)
197
+ head.pt -- head weights + architecture metadata
198
+ metrics.json -- backbone name + selected threshold
199
+
200
+ Returns (processor, model, meta) where meta holds threshold/model_name/etc.
201
+ """
202
+ import json
203
+ from pathlib import Path
204
+
205
+ from peft import PeftModel
206
+ from transformers import AutoImageProcessor, AutoModel
207
+
208
+ model_dir = Path(model_dir)
209
+ head_ckpt = torch.load(model_dir / "head.pt", map_location="cpu", weights_only=False)
210
+
211
+ with open(model_dir / "metrics.json") as f:
212
+ metrics = json.load(f)
213
+
214
+ model_name = metrics["model"]
215
+ extra_dim = head_ckpt["extra_dim"]
216
+ head_hidden = head_ckpt["head_hidden"]
217
+ use_attn_pool = head_ckpt["use_attn_pool"]
218
+
219
+ if verbose:
220
+ print(f"[Model] {model_name}", flush=True)
221
+ print(f"[Head] hidden={head_hidden} attn_pool={use_attn_pool} "
222
+ f"extra_dim={extra_dim}", flush=True)
223
+
224
+ from .utils import load_with_hf_fallback
225
+ processor = load_with_hf_fallback(AutoImageProcessor.from_pretrained, model_name)
226
+ base = load_with_hf_fallback(AutoModel.from_pretrained, model_name)
227
+ backbone = PeftModel.from_pretrained(base, model_dir / "lora_adapter")
228
+ backbone_dim = backbone.config.hidden_size
229
+
230
+ model = StreetViewLoRAModel(backbone, backbone_dim, extra_dim, head_hidden, use_attn_pool)
231
+ model.head.load_state_dict(head_ckpt["head_state_dict"])
232
+ if use_attn_pool and head_ckpt.get("attn_pool_state_dict") is not None:
233
+ model.attn_pool.load_state_dict(head_ckpt["attn_pool_state_dict"])
234
+ model = model.to(device)
235
+ model.eval()
236
+
237
+ meta = {
238
+ "model_name": model_name,
239
+ "threshold": metrics.get("threshold", 0.5),
240
+ "extra_dim": extra_dim,
241
+ "head_hidden": head_hidden,
242
+ "use_attn_pool": use_attn_pool,
243
+ "metrics": metrics,
244
+ }
245
+ return processor, model, meta
246
+
247
+
248
+ def save_trained_model(model: StreetViewLoRAModel, output_dir, extra_dim: int):
249
+ """Save LoRA adapter + head weights + architecture metadata."""
250
+ from pathlib import Path
251
+
252
+ output_dir = Path(output_dir)
253
+ output_dir.mkdir(parents=True, exist_ok=True)
254
+
255
+ model.backbone.save_pretrained(output_dir / "lora_adapter")
256
+ torch.save(
257
+ {
258
+ "head_state_dict": model.head.state_dict(),
259
+ "attn_pool_state_dict": (
260
+ model.attn_pool.state_dict() if model.use_attn_pool else None
261
+ ),
262
+ "extra_dim": extra_dim,
263
+ "head_hidden": model.head_hidden,
264
+ "use_attn_pool": model.use_attn_pool,
265
+ },
266
+ output_dir / "head.pt",
267
+ )
models/third_party/classify_street_like_view/core/utils.py ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Shared utilities: device selection, HF loading workarounds."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import contextlib
6
+ from pathlib import Path
7
+
8
+ import torch
9
+
10
+
11
+ def parse_device(device_text: str | None = "auto") -> torch.device:
12
+ """Resolve 'auto' to the best available device."""
13
+ if device_text is None or str(device_text).strip().lower() in {"", "auto"}:
14
+ if torch.cuda.is_available():
15
+ return torch.device("cuda")
16
+ mps = getattr(torch.backends, "mps", None)
17
+ if mps is not None and mps.is_available():
18
+ return torch.device("mps")
19
+ return torch.device("cpu")
20
+ return torch.device(device_text)
21
+
22
+
23
+ @contextlib.contextmanager
24
+ def patch_torch_load_check():
25
+ """
26
+ Temporarily bypass the transformers torch>=2.6 guard for .bin checkpoints.
27
+
28
+ Newer transformers refuses to torch.load() legacy .bin files unless torch>=2.6
29
+ (CVE-2025-32434). Some pretrained models (e.g. SegFormer cityscapes) only ship
30
+ .bin. This is safe when loading from the local HuggingFace cache rather than an
31
+ untrusted remote source.
32
+
33
+ The check is *called* inside transformers.modeling_utils, so it must be patched
34
+ there -- patching transformers.utils.import_utils has no effect, because
35
+ modeling_utils bound the name at import time.
36
+ """
37
+ try:
38
+ import transformers.modeling_utils as _mu
39
+ except ImportError:
40
+ yield
41
+ return
42
+
43
+ original = getattr(_mu, "check_torch_load_is_safe", None)
44
+ if original is None:
45
+ yield
46
+ return
47
+
48
+ _mu.check_torch_load_is_safe = lambda *a, **k: None
49
+ try:
50
+ yield
51
+ finally:
52
+ _mu.check_torch_load_is_safe = original
53
+
54
+
55
+ def use_local_hf_cache() -> None:
56
+ """
57
+ Force HuggingFace loads to use the local cache only.
58
+
59
+ An expired or revoked HF token makes the hub return 401 even for public
60
+ repos, which transformers surfaces as the misleading "not a valid model
61
+ identifier". Offline mode skips the network entirely, so an already-cached
62
+ model loads fine.
63
+ """
64
+ import os
65
+ for var in ("HF_HUB_OFFLINE", "TRANSFORMERS_OFFLINE"):
66
+ os.environ[var] = "1"
67
+
68
+
69
+ def load_with_hf_fallback(fn, *args, **kwargs):
70
+ """
71
+ Call fn(); on any hub/auth failure, switch to the local cache and retry once.
72
+
73
+ Keeps the normal online path working for a first-time download while
74
+ surviving an expired token when the model is already cached.
75
+ """
76
+ try:
77
+ return fn(*args, **kwargs)
78
+ except Exception as exc:
79
+ text = f"{type(exc).__name__}: {exc}"
80
+ hub_problem = any(k in text for k in (
81
+ "401", "Unauthorized", "RepositoryNotFound", "not a valid model identifier",
82
+ "token", "offline", "ConnectionError", "Could not reach",
83
+ ))
84
+ if not hub_problem:
85
+ raise
86
+ print("[hf] hub unreachable or token rejected; retrying from local cache",
87
+ flush=True)
88
+ use_local_hf_cache()
89
+ return fn(*args, **kwargs)
90
+
91
+
92
+ def human_bytes(n: int) -> str:
93
+ """Format a byte count for display."""
94
+ step = 1024.0
95
+ for unit in ("B", "KB", "MB", "GB", "TB"):
96
+ if abs(n) < step:
97
+ return f"{n:.1f}{unit}"
98
+ n /= step
99
+ return f"{n:.1f}PB"
100
+
101
+
102
+ def ensure_dir(path: Path) -> Path:
103
+ path.mkdir(parents=True, exist_ok=True)
104
+ return path
models/third_party/models/lora_J/LICENSE.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DINOv3 License
2
+
3
+ *Last Updated: August 19, 2025*
4
+
5
+ **“Agreement”** means the terms and conditions for use, reproduction, distribution and modification of the DINO Materials set forth herein.
6
+
7
+ **“DINO Materials”** means, collectively, Documentation and the models, software and algorithms, including machine-learning model code, trained model weights, inference-enabling code, training-enabling code, fine-tuning enabling code, and other elements of the foregoing distributed by Meta and made available under this Agreement.
8
+
9
+ **“Documentation”** means the specifications, manuals and documentation accompanying
10
+ DINO Materials distributed by Meta.
11
+
12
+ **“Licensee”** or **“you”** means you, or your employer or any other person or entity (if you are entering into this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or regulations to provide legal consent and that has legal authority to bind your employer or such other person or entity if you are entering in this Agreement on their behalf.
13
+
14
+ **“Meta”** or **“we”** means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your principal place of business is in the EEA or Switzerland) or Meta Platforms, Inc. (if you are located outside of the EEA or Switzerland).
15
+
16
+ **“Sanctions”** means any economic or trade sanctions or restrictions administered or enforced by the United States (including the Office of Foreign Assets Control of the U.S. Department of the Treasury (“OFAC”), the U.S. Department of State and the U.S. Department of Commerce), the United Nations, the European Union, or the United Kingdom.
17
+
18
+ **“Trade Controls”** means any of the following: Sanctions and applicable export and import controls.
19
+
20
+ By clicking “I Accept” below or by using or distributing any portion or element of the DINO Materials, you agree to be bound by this Agreement.
21
+
22
+ ## 1. License Rights and Redistribution.
23
+
24
+ a. <ins>Grant of Rights</ins>. You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Meta’s intellectual property or other rights owned by Meta embodied in the DINO Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the DINO Materials.
25
+
26
+ b. <ins>Redistribution and Use</ins>.
27
+
28
+ i. Distribution of DINO Materials, and any derivative works thereof, are subject to the terms of this Agreement. If you distribute or make the DINO Materials, or any derivative works thereof, available to a third party, you may only do so under the terms of this Agreement and you shall provide a copy of this Agreement with any such DINO Materials.
29
+
30
+ ii. If you submit for publication the results of research you perform on, using, or otherwise in connection with DINO Materials, you must acknowledge the use of DINO Materials in your publication.
31
+
32
+ iii. Your use of the DINO Materials must comply with applicable laws and regulations, including Trade Control Laws and applicable privacy and data protection laws.
33
+
34
+ iv. Your use of the DINO Materials will not involve or encourage others to reverse engineer, decompile or discover the underlying components of the DINO Materials.
35
+
36
+ v. You are not the target of Trade Controls and your use of DINO Materials must comply with Trade Controls. You agree not to use, or permit others to use, DINO Materials for any activities subject to the International Traffic in Arms Regulations (ITAR) or end uses prohibited by Trade Controls, including those related to military or warfare purposes, nuclear industries or applications, espionage, or the development or use of guns or illegal weapons.
37
+
38
+ ## 2. User Support.
39
+
40
+ Your use of the DINO Materials is done at your own discretion; Meta does not process any information nor provide any service in relation to such use. Meta is under no obligation to provide any support services for the DINO Materials. Any support provided is “as is”, “with all faults”, and without warranty of any kind.
41
+
42
+ ## 3. Disclaimer of Warranty.
43
+
44
+ UNLESS REQUIRED BY APPLICABLE LAW, THE DINO MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE DINO MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE DINO MATERIALS AND ANY OUTPUT AND RESULTS.
45
+
46
+ ## 4. Limitation of Liability.
47
+
48
+ IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY DIRECT OR INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
49
+
50
+ ## 5. Intellectual Property.
51
+
52
+ a. Subject to Meta’s ownership of DINO Materials and derivatives made by or for Meta, with respect to any derivative works and modifications of the DINO Materials that are made by you, as between you and Meta, you are and will be the owner of such derivative works and modifications.
53
+
54
+ b. If you institute litigation or other proceedings against Meta or any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the DINO Materials, outputs or results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other rights owned or licensable by you, then any licenses granted to you under this Agreement shall terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold harmless Meta from and against any claim by any third party arising out of or related to your use or distribution of the DINO Materials.
55
+
56
+ ## 6. Term and Termination.
57
+
58
+ The term of this Agreement will commence upon your acceptance of this Agreement or access to the DINO Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete and cease use of the DINO Materials. Sections 3, 4 and 7 shall survive the termination of this Agreement.
59
+
60
+ ## 7. Governing Law and Jurisdiction.
61
+
62
+ This Agreement will be governed and construed under the laws of the State of California without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The courts of California shall have exclusive jurisdiction of any dispute arising out of this Agreement.
63
+
64
+ ## 8. Modifications and Amendments.
65
+
66
+ Meta may modify this Agreement from time to time; provided that they are similar in spirit to the current version of the Agreement, but may differ in detail to address new problems or concerns. All such changes will be effective immediately. Your continued use of the DINO Materials after any modification to this Agreement constitutes your agreement to such modification. Except as provided in this Agreement, no modification or addition to any provision of this Agreement will be binding unless it is in writing and signed by an authorized representative of both you and Meta.
models/third_party/models/lora_J/NOTICE.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ # LORA_J street-view classifier weights
2
+
3
+ Built with DINOv3.
4
+
5
+ These weights (a LoRA adapter for `facebook/dinov3-vitl16-pretrain-lvd1689m` and an MLP head) were trained on top of
6
+ DINOv3 and are a derivative of the DINO Materials. They are distributed under the terms of the DINOv3 License
7
+ (https://ai.meta.com/resources/models-and-libraries/dinov3-license); a copy of that licence must accompany them
8
+ (`LICENSE.md` in this folder). Use is subject to its restrictions, including the trade-control and military-use
9
+ restrictions. The DINOv3 base model itself is not included and is downloaded from Hugging Face on first use.