Skip to main content

No project description provided

Project description

VisionAPI

A comprehensive Python library providing utilities and tools for computer vision tasks, focusing on camera handling, video processing, and integration with popular ML frameworks.

Features

  • Multi-camera support with simultaneous streaming and recording
  • Video editing utilities (concatenation, trimming, etc.)
  • Easy integration with Ultralytics YOLO models
  • Real-time visualization tools
  • Configurable camera settings and display options

Installation

pip install visionapi

Quick Start

Multi-Camera Handling

Easily manage multiple camera streams with the CameraApp class:

from visionapi.camera_loader import CameraApp, CameraConfig
import cv2

# Configure camera settings
config = CameraConfig(
    width=1280,
    height=720,
    fps=60,
    show_window=True
)

# Initialize and use cameras
with CameraApp(config) as app:
    # Detect and load cameras
    available_cameras = app.detect_cameras()
    num_loaded = app.load_cameras(available_cameras)
    
    # Start recording with custom camera names
    output_folder = app.start_recording(["Front", "Back"])
    
    # Main capture loop
    while True:
        frames = app.capture_frame()
        # Process frames here
        
        # Exit on 'q' press (requires show_window=True)
        if cv2.waitKey(1) & 0xFF == ord('q'):
            break
    
    # Clean up
    app.stop_recording()

Video Editing

Combine multiple video streams:

from visiontools.video_editing import concat_videos

# Concatenate videos horizontally
concat_videos(
    input_videos=['cam0.mp4', 'cam1.mp4', 'cam2.mp4'],
    output_path='concatenated_video.mp4',
    direction='horizontal'
)

YOLO Integration

VisionAPI provides convenient utilities for working with Ultralytics YOLO models:

Single Image Analysis

from ultralytics import YOLO
from visionapi import quick_display

model = YOLO("yolov8n.pt")
results = model("cats.jpg", verbose=False)
quick_display(results, ultralytics_results=True)

Single Video Analysis

from ultralytics import YOLO
from visionapi import quick_display

model = YOLO("yolov8n.pt")
results = model("videos/cam0.mp4", verbose=False)
quick_display(results, ultralytics_results=True)

Multi-Camera Analysis

from ultralytics import YOLO
from visionapi import quick_display

# Process multiple video streams
videos_list = ["videos/cam0.mp4", "videos/cam1.mp4", "videos/cam2.mp4"]
model = YOLO("yolov8n.pt")

results = {
    f"camera{i}": model(video, verbose=False)
    for i, video in enumerate(videos_list)
}

quick_display(results, ultralytics_results=True, multicam=True)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

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

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

visionapi-0.0.18.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

visionapi-0.0.18-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file visionapi-0.0.18.tar.gz.

File metadata

  • Download URL: visionapi-0.0.18.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for visionapi-0.0.18.tar.gz
Algorithm Hash digest
SHA256 a6d9db52d46bb1d860e0e43c6d50bdc795517ac05cb4fc621cff72bb26d27452
MD5 e155113e68aea5cbef4f9d93df96a0cf
BLAKE2b-256 29d16c374fd6b0bf559eb663694c48b17d108e80d2e072b69adb9619b25f1ddc

See more details on using hashes here.

Provenance

The following attestation bundles were made for visionapi-0.0.18.tar.gz:

Publisher: release.yml on josebenitezg/visiontools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file visionapi-0.0.18-py3-none-any.whl.

File metadata

  • Download URL: visionapi-0.0.18-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for visionapi-0.0.18-py3-none-any.whl
Algorithm Hash digest
SHA256 21d37e2f0d34cd241356f0d05a8b881f0eaf95691f2292cbfd9f965d6b47c76e
MD5 cb78a1fae3d4cbed0bc0a315b8eca096
BLAKE2b-256 922bded520d462e1cac8205ab6abbd11a6c22e4c0f8fe86b71a3d37ecc359f7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for visionapi-0.0.18-py3-none-any.whl:

Publisher: release.yml on josebenitezg/visiontools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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