metadata
pretty_name: imagenet3d
extra_gated_fields:
Name: text
Affiliation: text
ImageNet3D (version 04/09)
Helper code: github.com/wufeim/imagenet3d
Download Data
from huggingface_hub import hf_hub_download
hf_hub_download(
repo_id='ccvl/imagenet3d-0409',
repo_type='dataset',
filename='imagenet3d_0409.zip',
local_dir='/path/to/imagenet3d_0409.zip',
local_dir_use_symlinks=False)
Example Usage
from PIL import Image
import numpy as np
img_path = 'imagenet3d/bed/n02818832_13.JPEG'
annot_path = 'imagenet3d/bed/n02818832_13.npz'
img = np.array(Image.open(img_path).convert('RGB'))
annot = dict(np.load(annot_path, allow_pickle=True))['annotations']
# Number of objects
num_objects = len(annot)
# Annotation of the first object
azimuth = annot[0]['azimuth'] # float, [0, 2*pi]
elevation = annot[0]['elevation'] # float, [0, 2*pi]
theta = annot[0]['theta'] # float, [0, 2*pi]
cad_index = annot[0]['cad_index'] # int
distance = annot[0]['distance'] # float
viewport = annot[0]['viewport'] # int
img_height = annot[0]['height'] # numpy.uint16
img_width = annot[0]['width'] # numpy.uint16
bbox = annot[0]['bbox'] # numpy.ndarray, (x1, y1, x2, y2)
category = annot[0]['class'] # str
principal_x = annot[0]['px'] # float
principal_y = annot[0]['py'] # float
# label indicating the quality of the object, occluded or low quality
object_status = annot[0]['object_status'] # str, one of ('status_good', 'status_partially', 'status_barely', 'status_bad')
# label indicating if multiple objects from same category very close to each other
dense = annot[0]['dense'] # str, one of ('dense_yes', 'dense_no')