File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,8 @@ def main(conf: Dict,
241
241
size = np .array (data ['image' ].shape [- 2 :][::- 1 ])
242
242
scales = (original_size / size ).astype (np .float32 )
243
243
pred ['keypoints' ] = (pred ['keypoints' ] + .5 ) * scales [None ] - .5
244
+ # add keypoint uncertainties scaled to the original resolution
245
+ uncertainty = getattr (model , 'detection_noise' , 1 ) * scales .mean ()
244
246
245
247
if as_half :
246
248
for k in pred :
@@ -255,6 +257,8 @@ def main(conf: Dict,
255
257
grp = fd .create_group (name )
256
258
for k , v in pred .items ():
257
259
grp .create_dataset (k , data = v )
260
+ if 'keypoints' in pred :
261
+ grp ['keypoints' ].attrs ['uncertainty' ] = uncertainty
258
262
except OSError as error :
259
263
if 'No space left on device' in error .args [0 ]:
260
264
logger .error (
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class SIFT(BaseModel):
29
29
'max_keypoints' : - 1
30
30
}
31
31
required_inputs = ['image' ]
32
+ detection_noise = 1.0
32
33
33
34
def _init (self , conf ):
34
35
self .root = conf ['root' ]
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ class SuperPoint(BaseModel):
53
53
'fix_sampling' : False ,
54
54
}
55
55
required_inputs = ['image' ]
56
+ detection_noise = 2.0
56
57
57
58
def _init (self , conf ):
58
59
if conf ['fix_sampling' ]:
You can’t perform that action at this time.
0 commit comments