# PEKAT VISION SDK - Python
A Python module for communication with [PEKAT VISION](https://www.pekatvision.com/products/software/).
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`](https://pypi.org/project/opencv-python/).
## Example
### Creating the analyzer
```python
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
```python
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
```python
# 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
```python
# Project must have been started using the SDK
p_local.stop()
```
Raw data
{
"_id": null,
"home_page": null,
"name": "pekat-vision-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "developers@pekatvision.com",
"keywords": "pekat, pekatvision, pekatvisionsdk, sdk, vision",
"author": null,
"author_email": "developers@pekatvision.com",
"download_url": "https://files.pythonhosted.org/packages/4a/5d/d90c35a1997b13a5af056561217f1325566d3a2fbb36c4c461edee23d728/pekat_vision_sdk-2.2.0.tar.gz",
"platform": null,
"description": "# PEKAT VISION SDK - Python\n\nA Python module for communication with [PEKAT VISION](https://www.pekatvision.com/products/software/).\n\nFull SDK documentation available here: <https://pekat-vision.github.io/pekat-vision-sdk-python>\n\n## Installation\n\nType `pip install \"pekat-vision-sdk\"` into your terminal.\n\nInstalling with `pip install \"pekat-vision-sdk[opencv]\"` also installs [`opencv`](https://pypi.org/project/opencv-python/).\n\n## Example\n\n### Creating the analyzer\n\n```python\nfrom PekatVisionSDK import Instance\n\n# Start a project locally (host 0.0.0.0 - listen on all interfaces)\n\np_local = Instance(\"~/PekatVisionProjects/my_project\", port=8100, host=\"0.0.0.0\")\n\n# Connect to an already running project\n\np_remote = Instance(port=8000, already_running=True)\n```\n\n### Sending an image to analyze\n\n```python\nimport numpy as np\n\n# p = Instance(...)\n\n# Analyze image from disk\n\nresult = p.analyze(\"path_to_image.png\", response_type=\"annotated_image\")\n\n# Analyze a numpy image\n\n# image: np.ndarray = ...\nresult = p.analyze(image)\n```\n\n### Accessing the results\n\n```python\n# Get the evaluation result (True/False)\n\nflow_result = result.context[\"result\"]\n\n# Decode image bytes and save image on disk\n\nimport cv2\n\nif result.image_bytes is not None:\n image = result.get_decoded_image()\n cv2.imwrite(\"result_with_annotations.png\", image)\n```\n\n### Stopping a project\n\n```python\n# Project must have been started using the SDK\np_local.stop()\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python module for communication with PEKAT VISION",
"version": "2.2.0",
"project_urls": {
"Changelog": "https://github.com/pekat-vision/pekat-vision-sdk-python/blob/master/CHANGELOG.md",
"Documentation": "https://pekat-vision.github.io/pekat-vision-sdk-python/",
"Homepage": "https://github.com/pekat-vision/pekat-vision-sdk-python",
"Repository": "https://github.com/pekat-vision/pekat-vision-sdk-python.git"
},
"split_keywords": [
"pekat",
" pekatvision",
" pekatvisionsdk",
" sdk",
" vision"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "37ae2abf8635e6bf2dcfa39faf78093d4498eb004b9f205b1c2805d41018f25a",
"md5": "5ba5b941f32dbde4ff72371db953d3e3",
"sha256": "df45b316bcf9190e417830447010e70131dc526e45ecf2d82c4f162a032b73cb"
},
"downloads": -1,
"filename": "pekat_vision_sdk-2.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5ba5b941f32dbde4ff72371db953d3e3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 9797,
"upload_time": "2025-01-14T07:59:37",
"upload_time_iso_8601": "2025-01-14T07:59:37.766540Z",
"url": "https://files.pythonhosted.org/packages/37/ae/2abf8635e6bf2dcfa39faf78093d4498eb004b9f205b1c2805d41018f25a/pekat_vision_sdk-2.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4a5dd90c35a1997b13a5af056561217f1325566d3a2fbb36c4c461edee23d728",
"md5": "8219a61385e731126ab5eb2b286d02d8",
"sha256": "fea9da4dffa70f34b790e633124d7b3577acfa1ae0fb9fec72b9fcac3f384374"
},
"downloads": -1,
"filename": "pekat_vision_sdk-2.2.0.tar.gz",
"has_sig": false,
"md5_digest": "8219a61385e731126ab5eb2b286d02d8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8165,
"upload_time": "2025-01-14T07:59:40",
"upload_time_iso_8601": "2025-01-14T07:59:40.231645Z",
"url": "https://files.pythonhosted.org/packages/4a/5d/d90c35a1997b13a5af056561217f1325566d3a2fbb36c4c461edee23d728/pekat_vision_sdk-2.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-14 07:59:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pekat-vision",
"github_project": "pekat-vision-sdk-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pekat-vision-sdk"
}