mirror of
https://github.com/macaodha/batdetect2.git
synced 2026-01-10 17:19:34 +01:00
Go back to serial matching
This commit is contained in:
parent
75e555ff00
commit
fdbb9c2b43
@ -1,6 +1,3 @@
|
|||||||
import os
|
|
||||||
from functools import partial
|
|
||||||
from multiprocessing import Pool
|
|
||||||
from typing import List, Optional, Tuple
|
from typing import List, Optional, Tuple
|
||||||
|
|
||||||
from lightning import LightningModule, Trainer
|
from lightning import LightningModule, Trainer
|
||||||
@ -170,19 +167,14 @@ def _match_all_collected_examples(
|
|||||||
targets: TargetProtocol,
|
targets: TargetProtocol,
|
||||||
config: Optional[MatchConfig] = None,
|
config: Optional[MatchConfig] = None,
|
||||||
) -> List[MatchEvaluation]:
|
) -> List[MatchEvaluation]:
|
||||||
logger.info("Matching all annotations and predictions")
|
logger.info("Matching all annotations and predictions...")
|
||||||
|
return [
|
||||||
with Pool() as p:
|
match
|
||||||
matches = p.starmap(
|
for clip_annotation, raw_predictions in pre_matches
|
||||||
partial(
|
for match in match_sound_events_and_raw_predictions(
|
||||||
match_sound_events_and_raw_predictions,
|
clip_annotation, raw_predictions, targets=targets, config=config
|
||||||
targets=targets,
|
|
||||||
config=config,
|
|
||||||
),
|
|
||||||
pre_matches,
|
|
||||||
)
|
)
|
||||||
|
]
|
||||||
return [match for clip_matches in matches for match in clip_matches]
|
|
||||||
|
|
||||||
|
|
||||||
def _is_in_subclip(
|
def _is_in_subclip(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user