Datasets:
|
Download README.md from imagingforgood/OpenHotels-DMLR: direct link, hf CLI and curl.
- Browser
- Download file 15.5 kB
-
https://huggingface.co/datasets/imagingforgood/OpenHotels-DMLR/resolve/main/README.md
- Command line
-
hf download hf://datasets/imagingforgood/OpenHotels-DMLR/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/datasets/imagingforgood/OpenHotels-DMLR/resolve/main/README.md
15.5 kB
| license: cc0-1.0 | |
| extra_gated_prompt: 'By requesting access, you agree not to use OpenHotels-DMLR or its associated | |
| models to identify, locate, track, profile, or target specific individuals; infer sensitive | |
| personal information; facilitate surveillance, harassment, discrimination, exploitation, or | |
| other harm; reconstruct or expose information that has been removed, obscured, or anonymized; | |
| or create derivative resources that materially increase the risk of misuse without appropriate | |
| ethical and safety review. | |
| You also agree not to redistribute the resources or access credentials to individuals who | |
| have not separately received access. You understand that proposed uses in law enforcement, | |
| immigration enforcement, military, intelligence, or commercial surveillance contexts warrant | |
| particular scrutiny and should undergo appropriate independent ethical, legal, and institutional | |
| review before proceeding. | |
| ' | |
| extra_gated_fields: | |
| I intend to use these resources for: | |
| type: select | |
| options: | |
| - Research | |
| - Education | |
| - label: Other | |
| value: other | |
| Briefly describe your intended use: text | |
| I have read these usage expectations and agree to use the resources consistently with them: checkbox | |
| pretty_name: OpenHotels-DMLR | |
| language: | |
| - en | |
| task_categories: | |
| - image-feature-extraction | |
| - image-classification | |
| size_categories: | |
| - 100K<n<1M | |
| tags: | |
| - image | |
| - image-retrieval | |
| - hotel-identification | |
| - visual-place-recognition | |
| - bounding-boxes | |
| - webdataset | |
| dataset_info: | |
| features: | |
| - name: jpg | |
| dtype: image | |
| - name: json | |
| dtype: json | |
| - name: __key__ | |
| dtype: string | |
| - name: __url__ | |
| dtype: string | |
| configs: | |
| - config_name: default | |
| data_files: | |
| - split: gallery | |
| path: shards/gallery-*.tar | |
| - split: test | |
| path: shards/test-*.tar | |
| # OpenHotels-DMLR | |
| OpenHotels-DMLR is a benchmark for retrieving matching hotels from photographs. | |
| It contains **420,682 hotel images from 37,728 hotels**, with room-type labels, | |
| object bounding boxes, and public hotel-ID ground truth. The gallery provides | |
| reference images; the test split provides 10,000 query images. | |
| | Split | Images | Hotels | TAR shards | | |
| | --- | ---: | ---: | ---: | | |
| | `gallery` | 410,682 | 37,728 | 211 | | |
| | `test` | 10,000 | 8,962 | 6 | | |
| Every test hotel is represented in the gallery. The gallery also contains | |
| 28,766 hotels without test queries, which serve as distractors. **There is no | |
| training split.** The full package is approximately 217.5 GB, including about | |
| 216 GB of uncompressed image-and-annotation shards. | |
| Repository: [imagingforgood/OpenHotels-DMLR](https://huggingface.co/datasets/imagingforgood/OpenHotels-DMLR). | |
| ## Quick start: stream from Hugging Face | |
| Requires Python 3.11 or later. Request access on the | |
| [dataset page](https://huggingface.co/datasets/imagingforgood/OpenHotels-DMLR) and | |
| accept the usage expectations. Access requests are approved automatically. | |
| Then install the dependencies and sign in with the account that requested access: | |
| ```bash | |
| python -m pip install "datasets>=5.2.0,<6" Pillow | |
| hf auth login | |
| ``` | |
| ```python | |
| from datasets import load_dataset | |
| queries = load_dataset( | |
| "imagingforgood/OpenHotels-DMLR", split="test", streaming=True | |
| ) | |
| sample = next(iter(queries)) | |
| image = sample["jpg"] # PIL image, already upright | |
| metadata = sample["json"] # seven-field annotation dictionary | |
| image_path = sample["__key__"] + ".jpg" | |
| print(image_path, metadata["hotel_id"], metadata["room_labels"]) | |
| ``` | |
| Use `split="gallery"` for the reference collection. To read a downloaded copy, | |
| replace the repository ID with its local directory. For reproducible evaluations, | |
| pass `revision="<commit hash>"` to `load_dataset` and record that revision. | |
| Authenticated access is required for Hub downloads and streaming. | |
| The card declares a JSON feature to preserve object-label dictionaries whose | |
| keys vary between images. In Datasets 5.2.0, its JSON conversion rounds floating | |
| point values to about ten decimal places; the measured maximum coordinate change | |
| in the loader checks was about 5e-11 pixels. The archived JSON retains the | |
| original precision. Use WebDataset or the included reader for exact values. | |
| ## Download all or part of the dataset | |
| ```python | |
| from huggingface_hub import snapshot_download | |
| snapshot_download( | |
| "imagingforgood/OpenHotels-DMLR", | |
| repo_type="dataset", | |
| local_dir="OpenHotels-DMLR", | |
| # revision="<commit hash>", # Pin the same revision used for evaluation. | |
| ) | |
| ``` | |
| To download only the test images and the files needed to inspect them, add: | |
| ```python | |
| allow_patterns = [ | |
| "README.md", "load_openhotels.py", "examples/*", | |
| "test.json", "test_image_mapping.json", "hotel_mapping.json", | |
| "shard_index.json", "shard_manifest.json", "shards/test-*.tar", | |
| ] | |
| # Pass allow_patterns=allow_patterns to snapshot_download(...). | |
| ``` | |
| Retrieval evaluation requires the gallery as well. Full-package validation | |
| requires every file listed in `shard_manifest.json`. The partial-download example | |
| is for query inspection and streaming; it is not a complete benchmark copy. | |
| ## Data format | |
| Each sample contains exactly seven metadata fields: | |
| | Field | Type | Meaning | | |
| | --- | --- | --- | | |
| | `hotel_id` | string | Shared five-digit hotel label, including leading zeros | | |
| | `room` | string | Submitted room identifier; distinct from a semantic room type | | |
| | `timestamp` | string | Upload timestamp preserved as recorded, not verified capture time | | |
| | `width`, `height` | integer | Dimensions of the saved upright JPEG, in pixels | | |
| | `room_labels` | list of strings | Semantic room-type annotations | | |
| | `objects` | dictionary | Object label to a list of `[x_min, y_min, x_max, y_max]` boxes | | |
| Bounding boxes use floating-point pixel coordinates in the original saved image. | |
| Images already have their orientation baked into their pixels, with EXIF | |
| Orientation removed. Do not apply another orientation transform. Resizing or | |
| cropping an image requires transforming its boxes if they are used with the | |
| transformed image. Empty object dictionaries are valid annotation results. | |
| Inherited boxes can extend up to one pixel beyond the image bounds. | |
| Room strings preserve case, whitespace, and leading zeros. They are submitted | |
| identifiers rather than independently verified room identities. Timestamps are | |
| preserved without inferring local time zones. | |
| ### Identifiers and paths | |
| Hotel IDs are strings from `00000` through `37727`, shared across both splits. | |
| Gallery image IDs start at `0000` within each hotel; test image IDs run globally | |
| from `0000` through `9999`. All image IDs use four digits. Directory groups contain | |
| every 1,000 hotel IDs in the gallery and every 1,000 image IDs in the test set. | |
| Each JPEG is immediately followed by a JSON member with the same stem: | |
| ```text | |
| images/gallery/00/00000/0000.jpg | |
| images/gallery/00/00000/0000.json | |
| ... | |
| images/test/0/0000.jpg | |
| images/test/0/0000.json | |
| ``` | |
| These are paths **inside the TAR archives**. Extraction into one directory restores | |
| the paths referenced by the JSON files; extraction is optional. WebDataset's | |
| `__key__` is the member path without its extension. `__url__` identifies the shard. | |
| ### Accompanying files | |
| | File | Contents | | |
| | --- | --- | | |
| | `gallery.json` | `hotels[hotel_id].visits[visit_id].images[image_path]`; hotel names, coordinates, and visit context remain here | | |
| | `test.json` | Flat `image_path -> metadata` dictionary with the seven fields above | | |
| | `hotel_mapping.json` | Release hotel ID to original TraffickCam hotel ID | | |
| | `gallery_image_mapping.json`, `test_image_mapping.json` | Image path to release/TCAM IDs, original source path, size, and image SHA-256 | | |
| | `test_iamge_mapping.json` | Identical compatibility copy of `test_image_mapping.json` | | |
| | `shard_index.json` | Image path to shard, JPEG/JSON byte offsets, and payload sizes | | |
| | `shard_manifest.json` | Shard memberships, sizes, SHA-256 hashes, counts, and accompanying file checksums | | |
| | `load_openhotels.py`, `validate_shards.py` | Standalone reader and full-package validator | | |
| | `examples/` | Runnable streaming, image-access, batching, and evaluation examples | | |
| Gallery image records contain the five image annotation fields; their hotel ID | |
| and room are supplied by the enclosing hotel and visit. Shard JSON records flatten | |
| that context into the same seven fields as `test.json`. Hotel names and coordinates | |
| are available through `gallery.json` and are not duplicated in test records. | |
| Test visit identifiers and date ranges are not part of the public test records. | |
| Original source paths in mappings are provenance references, not download URLs. | |
| There are 211 gallery and 6 test shards, totaling | |
| 216,038,348,800 bytes. Each uncompressed TAR is at most 1,000,000,000 bytes. | |
| Shards preserve the ascending padded-ID order. Image/JSON pairs stay together; | |
| a hotel can span shards. No resizing or recompression occurs during packaging. | |
| Sequential streaming does not require loading `gallery.json` or the full index | |
| into RAM. Random access loads the index; loading the nested gallery JSON requires | |
| more memory. | |
| ## Local usage examples | |
| Run these from a downloaded release directory: | |
| ```bash | |
| python -m pip install -r examples/requirements.txt | |
| python -B examples/stream_huggingface.py --split test --limit 3 | |
| python -B examples/stream_webdataset.py --split gallery --limit 3 | |
| python -B examples/read_image.py --image-path images/test/0/0000.jpg | |
| ``` | |
| The standard-library reader also works directly: | |
| ```python | |
| from load_openhotels import OpenHotels, iter_samples | |
| dataset = OpenHotels(".") | |
| image_bytes, metadata = dataset.read("images/test/0/0000.jpg") | |
| path, image_bytes, metadata = next(iter(iter_samples(".", "gallery"))) | |
| ``` | |
| For image batches, install PyTorch and run: | |
| ```bash | |
| python -m pip install torch | |
| python -B examples/pytorch_dataloader.py --split test --workers 2 --batches 2 | |
| ``` | |
| The example uses CUDA, Apple MPS, or CPU when available and keeps string IDs and | |
| variable-length annotations alongside the batch. Its image preprocessing is an | |
| illustration; use the preprocessing required by your embedding model. See the | |
| [examples guide](examples/README.md) for details and evaluation commands. | |
| ## Evaluation protocol | |
| For **single-image hotel retrieval**, rank gallery images for each test query. | |
| A retrieved image is a positive when its `hotel_id` equals the query's | |
| `hotel_id`. Recall@K is the fraction of test queries with at least one positive | |
| image among the first K results. The unit of ranking is a gallery image; do not | |
| silently collapse repeated hotels into a hotel ranking. | |
| The [evaluation example](examples/evaluate_retrieval.py) accepts a JSON dictionary | |
| from each test image path to its ranked gallery image paths. It checks complete | |
| query coverage, valid gallery membership, and duplicate image results before | |
| calculating Recall@K. Report the dataset revision, model/preprocessing, ranking | |
| method, and K values. There are no baseline model scores in this release package. | |
| Annotations can support subgroup analyses by room type or object presence. | |
| Report the query counts for each subgroup. Multi-image query experiments should | |
| state their grouping rule and aggregation method; public test records support | |
| hotel-level grouping, but do not expose source visit membership. | |
| ## Source and construction | |
| The source is hotel photographs submitted through the | |
| [TraffickCam application](https://www.traffickcam.com/) before January 1, 2026. | |
| Hotel assignments use the resolved canonical server hotel identities from the | |
| 2026 export. Existing room and object annotations were matched through source | |
| image identity, then retained with upright image pixels. The construction did | |
| not regenerate those annotations. | |
| Images without usable room identifiers or completed annotation records were | |
| excluded, as were images on the supplied people-detection list. Subsequent | |
| reviews removed flagged locations/non-hotel content, reviewed cross-hotel | |
| matches, and identified rental properties. Review coverage is incomplete, so | |
| these exclusions do not certify every remaining image or property. | |
| Original source visits group the same hotel and exact room string within a | |
| seven-day window anchored at the first upload. For splitting, same-hotel visit | |
| intervals are merged transitively whenever the gap is less than 30 days, | |
| regardless of room string. Entire temporal groups are held out from the gallery | |
| when any of their images are selected as test queries. Every test hotel retains | |
| same-hotel references separated by at least 30 days in upload time. | |
| Query selection uses prior human assessments, historical image-similarity scores, | |
| and duplicate screening, with seed `20261104`; it is not uniform random sampling. | |
| The historical scores were not recomputed against the final gallery. The 52,831 | |
| unselected images from held-out temporal groups are excluded from this release | |
| and must not be added to the evaluation gallery. The split was frozen on | |
| November 4, 2026. | |
| Inherited bounding boxes were processed with greedy nonmaximum suppression | |
| within each image and exact object label, suppressing at IoU >= 0.95. Larger | |
| boxes have priority, with original annotation order breaking ties. Remaining | |
| coordinates and annotation structures are preserved. | |
| ## Intended use and limitations | |
| This dataset supports research on visual hotel retrieval, image representations, | |
| and analyses of room and object content. Gallery/test hotel overlap is deliberate: | |
| the task is to identify which reference hotel matches a query. | |
| - The release is an evaluation benchmark. Temporal separation does not establish | |
| separation from external training datasets or earlier OpenHotels releases. | |
| Do not use test labels for model fitting or parameter selection when reporting | |
| held-out retrieval performance. | |
| - Coverage follows contributor submissions and available annotations. Geography, | |
| hotel identity, room types, and object categories are unevenly represented. | |
| In the frozen test set, 92.84% of images are assigned to U.S. hotels using hotel | |
| coordinates and Natural Earth country polygons, including nearest-land fallback. | |
| - Object annotations are not guaranteed exhaustive; missing boxes do not establish | |
| object absence. Rare categories support only limited subgroup evaluation. | |
| - Upload timestamps are not capture dates, submitted room identifiers can be noisy, | |
| and hotel information reflects the source export rather than current property | |
| status. Duplicate screening reduces reviewed leakage without proving that every | |
| near-duplicate or incorrect hotel assignment has been removed. | |
| - Hotel matches are dataset labels. Visual similarity alone does not establish an | |
| individual's identity, presence, or movements. | |
| ## Integrity checks | |
| For a complete local package, run: | |
| ```bash | |
| python -B validate_shards.py --workers 4 | |
| ``` | |
| This reads every archived image, checks its SHA-256 against the image mappings, | |
| compares paired annotations with the public JSON, verifies TAR offsets and | |
| archive checksums, and checks exact split membership and padded numbering. It | |
| also checks the accompanying files against the manifest. The release is | |
| self-contained and requires no construction inputs or local audit files. | |
| The Hub-managed `.gitattributes` file, local Python bytecode, and Hugging Face | |
| download caches are ignored by the inventory check. | |
| The package was checked with Hugging Face Datasets 5.2.0 and WebDataset 1.0.2. | |
| Both loaders were exercised across every gallery shard and all 10,000 test images. | |