Skip to main content

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)

Uploaded Source

Built Distribution

pekat_vision_sdk-2.1.0-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page