tessl install tessl/pypi-rembg@2.0.0Remove image background using advanced AI models including U-Net, BiRefNet, and SAM with support for multiple input formats and GPU acceleration
Agent Success
Agent success rate when using this tile
84%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.94x
Baseline
Agent success rate without this tile
89%
A Python tool that processes video frames from a binary RGB24 stream, removes backgrounds from each frame, and outputs the processed frames to image files.
Process RGB24 pixel data from standard input, remove backgrounds, and save frames as image files.
@generates
import sys
from typing import BinaryIO
def process_video_stream(
width: int,
height: int,
input_stream: BinaryIO = sys.stdin.buffer,
output_dir: str = "output"
) -> int:
"""
Process RGB24 video frames from a binary stream.
Reads RGB24 pixel data from input_stream, removes backgrounds from each frame,
and saves processed frames as PNG images to output_dir.
Args:
width: Frame width in pixels
height: Frame height in pixels
input_stream: Binary stream to read RGB24 data from (default: stdin)
output_dir: Directory to save processed frames (default: "output")
Returns:
Number of frames processed
"""
passProvides background removal functionality for image processing.