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(), )