Upload DiskForKeypointDetection
Browse files- config.json +3 -0
- configuration_disk.py +30 -0
config.json
CHANGED
|
@@ -2,6 +2,9 @@
|
|
| 2 |
"architectures": [
|
| 3 |
"DiskForKeypointDetection"
|
| 4 |
],
|
|
|
|
|
|
|
|
|
|
| 5 |
"descriptor_decoder_dim": 128,
|
| 6 |
"detection_threshold": 0.0,
|
| 7 |
"max_num_keypoints": null,
|
|
|
|
| 2 |
"architectures": [
|
| 3 |
"DiskForKeypointDetection"
|
| 4 |
],
|
| 5 |
+
"auto_map": {
|
| 6 |
+
"AutoConfig": "configuration_disk.DiskConfig"
|
| 7 |
+
},
|
| 8 |
"descriptor_decoder_dim": 128,
|
| 9 |
"detection_threshold": 0.0,
|
| 10 |
"max_num_keypoints": null,
|
configuration_disk.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Optional
|
| 2 |
+
|
| 3 |
+
from transformers import PretrainedConfig
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class DiskConfig(PretrainedConfig):
|
| 7 |
+
model_type = "disk"
|
| 8 |
+
|
| 9 |
+
def __init__(
|
| 10 |
+
self,
|
| 11 |
+
weights: str = "depth",
|
| 12 |
+
max_num_keypoints: Optional[int] = None,
|
| 13 |
+
descriptor_decoder_dim: int = 128,
|
| 14 |
+
nms_window_size: int = 5,
|
| 15 |
+
detection_threshold: float = 0.0,
|
| 16 |
+
pad_if_not_divisible: bool = True,
|
| 17 |
+
**kwargs,
|
| 18 |
+
):
|
| 19 |
+
super().__init__(**kwargs)
|
| 20 |
+
self.weights = weights
|
| 21 |
+
self.max_num_keypoints = max_num_keypoints
|
| 22 |
+
self.descriptor_decoder_dim = descriptor_decoder_dim
|
| 23 |
+
self.nms_window_size = nms_window_size
|
| 24 |
+
self.detection_threshold = detection_threshold
|
| 25 |
+
self.pad_if_not_divisible = pad_if_not_divisible
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
if __name__ == "__main__":
|
| 29 |
+
config = DiskConfig()
|
| 30 |
+
config.save_pretrained("stevenbucaille/disk", push_to_hub=True)
|