Datasets:
Formats:
json
Languages:
English
Size:
< 1K
Tags:
hotel-identification
image-retrieval
visual-place-recognition
object-centric-retrieval
representative-sample
License:
File size: 7,899 Bytes
59212e9 7519327 59212e9 67f42af 59212e9 67f42af 59212e9 67f42af 59212e9 67f42af 7b19b79 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | ---
license: cc0-1.0
task_categories:
- image-classification
- image-feature-extraction
- visual-document-retrieval
language:
- en
tags:
- hotel-identification
- image-retrieval
- visual-place-recognition
- object-centric-retrieval
- representative-sample
pretty_name: OpenHotels Representative Sample
size_categories:
- n<1K
configs:
- config_name: image_metadata
default: true
data_files:
- split: gallery
path: metadata_gallery.json
- split: test_non_object
path: metadata_test_non_object.json
- split: test_object
path: metadata_test_object.json
- config_name: hotel_metadata
data_files: metadata_hotels.json
---
# OpenHotels Representative Sample
This repository contains a representative sample of OpenHotels for review and inspection. It mirrors the full OpenHotels release structure: image files are stored in tar shards under `shards/`, and metadata files describe the gallery, non-object query images, object-centric query images, and hotel classes.
The sample is intended for data-quality inspection, not benchmark reporting. Use the full OpenHotels dataset for final evaluation.
## Sampling Procedure
The sample was created deterministically from the full OpenHotels release. We selected hotel classes that appear in all three subsets: the gallery, Test Non-Object, and Test Object. From those eligible hotels, we sorted hotel IDs by a SHA-1 hash and selected the first 20 classes. For each selected class, we included up to 10 gallery images, up to 3 Test Non-Object queries, and up to 3 Test Object queries.
This guarantees that every query image in this sample has a matching hotel class represented in the sample gallery.
## Contents
```text
shards/
gallery-00000.tar
test_non_object-00000.tar
test_object-00000.tar
metadata_gallery.json
metadata_test_non_object.json
metadata_test_object.json
metadata_hotels.json
README.md
```
## Statistics
| Subset | Hotels | Images |
| --- | ---: | ---: |
| Gallery | 20 | 126 |
| Test Non-Object | 20 | 52 |
| Test Object | 20 | 60 |
## Metadata
The sample includes the same metadata fields as the full OpenHotels release.
### Image Metadata
All image metadata rows include:
- `path`: image member name inside the tar file listed in `shard`.
- `shard`: relative path to the tar shard containing the image.
- `hotel_id`: stable anonymized hotel class identifier.
- `room`: room identifier associated with the image upload when available. This is not the semantic room/view label.
- `timestamp`: upload timestamp associated with the image.
Gallery rows additionally include:
- `is_object`: whether the gallery image is object-centric.
- `view_type`: room-level view category for non-object gallery images.
- `object_type`: localized object category for object-centric gallery images.
Test Non-Object rows additionally include:
- `view_type`: room-level view category for the query image.
Test Object rows additionally include:
- `object_type`: localized object category for the query image.
`view_type` describes the room-level view depicted in a non-object image. Possible values in the full dataset are: `bedroom`, `bathroom`, `living area`, `hallway`, `kitchen`, `closet`, and `balcony`.
`object_type` describes the localized hotel-room object depicted in an object-centric image. Possible values in the full dataset are: `bed`, `lamp`, `artwork`, `window/curtains`, `toilet`, `nightstand`, `sink`, `seating`, `office desk`, `shower/bathtub`, `tv`, `wardrobe`, `door`, `chest`, `mirror`, `kitchen appliances`, `flooring`, and `sign`.
### Hotel Metadata
Each row in `metadata_hotels.json` describes one hotel class:
- `hotel_id`: stable anonymized hotel class identifier.
- `name`: hotel name.
- `lat`: hotel latitude in decimal degrees.
- `lng`: hotel longitude in decimal degrees.
- `date_added`: timestamp when the hotel record was added.
- `in_gallery`: whether the hotel appears in the gallery subset.
- `in_test_non_object`: whether the hotel appears in the Test Non-Object subset.
- `in_test_object`: whether the hotel appears in the Test Object subset.
## Loading Images
The same helper can load gallery images and both query subsets. The metadata row tells the loader which tar shard contains the image and which member path to read from that shard.
```python
import json
import tarfile
from io import BytesIO
from PIL import Image
def load_image(row):
"""Load one OpenHotels image from its tar shard."""
with tarfile.open(row["shard"], "r") as tar:
image_file = tar.extractfile(row["path"])
return Image.open(BytesIO(image_file.read())).convert("RGB")
def load_metadata(path):
with open(path) as f:
return json.load(f)
```
Load a gallery image. Gallery rows contain `is_object`; non-object gallery rows include `view_type`, and object-centric gallery rows include `object_type`.
```python
gallery = load_metadata("metadata_gallery.json")
gallery_row = gallery[0]
gallery_image = load_image(gallery_row)
print(gallery_row["hotel_id"], gallery_row["path"])
if gallery_row["is_object"]:
print("object type:", gallery_row["object_type"])
else:
print("view type:", gallery_row["view_type"])
```
Load a Test Non-Object query image and inspect its room-level view label.
```python
test_non_object = load_metadata("metadata_test_non_object.json")
non_object_row = test_non_object[0]
non_object_image = load_image(non_object_row)
print(non_object_row["hotel_id"], non_object_row["path"])
print("view type:", non_object_row["view_type"])
```
Load a Test Object query image and inspect its object label.
```python
test_object = load_metadata("metadata_test_object.json")
object_row = test_object[0]
object_image = load_image(object_row)
print(object_row["hotel_id"], object_row["path"])
print("object type:", object_row["object_type"])
```
## Usage
OpenHotels and its associated models are provided to support research and educational work on visual recognition, retrieval, representation learning, and related areas. Because visual datasets and models can be used in contexts beyond those anticipated by their creators, access to OpenHotels and its associated models is gated to support thoughtful, responsible use and to make these usage expectations visible to prospective users.
These resources should not be used:
- to identify, locate, track, profile, or target specific individuals;
- in ways that facilitate surveillance, harassment, discrimination, exploitation, or other harm;
- to infer sensitive personal information about individuals;
- in law-enforcement, immigration-enforcement, military, intelligence, or commercial-surveillance applications without first consulting the maintainers;
- to reconstruct, re-identify, or expose information that has been removed, obscured, or anonymized;
- to redistribute the dataset, model weights, or access credentials to individuals who have not separately received access; or
- to create or release derivative resources that materially increase the risk of misuse without appropriate ethical and safety review.
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.
Users are responsible for determining whether their proposed work requires review by an institutional review board, ethics committee, data-protection office, or other relevant authority. Access to these resources should not be understood as ethical, legal, institutional, or regulatory approval for a particular project.
We encourage users to describe the limitations and foreseeable risks of these resources in resulting publications and other outputs, consider the people and communities who could be affected by their use, and avoid claims or demonstrations that encourage harmful or inappropriate deployment. |