Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: imagenet3d
|
| 3 |
+
extra_gated_fields:
|
| 4 |
+
Name: text
|
| 5 |
+
Affiliation: text
|
| 6 |
+
---
|
| 7 |
+
## ImageNet3D (version 04/09)
|
| 8 |
+
|
| 9 |
+
Helper code: [github.com/wufeim/imagenet3d](https://github.com/wufeim/imagenet3d)
|
| 10 |
+
|
| 11 |
+
### Download Data
|
| 12 |
+
|
| 13 |
+
```py
|
| 14 |
+
from huggingface_hub import hf_hub_download
|
| 15 |
+
hf_hub_download(
|
| 16 |
+
repo_id='ccvl/imagenet3d-0409',
|
| 17 |
+
repo_type='dataset',
|
| 18 |
+
filename='imagenet3d_0409.zip',
|
| 19 |
+
local_dir='/path/to/imagenet3d_0409.zip',
|
| 20 |
+
local_dir_use_symlinks=False)
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
### Example Usage
|
| 24 |
+
|
| 25 |
+
```py
|
| 26 |
+
from PIL import Image
|
| 27 |
+
import numpy as np
|
| 28 |
+
|
| 29 |
+
img_path = 'imagenet3d/bed/n02818832_13.JPEG'
|
| 30 |
+
annot_path = 'imagenet3d/bed/n02818832_13.npz'
|
| 31 |
+
|
| 32 |
+
img = np.array(Image.open(img_path).convert('RGB'))
|
| 33 |
+
annot = dict(np.load(annot_path, allow_pickle=True))['annotations']
|
| 34 |
+
|
| 35 |
+
# Number of objects
|
| 36 |
+
num_objects = len(annot)
|
| 37 |
+
|
| 38 |
+
# Annotation of the first object
|
| 39 |
+
azimuth = annot[0]['azimuth'] # float, [0, 2*pi]
|
| 40 |
+
elevation = annot[0]['elevation'] # float, [0, 2*pi]
|
| 41 |
+
theta = annot[0]['theta'] # float, [0, 2*pi]
|
| 42 |
+
cad_index = annot[0]['cad_index'] # int
|
| 43 |
+
distance = annot[0]['distance'] # float
|
| 44 |
+
viewport = annot[0]['viewport'] # int
|
| 45 |
+
img_height = annot[0]['height'] # numpy.uint16
|
| 46 |
+
img_width = annot[0]['width'] # numpy.uint16
|
| 47 |
+
bbox = annot[0]['bbox'] # numpy.ndarray, (x1, y1, x2, y2)
|
| 48 |
+
category = annot[0]['class'] # str
|
| 49 |
+
principal_x = annot[0]['px'] # float
|
| 50 |
+
principal_y = annot[0]['py'] # float
|
| 51 |
+
|
| 52 |
+
# label indicating the quality of the object, occluded or low quality
|
| 53 |
+
object_status = annot[0]['object_status'] # str, one of ('status_good', 'status_partially', 'status_barely', 'status_bad')
|
| 54 |
+
|
| 55 |
+
# label indicating if multiple objects from same category very close to each other
|
| 56 |
+
dense = annot[0]['dense'] # str, one of ('dense_yes', 'dense_no')
|
| 57 |
+
```
|