registry
birdnet_stm32.models.registry
¶
Frontend registry: register and discover audio frontend configurations.
Each registered frontend declares its name, whether it's a precomputed (host-side) or in-model mode, and its N6 NPU compatibility constraints.
FrontendInfo
dataclass
¶
Metadata for a registered audio frontend.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Canonical frontend name. |
mode |
str
|
Internal AudioFrontendLayer mode ('precomputed', 'hybrid', 'raw'). |
precomputed |
bool
|
Whether spectrogram is computed on the host (True) or in-model (False). |
n6_compatible |
bool
|
Whether this frontend is compatible with STM32N6 NPU deployment. |
description |
str
|
Short human-readable description. |
Source code in birdnet_stm32/models/registry.py
register_frontend(info)
¶
Register a frontend configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
info
|
FrontendInfo
|
FrontendInfo describing the frontend. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a frontend with the same name is already registered. |
Source code in birdnet_stm32/models/registry.py
get_frontend_info(name)
¶
Look up a registered frontend by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Canonical frontend name. |
required |
Returns:
| Type | Description |
|---|---|
FrontendInfo
|
FrontendInfo for the frontend. |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the frontend is not registered. |
Source code in birdnet_stm32/models/registry.py
list_frontends()
¶
is_precomputed(name)
¶
Check whether a frontend uses host-side precomputed spectrograms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Canonical frontend name. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the frontend computes spectrograms on the host. |
Source code in birdnet_stm32/models/registry.py
is_n6_compatible(name)
¶
Check whether a frontend is compatible with the STM32N6 NPU.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Canonical frontend name. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the frontend can be deployed on the N6 NPU. |