# GStreamer Greenscreen¶

This samples uses the Xnor Python bindings with GStreamer to display video from your webcam but with the background replaced with another image. It uses a segmentation model to determine which parts of the image are foreground and which parts are background, and then processes only the background pixels. To run this sample, you must have GStreamer installed and a webcam available on your device.

Language

Python

Location

xnor-sdk-linux-x86_64/samples/python/gstreamer_live_greenscreen.py

Dependencies

pycairo, pygobject, GStreamer (via system package manager), an installed Xnor segmentation model.

Compatible Xnor Models

All segmentation models

Example Usage

python3 gstreamer_live_greenscreen.py