Skip to content

Instantly share code, notes, and snippets.

View khanhlvg's full-sized avatar

Khanh khanhlvg

View GitHub Profile
@khanhlvg
khanhlvg / camera_benchmark.py
Last active July 14, 2021 05:25
Benchmark PiCamera vs. OpenCV
from picamera import PiCamera
from picamera.array import PiRGBArray
import time
import cv2
WINDOW_NAME = 'benchmark'
FRAME_COUNT = 100
FRAME_RATE = 30
camera = PiCamera(framerate = FRAME_RATE)
## Sep 2023 update: We've released official support for MediaPipe on Raspberry Pi.
## It provides many more features to what's available in TFLite Task Library. The guide
## below has been updated to use MediaPipe instead of TFLite Task Library.
## Check out this blog post to learn more:
## https://developers.googleblog.com/2023/08/mediapipe-for-raspberry-pi-and-ios.html
# Show your Raspberry Pi OS version.
cat /etc/os-release
# Update packages on your Raspberry Pi OS.