chenhaonan143 commited on
Commit
a895585
·
verified ·
1 Parent(s): 1f278b9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +59 -3
README.md CHANGED
@@ -1,3 +1,59 @@
1
- ---
2
- license: c-uda
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: c-uda
3
+ ---
4
+ # ObjectPose9D Dataset
5
+
6
+ ## Data Structure
7
+
8
+ Each data sample contains 4 attributes:
9
+
10
+ - **`source`**: Source dataset name (e.g., "cityscapes")
11
+ - **`prompt`**: Text description or prompt
12
+ - **`image`**: Image data (stored as binary)
13
+ - **`map`**: CNOCS Map (stored as binary in EXR format)
14
+
15
+
16
+ ### Cityscapes Subset
17
+ Due to license restrictions, images from the **Cityscapes** source cannot be redistributed directly.
18
+
19
+ - For Cityscapes samples, the `image` field contains only the **relative path** within `leftImg8bit`
20
+ - You must download the original Cityscapes dataset from: [https://www.cityscapes-dataset.com/downloads/](https://www.cityscapes-dataset.com/downloads/)
21
+ - For other sources, `image` contains the actual binary image data
22
+
23
+ ### CNOCS Map
24
+ The `map` field stores the CNOCS Map from the paper in EXR format as binary data.
25
+
26
+ ## Usage
27
+
28
+ ### Loading the Dataset
29
+
30
+ ```python
31
+ from datasets import load_dataset
32
+
33
+ dataset = load_dataset("FudanCVL/ObjectPose9D", streaming=True)
34
+
35
+ for i, item in enumerate(dataset["train"]):
36
+ if item["source"] == "cityscapes":
37
+ # For cityscapes: image field is a path string
38
+ image_path = item["image"].decode("utf-8")
39
+ else:
40
+ with open(f"{i}_{item['source']}.jpg", "wb") as f:
41
+ f.write(item["image"])
42
+
43
+ with open(f"{i}_{item['source']}.exr", "wb") as f:
44
+ f.write(item["map"])
45
+
46
+ ```
47
+
48
+ ### Visualizing CNOCS Maps
49
+ ```python
50
+ import numpy as np
51
+ from openexr_numpy import imread
52
+ from PIL import Image
53
+
54
+ # Read EXR map
55
+ cnocs_map = imread("map.exr")
56
+ cnocs_map_uint8 = (cnocs_map * 255).clip(0, 255).astype(np.uint8)
57
+ img = Image.fromarray(cnocs_map_uint8)
58
+ img.save("map.png")
59
+ ```