DynAIkonTrap.filtering.animal#
This module provides a generic interface to an animal detector. The system is fairly agnostic of the specific animal detection mechanism beings used, as the input to the AnimalFilter
is a JPEG image and the output a confidence in the image containing an animal.
A WCS-trained Tiny YOLOv4 model is used in this implementation, but any other architecture could be substituted in its place easily. Such a substitution would not require any changes to the module interface.
Classes
|
Animal filter stage to indicate if a frame contains an animal |
- class AnimalFilter(settings: AnimalFilterSettings)#
Animal filter stage to indicate if a frame contains an animal
- Parameters
settings (AnimalFilterSettings) – Settings for the filter
- run(image: bytes) bool #
The same as
run_raw()
, but with a threshold applied. This function outputs a boolean to indicate if the confidence is at least as large as the threshold- Parameters
image (bytes) – The image frame to be analysed in JPEG format
- Returns
True if the confidence in animal presence is at least the threshold, otherwise False
- Return type
bool
- run_raw(image: bytes) float #
Run the animal filter on the image to give a confidence that the image frame contains an animal
- Parameters
image (bytes) – The image frame to be analysed in JPEG format
- Returns
Confidence in the output containing an animal as a decimal fraction
- Return type
float