asmirnou / watsor

Object detection for video surveillance
MIT License
252 stars 32 forks source link

Support for Raspberry Pi 4 #3

Closed asmirnou closed 4 years ago

asmirnou commented 4 years ago

This PR adds support for Raspberry Pi 4. Watsor can be installed on the device either as Python module or using the Docker image, which is compatible with 64-bit OS only at the moment.

To get decent performance on a device such as Raspberry Pi one needs the Coral USB accelerator. Without the latter the detection in Raspberry is based on TensorFlow Lite, but most probably it won’t cope with more than 5 FPS of the lightest detection model.

The Docker image can be improved by rebuilding with NEON and VFPV3 options of OpenCV turned ON to enable native support of single and double-precision in Raspberry’s ARM Cortex-A72 CPU. It isn't know yet how much can be gained as far as OpenCV is not used for detection, but only to produce Motion JPEG and some video effects. The options can be enabled only when running the build on the Raspberry itself. I used cross build where these options are not available.

FFmpeg inside of Docker image doesn't support any hardware acceleration Raspberry can provide. MMAL and OpenMAX libraries are available only with Raspberry firmware. The image can probably be rebuilt on the Raspberry to take the effect.