diff --git a/G-API-Python-Bindings.md b/G-API-Python-Bindings.md new file mode 100644 index 0000000..369b9c3 --- /dev/null +++ b/G-API-Python-Bindings.md @@ -0,0 +1,39 @@ +# Intro + +G-API is also available in OpenCV for Python. This page explains how to build and test G-API in Python. + +## Requirements + +* Python3+ with `numpy` +* OpenVINO - for inference tests with OpenVINO backend; +* [ONNX RT](Using-G-API-with-MS-ONNX-Runtime) - for inference tests with ONNX Runtime backend; +* Working `videoio` module - built with either FFMPEG or [GStreamer] support - as some tests are using video files as input. + +## Building + +Use this CMake option to enable Python (make sure to include options for OpenVINO and ONNX RT if necessary): + +```bash +$ cmake /path/to/opencv -DWITH_PYTHON=ON -DCMAKE_BUILD_TYPE=Release +$ make -j8 opencv_python3 +``` + +## Testing + +Setup environment: + +```bash +$ export LD_LIBRARY_PATH=/lib/:$LD_LIBRARY_PATH +$ export PYTHONPATH=/python_loader/:$PYTHONPATH +$ export OPENCV_TEST_DATA_PATH=/testdata/ +$ export OPENCV_DNN_TEST_DATA_PATH=/testdata/dnn +``` + +Now run G-API tests: + +```bash +$ cd +$ OPENCV_PYTEST_FILTER=test_gapi* python3 /modules/python/test/test.py +``` + +