anhquancao commited on
Commit
281efb7
1 Parent(s): c02bef6
Files changed (4) hide show
  1. config.json +4 -0
  2. config.py +26 -0
  3. monoscene_model.py +21 -0
  4. pytorch_model.bin +1 -1
config.json CHANGED
@@ -2,6 +2,10 @@
2
  "architectures": [
3
  "MonoSceneModel"
4
  ],
 
 
 
 
5
  "avg_down": false,
6
  "base_width": 64,
7
  "block_type": "bottleneck",
 
2
  "architectures": [
3
  "MonoSceneModel"
4
  ],
5
+ "auto_map": {
6
+ "AutoConfig": "config.MonoSceneConfig",
7
+ "AutoModel": "monoscene_model.MonoSceneModel"
8
+ },
9
  "avg_down": false,
10
  "base_width": 64,
11
  "block_type": "bottleneck",
config.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import PretrainedConfig
2
+ from typing import List
3
+
4
+
5
+ class MonoSceneConfig(PretrainedConfig):
6
+
7
+ def __init__(
8
+ self,
9
+ dataset="kitti",
10
+ n_classes=20,
11
+ feature=64,
12
+ project_scale=2,
13
+ full_scene_size=(256, 256, 32),
14
+ **kwargs,
15
+ ):
16
+ self.dataset = dataset
17
+ self.n_classes = n_classes
18
+ self.feature = feature
19
+ self.project_scale = project_scale
20
+ self.full_scene_size = full_scene_size
21
+ super().__init__(**kwargs)
22
+
23
+
24
+
25
+
26
+
monoscene_model.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import PreTrainedModel
2
+ from .config import MonoSceneConfig
3
+ from monoscene.monoscene import MonoScene
4
+
5
+
6
+ class MonoSceneModel(PreTrainedModel):
7
+ config_class = MonoSceneConfig
8
+
9
+ def __init__(self, config):
10
+ super().__init__(config)
11
+ self.model = MonoScene(
12
+ dataset=config.dataset,
13
+ n_classes=config.n_classes,
14
+ feature=config.feature,
15
+ project_scale=config.project_scale,
16
+ full_scene_size=config.full_scene_size
17
+ )
18
+
19
+
20
+ def forward(self, tensor):
21
+ return self.model.forward(tensor)
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:11d1a04f68fcd0a49028c907393eaeff7fb0d003ffd0b8d8dfdba520cd76b8c7
3
  size 600200087
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5bdc2fc2fb305da11cf851114e7e6784c99ae917fa5265f90e3ff3d47cc8b193
3
  size 600200087