Configuration
DIM as library
DIM can also be utilized as a library instead of being executed through the Command Line Interface (CLI). For an illustrative example also setting custom configurations, please see notebooks/sfm_pipeline.ipynb
.
CLI
When utilizing the CLI, specific configuration parameters linked to feature extraction and matching can be specified using the option --config /path/to/yaml/configuration/file
. Examples of YAML configuration files can be found in the config
folder.
For example, in the config/sift.yaml
file, under the general section, parameters such as tile size and others related to geometric verification can be adjusted. Under the extractor and matcher sections, there are options specific to the SIFT local feature.
general:
tile_size: (2400, 2000)
geom_verification: pydegensac
min_inliers_per_pair: 10
min_inlier_ratio_per_pair: 0.25
extractor:
name: "sift"
n_features: 8000
nOctaveLayers: 3
contrastThreshold: 0.04
edgeThreshold: 10
sigma: 1.6
matcher:
name: "kornia_matcher"
match_mode: "smnn"
th: 0.85
The Config Class
Config
Configuration class for deep image matching.
This class represents the configuration settings for deep image matching. It provides methods to parse user input, retrieve configuration options, update configuration from a YAML file, print the configuration settings, and save the configuration to a file.
Attributes: |
|
---|
METHOD | DESCRIPTION |
---|---|
general |
Get the general configuration options. |
extractor |
Get the extractor configuration options. |
matcher |
Get the matcher configuration options. |
__init__ |
Initialize the Config object. |
as_dict |
Get the configuration dictionary. |
get_config |
Get a specific configuration by name. |
get_config_names |
Get a list of available configuration names. |
get_matching_strategy_names |
Get a list of available matching strategy names. |
get_extractor_names |
Get a list of available extractor names. |
get_matcher_names |
Get a list of available matcher names. |
get_retrieval_names |
Get a list of available retrieval names. |
parse_user_config |
Parse the user configuration and perform checks on the input arguments. |
update_from_yaml |
Update the configuration from a YAML file. |
print |
Print the configuration settings. |
save |
Save the configuration to a file. |
__init__(args)
Initialize the Config object.
Parameters: |
|
---|
as_dict()
Get the configuration dictionary.
Returns: |
|
---|
get_config(name)
staticmethod
Get a specific configuration by name.
Parameters: |
|
---|
Returns: |
|
---|
Raises: |
|
---|
parse_general_config(input_args)
staticmethod
Parses the user configuration and performs checks on the input arguments.
Parameters: |
|
---|
Returns: |
|
---|
print()
Print the configuration settings.
This method prints the general, extractor, and matcher configuration settings.
save(path=None)
Save configuration to file.
Parameters: |
|
---|
update_from_yaml(path)
Update the configuration from a YAML file.
Parameters: |
|
---|
Raises: |
|
---|