-
Notifications
You must be signed in to change notification settings - Fork 2
/
parameters.py
55 lines (42 loc) · 1.84 KB
/
parameters.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
"""
Change the parameters of the program here.
"""
import cv2 as cv
# all images (query & db) are resized before calculating their des. Their original aspect ratio is maintained.
MAX_IMAGE_SIZE = 1080
# Branches of tree (K > 1)
K = 10
# Depth of tree (L > 6)
L = 6
# nb of leaf nodes = K**L
# Halves needed disk space during runtime. Requires recalculating all des at the end.
SAVE_DISK_SPACE_DURING_RUNNING = False
# How much RAM/memory is available for the program.
# In a Windows machine, you can increase the memory size by following the steps on:
# https://www.windowscentral.com/how-change-virtual-memory-size-windows-10
#
# If possible provide (at least) '2.1 x size of all des' as available memory.
# If not enough ram the first k-means will use only a portion of the data.
# It will also store checkpoints on disk and reload them when needed during the processing of every branch.
# Due to disk access this will be slower than using all data, but the end result will have almost the same accuracy.
# Minimum memory size = 2.1 * size all des / K
MAX_MEMORY_USAGE_GB = 60
# How many of the first results of the initial scoring should be tested with geometric verification?
NB_OF_IMAGES_CONSIDERED = 5
"""DEBUG PARAMETERS"""
# During offline fase, resize and grayscale all db images?
# Recommended: True
RESIZE_IMAGES = False
# Store all kp & des of all db images in calc/? Speeds up online fase but requires lots of disk space.
# Only applicable if SAVE_DISK_SPACE_DURING_RUNNING = True
# Recommended: True
PRE_CALC_DES = True
# Criteria of kmeans algorithm
# opencv docs: https://docs.opencv.org/4.5.2/d1/d5c/tutorial_py_kmeans_opencv.html
# Recommended:
# (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 5, 0.5)
# 5
CRITERIA = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 5, 0.5)
ATTEMPTS_KMEANS = 5
ATTEMPTS_TREE_LEVEL = 10
ATTEMPTS_TREE_BRANCH = 25