4. **Run the Script**:
- Save the Python script on your Raspberry Pi (e.g.,
face_detection.py
).
- Open a terminal and navigate to the directory containing the script.
- Run the script using the following command:
python3 face_detection.py
5. **View the Output**:
- The script will open the camera feed and display it in a window.
- It will detect faces in real-time and draw rectangles around them.
This is a basic example of face detection using OpenCV on a Raspberry Pi. You can further customize the script to suit your requirements, such as adding additional functionality or integrating it with IoT platforms for remote monitoring and control. Additionally, you can explore more advanced face detection techniques and algorithms for improved accuracy and performance.