mirror of
https://github.com/macaodha/batdetect2.git
synced 2026-01-11 09:29:33 +01:00
Add evaluation config with match strategy
This commit is contained in:
parent
65d13a32b7
commit
8aa2d0cd11
@ -1,9 +1,15 @@
|
|||||||
|
from batdetect2.evaluate.config import (
|
||||||
|
EvaluationConfig,
|
||||||
|
load_evaluation_config,
|
||||||
|
)
|
||||||
from batdetect2.evaluate.match import (
|
from batdetect2.evaluate.match import (
|
||||||
match_predictions_and_annotations,
|
match_predictions_and_annotations,
|
||||||
match_sound_events_and_raw_predictions,
|
match_sound_events_and_raw_predictions,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"match_sound_events_and_raw_predictions",
|
"EvaluationConfig",
|
||||||
|
"load_evaluation_config",
|
||||||
"match_predictions_and_annotations",
|
"match_predictions_and_annotations",
|
||||||
|
"match_sound_events_and_raw_predictions",
|
||||||
]
|
]
|
||||||
|
|||||||
25
src/batdetect2/evaluate/config.py
Normal file
25
src/batdetect2/evaluate/config.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
from typing import Optional
|
||||||
|
|
||||||
|
from pydantic import Field
|
||||||
|
from soundevent import data
|
||||||
|
|
||||||
|
from batdetect2.configs import BaseConfig, load_config
|
||||||
|
from batdetect2.evaluate.match import DEFAULT_MATCH_CONFIG, MatchConfig
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"EvaluationConfig",
|
||||||
|
"load_evaluation_config",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class EvaluationConfig(BaseConfig):
|
||||||
|
match: MatchConfig = Field(
|
||||||
|
default_factory=lambda: DEFAULT_MATCH_CONFIG.model_copy(),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def load_evaluation_config(
|
||||||
|
path: data.PathLike,
|
||||||
|
field: Optional[str] = None,
|
||||||
|
) -> EvaluationConfig:
|
||||||
|
return load_config(path, schema=EvaluationConfig, field=field)
|
||||||
Loading…
Reference in New Issue
Block a user