Hyeonwoo Kim commited on
Commit
8af0785
·
verified ·
1 Parent(s): e695b26

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +22 -2
README.md CHANGED
@@ -8,7 +8,7 @@ viewer: false
8
 
9
  ComAsset is the dataset for paper "Beyond the Contact: Discovering Comprehensive Affordance for 3D Objects from Pre-trained 2D Diffusion Models".
10
 
11
- The dataset consists of total 93 object meshes, collected from [SketchFab](https://sketchfab.com/).
12
 
13
  All of the meshes are converted to `.obj` format with image texture files. We manually canonicalize the objects in terms of location, orientation and scale.
14
 
@@ -24,12 +24,32 @@ ComAsset
24
  │ │ └── model.mtl
25
  │ ├── axe
26
  │ ├── ...
27
- │ └── wine glass
28
  └── categories.json
29
  ```
30
 
31
  In `categories.json`, you can check the existing object categories, along with the original data URL and the license information.
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  # Citation
34
 
35
  To cite ComA, please use the following BibTeX entry:
 
8
 
9
  ComAsset is the dataset for paper "Beyond the Contact: Discovering Comprehensive Affordance for 3D Objects from Pre-trained 2D Diffusion Models".
10
 
11
+ The dataset consists of total 83 object meshes, collected from [SketchFab](https://sketchfab.com/).
12
 
13
  All of the meshes are converted to `.obj` format with image texture files. We manually canonicalize the objects in terms of location, orientation and scale.
14
 
 
24
  │ │ └── model.mtl
25
  │ ├── axe
26
  │ ├── ...
27
+ │ └── watering can
28
  └── categories.json
29
  ```
30
 
31
  In `categories.json`, you can check the existing object categories, along with the original data URL and the license information.
32
 
33
+ # Loading Dataset
34
+
35
+ ```python
36
+ from datasets import load_dataset, config
37
+ from huggingface_hub import snapshot_download
38
+ import trimesh
39
+
40
+ snapshot_dir = snapshot_download(repo_id="SShowbiz/ComAsset", repo_type="dataset")
41
+ comasset = load_dataset("SShowbiz/ComAsset", data_files={"metadata": "**/metadata.json"})
42
+
43
+ with open(os.path.join(snapshot_dir, "categories.json"), "r") as json_file: objects = json.load(json_file)
44
+ categories = [object_metadata["category"] for object_metadata in objects]
45
+
46
+ category, *_ = categories # first category
47
+ object_metadata, *_ = comasset['metadata'].filter(lambda example: example['category'] == category) # first object
48
+
49
+ obj_path = os.path.join(snapshot_dir, object_metadata["obj_file"])
50
+ mesh = trimesh.load(obj_path)
51
+ ```
52
+
53
  # Citation
54
 
55
  To cite ComA, please use the following BibTeX entry: