Because the software interacts with other PiSentry projects (the backend API and the media server), you might want to check their URLs in urls.py
and adapt them if necessary.
The file config.json
contains the default configuration of the camera.
It is important to set your own values for the existing settings for the project to work properly.
- If you are using a virtual environment, activate it by executing
source /<path_to_your_venv>/bin/activate
. - If not already done, install the necessary dependencies with
pip install -r requirements.txt
.
Picamera2 is not listed in therequirements.txt
file as it is managed viaapt
and should already be installed as it comes pre-installed in all Raspberry Pi OS images as of mid-September 2022.
This project uses Picamera2v0.3.12
. If you need to update your package, you can do it withsudo apt install -y python3-picamera2
.
If you encounter a system without Picamera2 pre-installed, please see the installation process in the Picamera2 manual. - Then, go to the root of the project and run the main file:
python main.py
and voilà !
The software consists of two parts:
The main libraries used are :
- OpenCV - for object detection, image processing, etc.
- NumPy - for image processing
- Requests - for fetching/sending data from/to the backend API
- Uvicorn - for serving the API
This project is licensed under the MIT License