GhostCam is a minimalist, headless background removal service designed for developers, streamers, and online instructors. It generates a transparent, click-through, and real-time controllable "ghostly portrait" on your desktop, allowing your portrait to blend perfectly with the background while you demonstrate code or explain slides.
- AI Edge Optimization: Based on the latest MediaPipe Tasks API, with built-in Gaussian feathering and edge tightening logic for smooth and natural portrait edges.
- Ghost Mode (Opacity): Supports 0% - 100% global opacity adjustment, giving the portrait a "ghostly" transparency.
- Full Transparency & Click-Through: Supports "Lock" mode, where mouse clicks pass completely through the portrait window, allowing normal coding or operations.
- High-Performance Preview: Rendered using native Win32 APIs with extremely low latency and minimal CPU/GPU usage.
- Multi-Shape Windows: Supports switching between Circle and Rectangle shapes.
GhostCam requires a virtual camera driver to output to OBS or Teams:
- Navigate to the project directory:
drivers/UnityCapture/Install/. - Right-click
Install.bat-> Run as Administrator.
pip install -r requirements.txt
pip install .GhostCam operates in a "Service + Command" dual-window mode.
Open a terminal and start the AI processing engine:
ghostcam runThe AI model (~5MB) will be downloaded automatically on the first run. A preview window will appear in the bottom-right corner after startup.
Keep Window A open, open another new terminal window, and use the following commands to adjust effects in real-time:
- Ghost Opacity:
ghostcam opacity 80%(Makes the portrait transparent, 70%-90% recommended) - Shape Switch:
ghostcam circle(Circle) orghostcam rect(Rectangle) - HUD Border:
ghostcam border #00FF00(Add green border) orghostcam border off
- Window Scaling:
ghostcam scale 1.5(Scale 1.5x) - Lock/Click-Through:
ghostcam lock(Window becomes fixed and mouse clicks pass through) - Unlock:
ghostcam unlock(Restores draggable state)
- Hide/Show:
ghostcam off/ghostcam on - Stop Service:
ghostcam stop
-
Recommended Streaming Setup:
- Run
ghostcam circleto switch to a circular shape. - Run
ghostcam opacity 85%to enable Ghost Mode. - Move to a suitable screen position, then run
ghostcam lock. - Add a "Video Capture Device" in OBS and select Unity Video Capture.
- Run
-
Fixing Edge Artifacts:
- If edges appear too thick, ensure there is adequate lighting. GhostCam has built-in feathering logic; it works best when used with
opacity.
- If edges appear too thick, ensure there is adequate lighting. GhostCam has built-in feathering logic; it works best when used with
-
Changing Cameras:
- If you have multiple cameras, run
ghostcam listto see indices, then modifydevice_indexinmain.py.
- If you have multiple cameras, run
MIT License.