-
Notifications
You must be signed in to change notification settings - Fork 16
Migrate bitbots_vision to use generate_parameter_library with optimized parameter passing #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 5 commits
f92eedb
bd454be
d930b11
8395c2e
06cce1a
0a56fc6
538a401
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,14 +72,14 @@ def is_team_color_detection_supported(cls) -> bool: | |
return cls._model_config.team_colors_are_provided() | ||
|
||
@classmethod | ||
def configure(cls, config: dict) -> None: | ||
def configure(cls, config) -> None: | ||
if not cls._package_directory_set: | ||
logger.error("Package directory not set!") | ||
|
||
framework = config["yoeo_framework"] | ||
framework = config.yoeo_framework | ||
cls._verify_framework_parameter(framework) | ||
|
||
model_path = cls._get_full_model_path(config["yoeo_model_path"]) | ||
model_path = cls._get_full_model_path(config.yoeo_model_path) | ||
cls._verify_required_neural_network_files_exist(framework, model_path) | ||
|
||
cls._configure_yoeo_instance(config, framework, model_path) | ||
|
@@ -107,7 +107,7 @@ def _model_files_exist(cls, framework: str, model_path: str) -> bool: | |
return cls._HANDLERS_BY_NAME[framework].model_files_exist(model_path) | ||
|
||
@classmethod | ||
def _configure_yoeo_instance(cls, config: dict, framework: str, model_path: str) -> None: | ||
def _configure_yoeo_instance(cls, config, framework: str, model_path: str) -> None: | ||
if cls._new_yoeo_handler_is_needed(framework, model_path): | ||
cls._load_model_config(model_path) | ||
cls._instantiate_new_yoeo_handler(config, framework, model_path) | ||
|
@@ -124,7 +124,7 @@ def _load_model_config(cls, model_path: str) -> None: | |
cls._model_config = ModelConfigLoader.load_from(model_path) | ||
|
||
@classmethod | ||
def _instantiate_new_yoeo_handler(cls, config: dict, framework: str, model_path: str) -> None: | ||
def _instantiate_new_yoeo_handler(cls, config, framework: str, model_path: str) -> None: | ||
cls._yoeo_instance = cls._HANDLERS_BY_NAME[framework]( | ||
config, | ||
model_path, | ||
|
@@ -135,5 +135,15 @@ def _instantiate_new_yoeo_handler(cls, config: dict, framework: str, model_path: | |
logger.info(f"Using {cls._yoeo_instance.__class__.__name__}") | ||
|
||
@classmethod | ||
def _yoeo_parameters_have_changed(cls, new_config: dict) -> bool: | ||
return ros_utils.config_param_change(cls._config, new_config, r"yoeo_") | ||
def _yoeo_parameters_have_changed(cls, new_config) -> bool: | ||
if cls._config is None: | ||
return True | ||
|
||
# Compare YOEO-related parameters using direct attribute access | ||
return ( | ||
|
||
cls._config.yoeo_framework != new_config.yoeo_framework or | ||
cls._config.yoeo_model_path != new_config.yoeo_model_path or | ||
cls._config.yoeo_nms_threshold != new_config.yoeo_nms_threshold or | ||
cls._config.yoeo_conf_threshold != new_config.yoeo_conf_threshold or | ||
cls._config.caching != new_config.caching | ||
) |
Uh oh!
There was an error while loading. Please reload this page.