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.1.tar.gz (2.6 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.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mini_vision-0.2.1.tar.gz
  • Upload date:
  • Size: 2.6 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.1.tar.gz
Algorithm Hash digest
SHA256 fa6287c72adc62203739b867048ace0c38f64fd776a569a027ca211c030b3b7f
MD5 fd4309e56b9d0f545588ae6942465e01
BLAKE2b-256 39edcd8b04621c815f1cf782f1d600382b2b925b855797a57d2c49ab24d87a56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mini_vision-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f81a14a4fb3e2e3883610e7d7f687077c0a191b748b1f393849420a80bd6fde8
MD5 adc1bf00f23093299565a3e963f61d7b
BLAKE2b-256 e9e3482e2676e08c5fca2e8a4b0e498c8e1ea41f37e1cf5d8c1182f6a8247283

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