Module 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
class AnimalFilter (settings: AnimalFilterSettings)
-
Animal filter stage to indicate if a frame contains an animal
Args
settings
:AnimalFilterSettings
- Settings for the filter
Methods
def run(self, 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 thresholdArgs
image
:bytes
- The image frame to be analysed in JPEG format
Returns
bool
True
if the confidence in animal presence is at least the threshold, otherwiseFalse
def run_raw(self, image: bytes) ‑> float
-
Run the animal filter on the image to give a confidence that the image frame contains an animal
Args
image
:bytes
- The image frame to be analysed in JPEG format
Returns
float
- Confidence in the output containing an animal as a decimal fraction