AI-powered face-tracking camera framing for Python projects
StageCam is built for:
- 💻 Virtual Meetings – Auto-center your face, even when you move
- 🤖 Robotics / Embedded Vision – Add smart framing to robots or IoT cameras
- 🎬 Livestreams & Screen Recording – Look polished without manual setup
- 🧠 Any Python App – Easily integrate real-time face framing
- 🧠 MediaPipe-based Face Detection – Lightweight yet accurate
- 🎯 Smooth Pan & Zoom – Fluid, jitter-free movement
- 👥 Multi-face Framing – Dynamically adapts to multiple faces
- 🪞 Lateral Inversion – Natural webcam-like mirroring
- 🧩 Modular API – Use as a script or drop into your own project
pip install stagecamOr install directly from GitHub:
pip install git+https://github.com/K-Rutuparna1087/StageCam.gitDependencies (auto-installed):
opencv-python, mediapipe, numpy
import stagecam
stagecam.show()With optional arguments:
stagecam.show(
camera_index=0,
detection_confidence=0.6,
zoom_factor=2.5
)import cv2
from stagecam import FaceTracker, FrameTransformer
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
frame_height, frame_width = frame.shape[:2]
tracker = FaceTracker()
transformer = FrameTransformer(frame_width, frame_height)
while True:
ret, frame = cap.read()
if not ret:
break
flipped = cv2.flip(frame, 1)
bboxes = tracker.detect(flipped)
staged = transformer.transform(flipped.copy(), bboxes)
combined = cv2.hconcat([flipped, staged])
cv2.imshow("Original (left) | StageCam (right)", combined)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()Use the core modules independently:
from stagecam import FaceTracker, FrameTransformer- 📷 Virtual webcam output (v4l2loopback / OBS)
- 🖱️ GUI controls for zoom/pan toggle
- 📦 Stable PyPI support and versioning
- 📱 Mobile device support
K Rutuparna Mechatronics Engineer | Robotics + AI Vision Enthusiast 🌐 GitHub – K-Rutuparna1087
Licensed under the MIT License – Free to use, modify, and distribute.