forked from hpatches/hpatches-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconst.py
115 lines (99 loc) · 3.1 KB
/
const.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
##############
# ALGORITHMS #
##############
SIFT = 'sift'
ASIFT = 'asift'
SURF = 'surf'
BRIEF = 'brief'
BRISK = 'brisk'
ORB = 'orb'
FAST = 'fast'
HARRIS = 'harris'
SHI_TOMASI = 'shi_tomasi'
KAZE = 'kaze'
AKAZE = 'akaze'
MSER = 'mser'
AGAST = 'agast'
GFTT = 'gftt'
CENSUREE = 'censure'
ROOT_SIFT = 'root_sift'
SUSAN = 'susan'
# descriptor-only
FREAK = 'freak'
# deep
LFNET = 'lfnet'
SUPERPOINT = 'superpoint'
D2NET = 'd2net'
# Det+desc template
ALGO_TEMPLATE = '{}_{}'
####################
# EVALUATION TASKS #
####################
VERIFICATION = 'Verification'
MATCHING = 'Matching'
RETRIEVAL = 'Retrieval'
TASKS = [VERIFICATION, MATCHING, RETRIEVAL]
###########################
# ALGORITHM DICTIONARIES #
##########################
import cv2
all_detectors = {'sift':cv2.xfeatures2d.SIFT_create,
'surf':cv2.xfeatures2d.SURF_create,
'orb':cv2.ORB_create,
'fast':cv2.FastFeatureDetector_create,
'brisk':cv2.BRISK_create,
#'harris':HarrisMataHarris,
#'shi_tomasi':ShiTomasi,
'kaze':cv2.KAZE_create,
'akaze':cv2.AKAZE_create,
'mser':cv2.MSER_create,
'agast':cv2.AgastFeatureDetector_create,
'gftt':cv2.GFTTDetector_create,
#'censure':CensureClass,
#'asift':ASIFTClass
#'susan':SusanClass
}
all_descriptors = {'sift':cv2.xfeatures2d.SIFT_create,
'surf':cv2.xfeatures2d.SURF_create,
'orb':cv2.ORB_create,
'brisk':cv2.BRISK_create,
'freak':cv2.xfeatures2d.FREAK_create,
'kaze':cv2.KAZE_create,
'akaze':cv2.AKAZE_create,
'brief':cv2.xfeatures2d.BriefDescriptorExtractor_create,
#'root_sift':RootSIFT
}
descriptor_distance = {'sift':cv2.NORM_L2,
'surf':cv2.NORM_L2,
'orb':cv2.NORM_HAMMING2,
'brisk':cv2.NORM_HAMMING2,
'freak':cv2.NORM_HAMMING2,
'kaze':cv2.NORM_L2,
'akaze':cv2.NORM_HAMMING2,
'brief':cv2.NORM_HAMMING2,
'root_sift':cv2.NORM_L2,
'lfnet':cv2.NORM_L2,
'superpoint':cv2.NORM_L2,
'd2net':cv2.NORM_L2}
all_at_once_dict = {'sift':False,
'surf':False,
'orb':False,
'fast':False,
'brisk':False,
'harris':False,
'shi_tomasi':False,
'kaze':False,
'akaze':False,
'mser':False,
'agast':False,
'gftt':False,
'censure':False,
'asift':True,
#'susan':False
# deep
'lfnet':True,
'superpoint':True}
#########
# PATHS #
#########
RESULTS_DIR = 'results/'