visiongraph


Namevisiongraph JSON
Version 0.1.57.1 PyPI version JSON
download
home_pagehttps://github.com/cansik/visiongraph
SummaryVisiongraph is a high level computer vision framework.
upload_time2024-04-23 14:46:16
maintainerNone
docs_urlNone
authorFlorian Bruggisser
requires_pythonNone
licenseMIT License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ![image](https://user-images.githubusercontent.com/5220162/192808079-2043fb41-8637-4697-8286-985bc5340f37.png) Visiongraph [![PyPI](https://img.shields.io/pypi/v/visiongraph)](https://pypi.org/project/visiongraph/)
Visiongraph is a high level computer vision framework that includes predefined modules to quickly create and run algorithms on images. It is based on opencv and includes other computer vision frameworks like [Intel openVINO](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/overview.html) and [Google MediaPipe](https://google.github.io/mediapipe/).

Here an example on how to start a webcam capture and display the image:

```python
import visiongraph as vg
vg.create_graph(vg.VideoCaptureInput()).then(vg.ImagePreview()).open()
```

The main goal is to implement a platform independent and high performance framework for day-to-day computer vision tasks.

## Installation
Visiongraph supports python `3.9` and `3.10`. Other versions might work as well but are not officially supported.

To install visiongraph with all dependencies call [pip](https://pypi.org/project/pip/) like this:

```bash
pip install "visiongraph[all]"
```

🚨 *Please note that visiongraph is in an early alpha phase and the API will still undergo changes.*

It is also possible to only install certain packages depending on your needs:

```bash
pip install "visiongraph[realsense, openvino, mediapipe, onnx, media, azure, numba, opencv-contrib]"
```

### Development
To develop visiograph itself it is recommended to clone this repository and install the dependencies like this:

```bash
# in the visiongraph directory
pip install -e ".[all]"
```

### Build
To build a new wheel package of visiongraph run the following command in the root directory.

```bash
python setup.py bdist_wheel
```

## Examples
To demonstrate the possibilities of visiongraph there are already implemented [examples](examples) ready for you to try out. Here is a list of the current examples:

- [SimpleVisionGraph](examples/SimpleVisionGraph.py) - SSD object detection & tracking of live webcam input with `5` lines of code.
- [VisionGraphExample](examples/VisionGraphExample.py) - A face detection and tracking example with custom events.
- [InputExample](examples/InputExample.py) - A basic input example that determines the center if possible.
- [RealSenseDepthExample](examples/DepthCameraExample.py) - Display the RealSense or Azure Kinect depth map.
- [FaceDetectionExample](examples/FaceDetectionExample.py) - A face detection pipeline example.
- [FindFaceExample](examples/FindFaceExample.py) - A face recognition example to find a target face.
- [CascadeFaceDetectionExample](examples/CascadeFaceDetectionExample.py) -  A face detection pipeline that also predicts other feature points of the face.
- [HandDetectionExample](examples/HandDetectionExample.py) - A hand detection pipeline example.
- [PoseEstimationExample](examples/PoseEstimationExample.py) - A pose estimation pipeline which annotates the generic pose keypoints.
- [ProjectedPoseExample](examples/ProjectedPoseExample.py) -  Project the pose estimation into 3d space with the RealSense camera.
- [ObjectDetectionExample](examples/ObjectDetectionExample.py) - An object detection & tracking example.
- [InstanceSegmentationExample](examples/InstanceSegmentationExample.py) - Intance Segmentation based on COCO80 dataset.
- [InpaintExample](examples/InpaintExample.py) - GAN based inpainting example.
- [MidasDepthExample](examples/MidasDepthExample.py) - Realtime depth prediction with the [midas-small](https://github.com/isl-org/MiDaS) network.
- [RGBDSmoother](examples/RGBDSmoother.py) - Smooth RGB-D depth map videos with a one-euro filter per pixel.

There are even more examples where visiongraph is currently in use:

- [Spout/Syphon RGB-D Example](https://github.com/cansik/spout-rgbd-example) - Share RGB-D images over spout or syphon.
- [WebRTC Input](https://github.com/cansik/visiongraph-webrtc) - WebRTC input example for visiongraph

## Documentation
This documentation is intended to provide an overview of the framework. A full documentation will be available later.

### Graph
The core component of visiongraph is the [BaseGraph](https://github.com/cansik/visiongraph/blob/main/visiongraph/BaseGraph.py) class. It contains and handles all the nodes of the graph. A BaseGraph can run on the same thread as called or a new thread or process. The nodes in the graph are just a list, the graph itself is created by nesting nodes into each other.

#### Graph Node
A [GraphNode](https://github.com/cansik/visiongraph/blob/main/visiongraph/GraphNode.py) is a single step in the graph. It has a input and output type and processes the data within the `process()` method.

#### Graph Builder
The graph builder helps to create new graphs on a single line in python. It creates a [VisionGraph](https://github.com/cansik/visiongraph/blob/main/visiongraph/VisionGraph.py) object which is a child of the BaseGraph. The following code snippet is an example of the graph builder which creates a smooth pose estimation graph.

```python
import visiongraph as vg

graph = (vg.create_graph(name="Smooth Pose Estimation",
                         input_node=vg.VideoCaptureInput(0),
                         handle_signals=True)
         .apply(ssd=vg.sequence(vg.OpenPoseEstimator.create(), vg.MotpyTracker(), vg.LandmarkSmoothFilter()),
                image=vg.passthrough())
         .then(vg.ResultAnnotator(image="image"), vg.ImagePreview())
         )
graph.open()
```

### Input
Supported are image, video, webcam, RealSense and Azure Kinect input types.

### Estimator
Usually an estimator is a graph node which takes an image as an input and estimates an information about the content. This could be a pose estimation or a face detection. It is also possible to have a transformation of the image, for example de-blurring it or estimate the depth map.

### Object Detection Tracker
Object detection trackers allow a detected object to be assigned an id that remains the same across successive frames.

### DSP (Digital Signal Processing)
To filter noisy estimations or inputs, the DSP package provides different filters which can be applied directly into a graph.

### Recorder
To record incoming frames or annotated results, multiple frame recorders are provided.

### Assets
Most estimators use big model and weight descriptions for their neural networks. To keep visiongraph small and easy to install, these assets are hosted externally on github. Visiongraph provides a system to directly download and cache these files.

### Argparse
To support rapid prototyping many graph and estimator options are already provided to add to the argparse parser.

### Logging
To enable logging for visiongraph imports please set the following environment variable:

```bash
# zsh / bash
export VISIONGRAPH_LOGLEVEL=INFO

# cmd
set VISIONGRAPH_LOGLEVEL=INFO

# powershell
$env:VISIONGRAPH_LOGLEVEL="INFO"
```

## Roadmap
Next roadmap points:

- Async input and network model (run when ready)

## About
Copyright (c) 2023 Florian Bruggisser

### Included Libraries

Parts of these libraries are directly included and adapted to work with visiongraph.

* [motpy](https://github.com/wmuron/motpy) - simple multi object tracking library (MIT License)
* [motrackers](https://github.com/adipandas/multi-object-tracker) - Multi-object trackers in Python (MIT License)
* [OneEuroFilter-Numpy](https://github.com/HoBeom/OneEuroFilter-Numpy) - (MIT License)

For more information about the dependencies have a look at the [requirements.txt](https://github.com/cansik/visiongraph/blob/main/requirements.txt).



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cansik/visiongraph",
    "name": "visiongraph",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Florian Bruggisser",
    "author_email": "github@broox.ch",
    "download_url": null,
    "platform": null,
    "description": "# ![image](https://user-images.githubusercontent.com/5220162/192808079-2043fb41-8637-4697-8286-985bc5340f37.png) Visiongraph [![PyPI](https://img.shields.io/pypi/v/visiongraph)](https://pypi.org/project/visiongraph/)\nVisiongraph is a high level computer vision framework that includes predefined modules to quickly create and run algorithms on images. It is based on opencv and includes other computer vision frameworks like [Intel openVINO](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/overview.html) and [Google MediaPipe](https://google.github.io/mediapipe/).\n\nHere an example on how to start a webcam capture and display the image:\n\n```python\nimport visiongraph as vg\nvg.create_graph(vg.VideoCaptureInput()).then(vg.ImagePreview()).open()\n```\n\nThe main goal is to implement a platform independent and high performance framework for day-to-day computer vision tasks.\n\n## Installation\nVisiongraph supports python `3.9` and `3.10`. Other versions might work as well but are not officially supported.\n\nTo install visiongraph with all dependencies call [pip](https://pypi.org/project/pip/) like this:\n\n```bash\npip install \"visiongraph[all]\"\n```\n\n\ud83d\udea8 *Please note that visiongraph is in an early alpha phase and the API will still undergo changes.*\n\nIt is also possible to only install certain packages depending on your needs:\n\n```bash\npip install \"visiongraph[realsense, openvino, mediapipe, onnx, media, azure, numba, opencv-contrib]\"\n```\n\n### Development\nTo develop visiograph itself it is recommended to clone this repository and install the dependencies like this:\n\n```bash\n# in the visiongraph directory\npip install -e \".[all]\"\n```\n\n### Build\nTo build a new wheel package of visiongraph run the following command in the root directory.\n\n```bash\npython setup.py bdist_wheel\n```\n\n## Examples\nTo demonstrate the possibilities of visiongraph there are already implemented [examples](examples) ready for you to try out. Here is a list of the current examples:\n\n- [SimpleVisionGraph](examples/SimpleVisionGraph.py) - SSD object detection & tracking of live webcam input with `5` lines of code.\n- [VisionGraphExample](examples/VisionGraphExample.py) - A face detection and tracking example with custom events.\n- [InputExample](examples/InputExample.py) - A basic input example that determines the center if possible.\n- [RealSenseDepthExample](examples/DepthCameraExample.py) - Display the RealSense or Azure Kinect depth map.\n- [FaceDetectionExample](examples/FaceDetectionExample.py) - A face detection pipeline example.\n- [FindFaceExample](examples/FindFaceExample.py) - A face recognition example to find a target face.\n- [CascadeFaceDetectionExample](examples/CascadeFaceDetectionExample.py) -  A face detection pipeline that also predicts other feature points of the face.\n- [HandDetectionExample](examples/HandDetectionExample.py) - A hand detection pipeline example.\n- [PoseEstimationExample](examples/PoseEstimationExample.py) - A pose estimation pipeline which annotates the generic pose keypoints.\n- [ProjectedPoseExample](examples/ProjectedPoseExample.py) -  Project the pose estimation into 3d space with the RealSense camera.\n- [ObjectDetectionExample](examples/ObjectDetectionExample.py) - An object detection & tracking example.\n- [InstanceSegmentationExample](examples/InstanceSegmentationExample.py) - Intance Segmentation based on COCO80 dataset.\n- [InpaintExample](examples/InpaintExample.py) - GAN based inpainting example.\n- [MidasDepthExample](examples/MidasDepthExample.py) - Realtime depth prediction with the [midas-small](https://github.com/isl-org/MiDaS) network.\n- [RGBDSmoother](examples/RGBDSmoother.py) - Smooth RGB-D depth map videos with a one-euro filter per pixel.\n\nThere are even more examples where visiongraph is currently in use:\n\n- [Spout/Syphon RGB-D Example](https://github.com/cansik/spout-rgbd-example) - Share RGB-D images over spout or syphon.\n- [WebRTC Input](https://github.com/cansik/visiongraph-webrtc) - WebRTC input example for visiongraph\n\n## Documentation\nThis documentation is intended to provide an overview of the framework. A full documentation will be available later.\n\n### Graph\nThe core component of visiongraph is the [BaseGraph](https://github.com/cansik/visiongraph/blob/main/visiongraph/BaseGraph.py) class. It contains and handles all the nodes of the graph. A BaseGraph can run on the same thread as called or a new thread or process. The nodes in the graph are just a list, the graph itself is created by nesting nodes into each other.\n\n#### Graph Node\nA [GraphNode](https://github.com/cansik/visiongraph/blob/main/visiongraph/GraphNode.py) is a single step in the graph. It has a input and output type and processes the data within the `process()` method.\n\n#### Graph Builder\nThe graph builder helps to create new graphs on a single line in python. It creates a [VisionGraph](https://github.com/cansik/visiongraph/blob/main/visiongraph/VisionGraph.py) object which is a child of the BaseGraph. The following code snippet is an example of the graph builder which creates a smooth pose estimation graph.\n\n```python\nimport visiongraph as vg\n\ngraph = (vg.create_graph(name=\"Smooth Pose Estimation\",\n                         input_node=vg.VideoCaptureInput(0),\n                         handle_signals=True)\n         .apply(ssd=vg.sequence(vg.OpenPoseEstimator.create(), vg.MotpyTracker(), vg.LandmarkSmoothFilter()),\n                image=vg.passthrough())\n         .then(vg.ResultAnnotator(image=\"image\"), vg.ImagePreview())\n         )\ngraph.open()\n```\n\n### Input\nSupported are image, video, webcam, RealSense and Azure Kinect input types.\n\n### Estimator\nUsually an estimator is a graph node which takes an image as an input and estimates an information about the content. This could be a pose estimation or a face detection. It is also possible to have a transformation of the image, for example de-blurring it or estimate the depth map.\n\n### Object Detection Tracker\nObject detection trackers allow a detected object to be assigned an id that remains the same across successive frames.\n\n### DSP (Digital Signal Processing)\nTo filter noisy estimations or inputs, the DSP package provides different filters which can be applied directly into a graph.\n\n### Recorder\nTo record incoming frames or annotated results, multiple frame recorders are provided.\n\n### Assets\nMost estimators use big model and weight descriptions for their neural networks. To keep visiongraph small and easy to install, these assets are hosted externally on github. Visiongraph provides a system to directly download and cache these files.\n\n### Argparse\nTo support rapid prototyping many graph and estimator options are already provided to add to the argparse parser.\n\n### Logging\nTo enable logging for visiongraph imports please set the following environment variable:\n\n```bash\n# zsh / bash\nexport VISIONGRAPH_LOGLEVEL=INFO\n\n# cmd\nset VISIONGRAPH_LOGLEVEL=INFO\n\n# powershell\n$env:VISIONGRAPH_LOGLEVEL=\"INFO\"\n```\n\n## Roadmap\nNext roadmap points:\n\n- Async input and network model (run when ready)\n\n## About\nCopyright (c) 2023 Florian Bruggisser\n\n### Included Libraries\n\nParts of these libraries are directly included and adapted to work with visiongraph.\n\n* [motpy](https://github.com/wmuron/motpy) - simple multi object tracking library (MIT License)\n* [motrackers](https://github.com/adipandas/multi-object-tracker) - Multi-object trackers in Python (MIT License)\n* [OneEuroFilter-Numpy](https://github.com/HoBeom/OneEuroFilter-Numpy) - (MIT License)\n\nFor more information about the dependencies have a look at the [requirements.txt](https://github.com/cansik/visiongraph/blob/main/requirements.txt).\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Visiongraph is a high level computer vision framework.",
    "version": "0.1.57.1",
    "project_urls": {
        "Homepage": "https://github.com/cansik/visiongraph"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "07bec5b5d9c546d9edd2409cb59920679e6f05a3e0ba20f7b1e6005bda1f1b02",
                "md5": "26649253194b522c31b646806492c6db",
                "sha256": "a7c227c91a5fb335b72c4cc06aa9d6d8a225d750b2a948b2b73a1ed8e3038e1e"
            },
            "downloads": -1,
            "filename": "visiongraph-0.1.57.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "26649253194b522c31b646806492c6db",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 263259,
            "upload_time": "2024-04-23T14:46:16",
            "upload_time_iso_8601": "2024-04-23T14:46:16.528547Z",
            "url": "https://files.pythonhosted.org/packages/07/be/c5b5d9c546d9edd2409cb59920679e6f05a3e0ba20f7b1e6005bda1f1b02/visiongraph-0.1.57.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-23 14:46:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cansik",
    "github_project": "visiongraph",
    "github_not_found": true,
    "lcname": "visiongraph"
}
        
Elapsed time: 0.28191s