Skip to main content

YOLO segmentation utilities for video streams

Project description

mini_vision

Simple Python library for object segmentation in video streams using YOLO models.

The goal of this library is to provide a modular pipeline to:

  • consume video streams
  • perform object segmentation
  • render contours or masks

The library follows data-oriented design and low coupling principles, allowing easy replacement of computer vision models.


Installation

pip install mini-vision

Usage

Example showing how to use vision-seg to consume a video stream, run YOLO segmentation, and render object contours.

Import the library

from vision_seg import (
    YoloSegmenter,
    SegmentationRenderer,
    WSFrameClient
)

Components:

Component Description
YoloSegmenter Runs object segmentation using a YOLO segmentation model
SegmentationRenderer Draws segmentation contours on the frame
WSFrameClient Connects to a WebSocket video stream and yields frames

YoloSegmenter

Runs object segmentation using a YOLO segmentation model.

segmenter = YoloSegmenter("yolov8n-seg.pt")
detections = segmenter.segment(frame)

SegmentationRenderer

Responsible for rendering segmentation contours on frames.

renderer = SegmentationRenderer()
frame = renderer.draw_contours(frame, detections)

WSFrameClient

Connects to a WebSocket video stream and yields frames.

client = WSFrameClient("ws://127.0.0.1:8000/ws/frames")
async for frame in client.frames():

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

mini_vision-0.2.0.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mini_vision-0.2.0-py3-none-any.whl (1.7 kB view details)

Uploaded Python 3

File details

Details for the file mini_vision-0.2.0.tar.gz.

File metadata

  • Download URL: mini_vision-0.2.0.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for mini_vision-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9642e6e0735800ef066c2205af9787264fef928485e64e7a8847fe0f5a8c09fe
MD5 bdbdb82a5f63bb240c526eccc99d5c6f
BLAKE2b-256 9603f40baff55db77c74676f6de15e30fc2683a7594524aa6d8bbcf91e93e5f2

See more details on using hashes here.

File details

Details for the file mini_vision-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mini_vision-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 1.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for mini_vision-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3838974b291be5aa6aa003d9d82bb1bc9d8685087a568532418ff76ce041f16
MD5 8777768f1b78c1b29306dc3f7ad6a27f
BLAKE2b-256 d676cb5f0e5500836193cc88108727c66e2f0ae617553560817f20893c075957

See more details on using hashes here.

Supported by

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