Skip to main content

Computer vision post-processing library for visualizing and analyzing detection results from ML models

Project description

PixelFlow

PyPI version Python 3.9+ License: MIT

A computer vision post-processing library for visualizing and analyzing detection results from ML models. PixelFlow takes detection outputs from frameworks like YOLO, Detectron2, and others, then provides powerful tools for annotation, tracking, filtering, and analysis.

✨ Features

  • 🎨 Flexible Annotation Tools: Box, mask, keypoint, heatmap, blur, pixelate, and motion trail annotations
  • 🎥 Efficient Video Processing: Lazy frame loading generator for memory-efficient video handling
  • 🔍 Zone-based Filtering: Spatial region management for targeted analysis
  • 🔄 Multi-framework Support: Seamless integration with Detectron2, YOLO, Ultralytics, and more
  • High-performance Drawing: Optimized OpenCV-based rendering
  • 📊 Unified Data Structures: Standardized prediction and results formats across frameworks
  • 🎯 Object Tracking: Built-in tracking capabilities for video sequences

🚀 Quick Start

Installation

pip install pixelflow

Basic Usage

import cv2
import pixelflow as pf

# Load an image
image = cv2.imread("image.jpg")

# Create detection results (example with dummy data)
predictions = [
    pf.Prediction(
        bbox=[100, 100, 200, 200],
        confidence=0.95,
        class_name="person"
    )
]
results = pf.Results(predictions=predictions)

# Annotate the image
annotated = pf.annotate_boxes(image, results)

# Save the result
cv2.imwrite("annotated_image.jpg", annotated)

Video Processing

import pixelflow as pf

# Process video with lazy loading
for frame in pf.video_loader("input_video.mp4"):
    # Your processing logic here
    processed_frame = pf.annotate_boxes(frame, results)
    # Save or display the frame

Zone-based Filtering

import pixelflow as pf

# Define a zone
zone = pf.PolygonZone(polygon=[(0, 0), (100, 0), (100, 100), (0, 100)])

# Filter predictions within the zone
filtered_results = pf.filter_by_zone(results, zone)

📖 Documentation

  • API Reference: pixelflow.datamarkin.com
  • Examples: Check the /examples directory for more detailed usage examples
  • Contributing: See CONTRIBUTING.md for development guidelines

🔧 Supported Frameworks

PixelFlow provides seamless integration with popular ML frameworks:

  • Detectron2: Results.from_detectron2()
  • Ultralytics/YOLO: Results.from_ultralytics()
  • Custom Models: Easy adapter pattern for any framework

📋 Requirements

  • Python 3.9+
  • OpenCV (cv2)
  • NumPy
  • Shapely
  • SciPy

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

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

pixelflow-0.1.1.tar.gz (125.6 kB view details)

Uploaded Source

Built Distribution

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

pixelflow-0.1.1-py3-none-any.whl (147.4 kB view details)

Uploaded Python 3

File details

Details for the file pixelflow-0.1.1.tar.gz.

File metadata

  • Download URL: pixelflow-0.1.1.tar.gz
  • Upload date:
  • Size: 125.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pixelflow-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eed9acf2d3fbcef158c4f33b1ccb5bcc4a3e71b92778e08feb708d10ee0fa87f
MD5 732b2b3d2fcfcd47297a24be3cb702a4
BLAKE2b-256 c1f76e7fc13c2bd69dc8d9290e2963e92e911249ec024502db4bd190a54d11de

See more details on using hashes here.

File details

Details for the file pixelflow-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pixelflow-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 147.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pixelflow-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16b2cee34649d96c70bc556219ff389c8c98b6ea1adc531364ff40f618730a28
MD5 b510d7248a626efe99cde11be370ff59
BLAKE2b-256 1d13753577b58bd5aad4a016ae13b52876f697311c1cd40138c2db15ecca487d

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