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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6d9db52d46bb1d860e0e43c6d50bdc795517ac05cb4fc621cff72bb26d27452
|
|
| MD5 |
e155113e68aea5cbef4f9d93df96a0cf
|
|
| BLAKE2b-256 |
29d16c374fd6b0bf559eb663694c48b17d108e80d2e072b69adb9619b25f1ddc
|
Provenance
The following attestation bundles were made for visionapi-0.0.18.tar.gz:
Publisher:
release.yml on josebenitezg/visiontools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
visionapi-0.0.18.tar.gz -
Subject digest:
a6d9db52d46bb1d860e0e43c6d50bdc795517ac05cb4fc621cff72bb26d27452 - Sigstore transparency entry: 152087637
- Sigstore integration time:
-
Permalink:
josebenitezg/visiontools@b486273bb334753458e45aae9557779980c93ba4 -
Branch / Tag:
refs/tags/0.0.18 - Owner: https://github.com/josebenitezg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b486273bb334753458e45aae9557779980c93ba4 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21d37e2f0d34cd241356f0d05a8b881f0eaf95691f2292cbfd9f965d6b47c76e
|
|
| MD5 |
cb78a1fae3d4cbed0bc0a315b8eca096
|
|
| BLAKE2b-256 |
922bded520d462e1cac8205ab6abbd11a6c22e4c0f8fe86b71a3d37ecc359f7b
|
Provenance
The following attestation bundles were made for visionapi-0.0.18-py3-none-any.whl:
Publisher:
release.yml on josebenitezg/visiontools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
visionapi-0.0.18-py3-none-any.whl -
Subject digest:
21d37e2f0d34cd241356f0d05a8b881f0eaf95691f2292cbfd9f965d6b47c76e - Sigstore transparency entry: 152087639
- Sigstore integration time:
-
Permalink:
josebenitezg/visiontools@b486273bb334753458e45aae9557779980c93ba4 -
Branch / Tag:
refs/tags/0.0.18 - Owner: https://github.com/josebenitezg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b486273bb334753458e45aae9557779980c93ba4 -
Trigger Event:
push
-
Statement type: