A Python module for communication with PEKAT VISION
Project description
PEKAT VISION SDK - Python
A Python module for communication with PEKAT VISION.
Full SDK documentation available here: https://pekat-vision.github.io/pekat-vision-sdk-python
Installation
Type pip install "pekat-vision-sdk"
into your terminal.
Installing with pip install "pekat-vision-sdk[opencv]"
also installs opencv
.
Example
Creating the analyzer
from PekatVisionSDK import Instance
# Start a project locally (host 0.0.0.0 - listen on all interfaces)
p_local = Instance("~/PekatVisionProjects/my_project", port=8100, host="0.0.0.0")
# Connect to an already running project
p_remote = Instance(port=8000, already_running=True)
Sending an image to analyze
import numpy as np
# p = Instance(...)
# Analyze image from disk
result = p.analyze("path_to_image.png", response_type="annotated_image")
# Analyze a numpy image
# image: np.ndarray = ...
result = p.analyze(image)
Accessing the results
# Get the evaluation result (True/False)
flow_result = result.context["result"]
# Decode image bytes and save image on disk
import cv2
if result.image_bytes is not None:
image = result.get_decoded_image()
cv2.imwrite("result_with_annotations.png", image)
Stopping a project
# Project must have been started using the SDK
p_local.stop()
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
pekat_vision_sdk-2.1.0.tar.gz
(7.6 kB
view hashes)
Built Distribution
Close
Hashes for pekat_vision_sdk-2.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 232364dd93e5e72dd1bdca4c4310098987304f6cc687eff10a9ac03b3866bbc1 |
|
MD5 | 9a48c3891ac492b0c614ed6fdc89bd69 |
|
BLAKE2b-256 | c40736aeebb7684983d4ff92df28b12b4af3f225bcecdce0d9e6caddb2927a76 |