Datasets:
The dataset viewer is not available for this split.
Error code: TooBigContentError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
The Hypersim Dataset (Colour and Depth files only)
'color.hdf5' | 'depth_meters.hdf5' |
---|---|
Raw Image | Depth in Meters |
This is a version of the Hypersim dataset, with the colour and depth files duplicated for training depth models., for more details about the dataset please refer to the official page https://github.com/apple/ml-hypersim
To use the dataset I highly recommend streaming the dataset instead of downloading it
from datasets import load_dataset
dataset = load_dataset("alexnasa/ml-hypersim-depthonly", split="train", streaming=True)
print(dataset)
Each correspoinding item in the dataset includes a 'color.hdf5' key and a relevant 'depth_meters.hdf5' The 'color.hdf5' data don't have tone mapping applied, so if needed this code snippet to do it one individual items
from datasets import load_dataset
import io, h5py, numpy as np, matplotlib.pyplot as plt
dataset = load_dataset("alexnasa/ml-hypersim-depthonly", split="train", streaming=True)
item = next(iter(dataset))
def tone_map_color(item):
# Load the raw HDR color image stored in item['color.hdf5']
with h5py.File(io.BytesIO(item['color.hdf5']), 'r') as f:
rgb = f["dataset"][:].astype(np.float32)
# Compute brightness using CCIR601: 0.3*R + 0.59*G + 0.11*B
brightness = 0.3 * rgb[:, :, 0] + 0.59 * rgb[:, :, 1] + 0.11 * rgb[:, :, 2]
# Compute the 90th percentile brightness value
p90 = np.percentile(brightness, 90)
# Set the desired brightness (after tone mapping) for the 90th percentile pixel
brightness_target = 0.8
eps = 1e-4
scale = np.power(brightness_target, 2.2) / p90 if p90 > eps else 1.0
# Apply scaling and gamma correction (gamma = 1/2.2)
rgb_tone = np.power(np.maximum(scale * rgb, 0), 1/2.2)
rgb_tone = np.clip(rgb_tone, 0, 1)
return rgb_tone
# Example usage:
tm_image = tone_map_color(item)
plt.imshow(tm_image)
plt.axis("off")
plt.show()
The 'color.hdf5' includes some inf values due to it synthetic nature, therefore is adviced to mask these data/pixels if not needed The 'depth_meters.hdf5' key stored the depth information in meters, due to the nature of synthetic data some values are stored as nan, and should be ignored and the rest is stored in meters, the values range from 0.000767231 meters to 1901.0 meters!
- Downloads last month
- 556