-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFeatureMatching.py
More file actions
51 lines (43 loc) · 1.4 KB
/
FeatureMatching.py
File metadata and controls
51 lines (43 loc) · 1.4 KB
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
__version__ = "2.0"
import os
import shutil
from sys import platform
from meshroom.core import desc
from . import COLMAP
class ColmapFeatureMatching(desc.CommandLineNode):
commandLine = COLMAP+' exhaustive_matcher {allParams}'
category = 'Colmap'
documentation = ''''''
inputs = [
desc.File(
name='input_database_path',
label='InputDatabase',
description='Input database path.',
value='',
group='',
),
desc.BoolParam(
name="use_gpu",
label = "Use GPU",
description='''Will use GPU for feature extraction.''',
value=False,
group='',
)
]
outputs = [
desc.File(
name='database_path',
label='OutputDatabasePath',
description='Output database path.',
value=os.path.join('{nodeCacheFolder}', 'colmap_database_matches.db'),
),
]
def buildCommandLine(self, chunk):
command_line = desc.CommandLineNode.buildCommandLine(self, chunk)#as default
#add the extra params
if not chunk.node.use_gpu.value:
command_line+=" --SiftMatching.use_gpu 0"
return command_line
def processChunk(self, chunk):
shutil.copy2(chunk.node.input_database_path.value, chunk.node.database_path.value)
desc.CommandLineNode.processChunk(self, chunk)