An example of object detection for mobile using Python. Specific example is with face detection.
Aims:
- Show that object detection for mobile is possible using Python
- Make the code adaptable to be able to implement any object detection model
The packages used:
- Kivy, to create the graphical interface
- Buildozer, to package to mobile
- Opencv, to load the neural network and manipulate the images
- Numpy, also to manipulate the images
- KivyMD, to make the graphics look good (files copied manually from the repo due to this error I encounted)
- XCamera, to get the camera feed (the default camera in Kivy doesn't work on Android for some reason)
- Ultra fast face detection model, used as an example to detect faces in real time
The main file is kivy_object_detector.py.
With the basic structure being setup so that you can load your model in the self.build
and add the prediction code to the self.process_frame
.
Todo:
- Dig into XCamera, to see the method used to capture the camera feed when the default Kivy camera doesn't work
- Stay up to date with Opencv Python4Android recipes, currently only 4.0.21 can be used on Android using Buildozer
- restructure files
- add images to this README