From 72ae2c7a185c7eab4ee19acbbf3b73c0397ed645 Mon Sep 17 00:00:00 2001 From: Songki Choi Date: Tue, 9 Jul 2024 17:26:36 +0900 Subject: [PATCH] Update README for why OpenVINO XAI & known issues (#41) * Update known issues * Update why ovxai used * Address review comment --- .markdownlint.yaml | 6 ++++++ CHANGELOG.md | 1 - README.md | 22 +++++++++++++++++++++- tests/intg/test_classification.py | 2 +- tests/intg/test_detection.py | 2 +- 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.markdownlint.yaml b/.markdownlint.yaml index dc90ea4d..e4d05fb0 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -18,9 +18,15 @@ MD013: false # This is not useful for some files such as `CHANGELOG.md` MD024: false # Multiple headers with the same content +# no-blanks-blockquote Blank line inside blockquote +MD028: false + # blanks-around-fences - Fenced code blocks should be surrounded by blank lines MD031: false +# blanks-around-lists Lists should be surrounded by blank lines +MD032: false + # I find it necessary to use '
' to force line breaks. MD033: false # Inline HTML diff --git a/CHANGELOG.md b/CHANGELOG.md index 56482b9e..b0fde6a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,7 +95,6 @@ ### Known Issues -* OpenVINO IR branch insertion not working for models converted directly from torch models in https://github.com/openvinotoolkit/openvino_xai/issues/26 * Runtime error from ONNX / OpenVINO IR models while conversion or inference for XAI in https://github.com/openvinotoolkit/openvino_xai/issues/29 * Models not supported by white box XAI methods in https://github.com/openvinotoolkit/openvino_xai/issues/30 diff --git a/README.md b/README.md index 65d3ce94..e8fa98af 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,23 @@ Given **OpenVINO** models and input images, **OpenVINO XAI** generates **salienc which highlights regions of the interest in the inputs from the models' perspective to help users understand the reason why the complex AI models output such responses. +Using this package, you can augment the model analysis & explanation feature +on top of the existing OpenVINO inference pipeline with a few lines of code. + +```python +import openvino_xai as xai + +explainer = xai.Explainer(model=ov_model, task=xai.Task.CLASSIFICATION) + +# Existing inference pipeline +for i, image in enumerate(images): + labels = infer(model=ov_model, image=image) + + # Model analysis + explanation = explainer(data=image, targets=labels) + explanation.save(dir_path="./xai", name=str(i)) +``` + --- ## Features @@ -64,10 +81,13 @@ Most of CNNs and Transformer models from [Pytorch Image Models (timm)](https://g Please refer to the following known issues for unsupported models and reasons. -* [OpenVINO IR branch insertion not working for models converted directly from torch models with OVC (#26)](https://github.com/openvinotoolkit/openvino_xai/issues/26) * [Runtime error from ONNX / OpenVINO IR models while conversion or inference for XAI (#29)](https://github.com/openvinotoolkit/openvino_xai/issues/29) * [Models not supported by white box XAI methods (#30)](https://github.com/openvinotoolkit/openvino_xai/issues/30) +> **_WARNING:_** OpenVINO XAI is fully validated on OpenVINO 2024.2.0. Following issue might be observed if older version of OpenVINO is used. +> * [OpenVINO IR branch insertion not working for models converted directly from torch models with OVC (#26)](https://github.com/openvinotoolkit/openvino_xai/issues/26) +> A simple workaround is to convert Torch models to ONNX models and then convert to OpenVINO models to feed to OpenVINO XAI. Please refer to [the code example](openvino_xai/utils/model_export.py). + > **_NOTE:_** GenAI / LLMs would be also supported incrementally in the upcoming releases. --- diff --git a/tests/intg/test_classification.py b/tests/intg/test_classification.py index ca039195..609da025 100644 --- a/tests/intg/test_classification.py +++ b/tests/intg/test_classification.py @@ -1,7 +1,7 @@ # Copyright (C) 2023-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -import subprocess +import subprocess # nosec B404 (not a part of product) from pathlib import Path import cv2 diff --git a/tests/intg/test_detection.py b/tests/intg/test_detection.py index 5f365672..f2869dde 100644 --- a/tests/intg/test_detection.py +++ b/tests/intg/test_detection.py @@ -1,7 +1,7 @@ # Copyright (C) 2023-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -import subprocess +import subprocess # nosec B404 (not a part of product) from pathlib import Path import addict