mirror of
https://github.com/macaodha/batdetect2.git
synced 2025-06-29 14:41:58 +02:00
Fixed code to support Python3.9 syntax
This commit is contained in:
parent
230b6167bc
commit
54ca555587
@ -250,7 +250,7 @@ def process_file(
|
||||
model: DetectionModel = MODEL,
|
||||
config: Optional[ProcessingConfiguration] = None,
|
||||
device: torch.device = DEVICE,
|
||||
file_id: str | None = None
|
||||
file_id: Optional[str] = None
|
||||
) -> du.RunResults:
|
||||
"""Process audio file with model.
|
||||
|
||||
@ -286,7 +286,7 @@ def process_url(
|
||||
model: DetectionModel = MODEL,
|
||||
config: Optional[ProcessingConfiguration] = None,
|
||||
device: torch.device = DEVICE,
|
||||
file_id: str | None = None
|
||||
file_id: Optional[str] = None
|
||||
) -> du.RunResults:
|
||||
"""Process audio file with model.
|
||||
|
||||
|
@ -185,7 +185,7 @@ def load_audio_data(
|
||||
target_samp_rate: int,
|
||||
scale: bool = False,
|
||||
max_duration: Optional[float] = None,
|
||||
) -> Tuple[int, np.ndarray, int | float]:
|
||||
) -> Tuple[int, np.ndarray, Union[float, int]]:
|
||||
"""Load an audio file and resample it to the target sampling rate.
|
||||
|
||||
The audio is also scaled to [-1, 1] and clipped to the maximum duration.
|
||||
|
@ -742,7 +742,7 @@ def process_file(
|
||||
model: DetectionModel,
|
||||
config: ProcessingConfiguration,
|
||||
device: torch.device,
|
||||
file_id: str | None = None
|
||||
file_id: Optional[str] = None
|
||||
) -> Union[RunResults, Any]:
|
||||
"""Process a single audio file with detection model.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user