Upload configuration_sac.py with huggingface_hub
Browse files- configuration_sac.py +17 -0
configuration_sac.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Configuration for SAC Patch Segmenter model."""
|
| 2 |
+
|
| 3 |
+
from transformers import PretrainedConfig
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class SACPatchSegmenterConfig(PretrainedConfig):
|
| 7 |
+
"""Config for SAC U-Net patch segmenter that accepts PIL images directly.
|
| 8 |
+
|
| 9 |
+
Reference: Liu et al., CVPR 2022, "Segment and Complete"
|
| 10 |
+
"""
|
| 11 |
+
|
| 12 |
+
model_type = "sac-patch-segmenter"
|
| 13 |
+
|
| 14 |
+
def __init__(self, base_filter: int = 16, input_size: int = 416, **kwargs):
|
| 15 |
+
super().__init__(**kwargs)
|
| 16 |
+
self.base_filter = base_filter
|
| 17 |
+
self.input_size = input_size
|