Table of Contents
Installation
pip install bluevision
Usage
Simple video demo
from bluevision.demo import video_demo
video_demo(
weights="yolov8s-coco.safetensors",
video_path="sample.mp4",
model_size="s",
track=True,
show=True,
save_path="output.mp4",
)
Video Inference Process
import cv2
import supervision as sv
import bluevision as bv
from bluevision.utils import to_supervision_detections, make_labels
# Initialize
detector = bv.solutions.Detector(model=bv.solutions.detector.models.Yolov8(size='s'),
nms=bv.utils.nms.soft_nms,
weights="yolov8s.safetensors")
tracker = bv.utils.tracker.BYTETracker(track_thresh=0.15, match_thresh=0.9,
track_buffer=60, frame_rate=30)
box_annotator = sv.BoundingBoxAnnotator(thickness=2)
label_annotator = sv.LabelAnnotator(text_scale=0.5, text_padding=2)
# Load sample video
vid = cv2.VideoCapture('sample.mp4')
# Start
while True:
ret, original_image = vid.read()
if not ret:
break
detections = detector(original_image)
detections = tracker.update(detections)
# Draw bboxes using supervision
sv_detections = to_supervision_detections(detections)
annotated_frame = box_annotator.annotate(
scene=original_image,
detections=sv_detections,
)
annotated_frame = label_annotator.annotate(
scene=annotated_frame,
detections=sv_detections,
labels=make_labels(sv_detections)
)
cv2.imshow('annotated image', annotated_frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cv2.destroyAllWindows()
BlueVision
Solution
Utils
Test
$ python test_with_time.py
Using device: mps
preprocess: 0.00225s, infer: 0.015508s, postprocess: 0.01313s, track: 0.00108s, draw: 0.000670s, total: 0.03462s, t-avg: 0.03576s
total frame : 1050
total elapsed time: 56.25610s
total inference time: 37.55273s
License
bluevision is distributed under the terms of the MIT license.
Metadata
Release files for bluevision 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bluevision-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Release files / bluevision-0.0.6-py3-none-any.whl
| Download URL | bluevision-0.0.6-py3-none-any.whl |
|---|---|
| Size | 23.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5cfd0b361a175175cba2be691eae8c5d6ca149a4de81a2144aa09a1110733b57
|
|
BLAKE2b-256 checksum How to use checksums |
5457ef8a68b900f148c37a6e08247323ca07604da776a72e674eac17f86fa238
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Security for bluevision 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.