Skip to main content

Wrapper over opencv for video processing and API development

Project description

opencv_stream

Under construction

Developed by Olivier

Examples of How To Use

Creating A Stream

from opencv_stream import VideoStreamer, ModelOutput, Model
import time
import numpy as np
import cv2

class TempModelOutput(ModelOutput):

    def to_dict(self) -> dict:
        return {"success": True}
    
    def draw(self, image: np.ndarray) -> None:
        w, h, _ = image.shape
        cv2.putText(image, "Hello from opencv_stream", (w//2, h//2), fontFace=1, fontScale=1, color=(255, 0, 0))

class TempModel(Model):

    def predict(self, image: np.ndarray) -> ModelOutput:
        return TempModelOutput()

stream = VideoStreamer.from_webcam()


stream.start_with_model(TempModel(), )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencv_stream-0.1.1.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

opencv_stream-0.1.1-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page