yuxin
commited on
Commit
·
5d7a143
1
Parent(s):
6dad4ed
add model
Browse files- config.json +1 -1
- config_segvol.py +0 -14
- model_segvol_single.py +14 -1
config.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
"SegVolModel"
|
4 |
],
|
5 |
"auto_map": {
|
6 |
-
"AutoConfig": "
|
7 |
"AutoModel": "model_segvol_single.SegVolModel"
|
8 |
},
|
9 |
"model_type": "segvol",
|
|
|
3 |
"SegVolModel"
|
4 |
],
|
5 |
"auto_map": {
|
6 |
+
"AutoConfig": "model_segvol_single.SegVolConfig",
|
7 |
"AutoModel": "model_segvol_single.SegVolModel"
|
8 |
},
|
9 |
"model_type": "segvol",
|
config_segvol.py
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
from transformers import PretrainedConfig
|
2 |
-
|
3 |
-
class SegVolConfig(PretrainedConfig):
|
4 |
-
model_type = "segvol"
|
5 |
-
|
6 |
-
def __init__(
|
7 |
-
self,
|
8 |
-
test_mode=True,
|
9 |
-
**kwargs,
|
10 |
-
):
|
11 |
-
self.spatial_size = [32, 256, 256]
|
12 |
-
self.patch_size = [4, 16, 16]
|
13 |
-
self.test_mode = test_mode
|
14 |
-
super().__init__(**kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model_segvol_single.py
CHANGED
@@ -1,8 +1,21 @@
|
|
1 |
-
from transformers import PreTrainedModel
|
2 |
from config_segvol import SegVolConfig
|
3 |
import numpy as np
|
4 |
import monai.transforms as transforms
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
class SegVolModel(PreTrainedModel):
|
7 |
config_class = SegVolConfig
|
8 |
|
|
|
1 |
+
from transformers import PreTrainedModel, PretrainedConfig
|
2 |
from config_segvol import SegVolConfig
|
3 |
import numpy as np
|
4 |
import monai.transforms as transforms
|
5 |
|
6 |
+
class SegVolConfig(PretrainedConfig):
|
7 |
+
model_type = "segvol"
|
8 |
+
|
9 |
+
def __init__(
|
10 |
+
self,
|
11 |
+
test_mode=True,
|
12 |
+
**kwargs,
|
13 |
+
):
|
14 |
+
self.spatial_size = [32, 256, 256]
|
15 |
+
self.patch_size = [4, 16, 16]
|
16 |
+
self.test_mode = test_mode
|
17 |
+
super().__init__(**kwargs)
|
18 |
+
|
19 |
class SegVolModel(PreTrainedModel):
|
20 |
config_class = SegVolConfig
|
21 |
|