File size: 1,671 Bytes
a895585
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: c-uda
---
# ObjectPose9D Dataset

## Data Structure

Each data sample contains 4 attributes:

- **`source`**: Source dataset name (e.g., "cityscapes")
- **`prompt`**: Text description or prompt
- **`image`**: Image data (stored as binary)
- **`map`**: CNOCS Map (stored as binary in EXR format)


### Cityscapes Subset
Due to license restrictions, images from the **Cityscapes** source cannot be redistributed directly.

- For Cityscapes samples, the `image` field contains only the **relative path** within `leftImg8bit`
- You must download the original Cityscapes dataset from: [https://www.cityscapes-dataset.com/downloads/](https://www.cityscapes-dataset.com/downloads/)
- For other sources, `image` contains the actual binary image data

### CNOCS Map
The `map` field stores the CNOCS Map from the paper in EXR format as binary data.

## Usage

### Loading the Dataset

```python
from datasets import load_dataset

dataset = load_dataset("FudanCVL/ObjectPose9D", streaming=True)

for i, item in enumerate(dataset["train"]):
    if item["source"] == "cityscapes":
        # For cityscapes: image field is a path string
        image_path = item["image"].decode("utf-8")
    else:
        with open(f"{i}_{item['source']}.jpg", "wb") as f:
            f.write(item["image"])
    
    with open(f"{i}_{item['source']}.exr", "wb") as f:
        f.write(item["map"])

```

### Visualizing CNOCS Maps
```python
import numpy as np
from openexr_numpy import imread
from PIL import Image

# Read EXR map
cnocs_map = imread("map.exr")
cnocs_map_uint8 = (cnocs_map * 255).clip(0, 255).astype(np.uint8)
img = Image.fromarray(cnocs_map_uint8)
img.save("map.png")
```