openvino/tests/layer_tests
Jorge Ragde 8eaa65e026
[TF FE Tests] Change HSVToRGB Unit Test To Test Grayscale Image (#24935)
### Details:
- Currently, the unit test for HSVToRGB is creating a tensor of all ones
in the Grayscale special case as mentioned in
[#24875](https://github.com/openvinotoolkit/openvino/pull/24875). Since
the images are expected to be in HSV and not RGB format, this will
create images that are green, and not gray. Grayscale in HSV can be
achieved by creating a tensor with HSV entries of [0, 0, .5].

### Tickets:
 - N/A

---------

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2024-06-11 14:16:48 +00:00
..
common [OVC] Import openvino-tokenizers extensions from ovc tool (#24681) 2024-05-26 15:40:40 +00:00
jax_tests copyright year update (#23370) 2024-03-14 09:37:02 +00:00
mo_python_api_tests [GHA] Move tokenizers build to reusable job (#23909) 2024-04-19 19:12:17 +00:00
onnx_tests copyright year update (#23370) 2024-03-14 09:37:02 +00:00
ovc_python_api_tests [PT FE]: fix segfault when resolving nested dict as model input (#24719) 2024-05-27 21:24:01 +00:00
py_frontend_tests Fixed bug with inlined inputs (#24448) 2024-05-22 07:29:36 +00:00
pytorch_tests [PT FE] Fix segfault when prim::If can't be converted (#24914) 2024-06-10 11:35:58 +00:00
tensorflow2_keras_tests [MOC] Implement EliminateLoopInputsOutputs (#24786) 2024-06-04 12:37:16 +00:00
tensorflow_lite_tests copyright year update (#23370) 2024-03-14 09:37:02 +00:00
tensorflow_tests [TF FE Tests] Change HSVToRGB Unit Test To Test Grayscale Image (#24935) 2024-06-11 14:16:48 +00:00
.gitignore Add layer tests (#5789) 2021-06-16 12:50:16 +03:00
CMakeLists.txt copyright year update (#23370) 2024-03-14 09:37:02 +00:00
README.md [DOCS][Layer Tests] Update layer test documentation (#23485) 2024-03-15 16:17:15 +00:00
conftest.py copyright year update (#23370) 2024-03-14 09:37:02 +00:00
pytest.ini Quantization support for torch.compile (#23779) 2024-04-03 12:36:56 +00:00
requirements.txt [TF FE] Reduce redundant deps and routines for layer tests (#24314) 2024-04-30 08:24:24 +00:00

README.md

Layer Tests

The layer tests primarily aim to validate support for PyTorch, TensorFlow, TensorFlow Lite, and ONNX frameworks' operations by OpenVINO. The test pipeline includes the following steps:

  1. Creation of a model with the tested operation using original framework API
  2. Conversion of the created model using OpenVINO's convert_model method
  3. Inference of both the original and converted models using the framework and OpenVINO on random input data
  4. Checking whether the inference results from OpenVINO and the framework are the same or different within a tolerance threshold

Setup Environment

To set up the environment for launching layer tests, perform the following steps:

  1. Install the OpenVINO wheel package. If you're testing changes in OpenVINO, build your local wheel package for installation. Find instructions on how to build on wiki page.
    pip install openvino.whl
    
  2. (Optional) Install the OpenVINO Tokenizers wheel package if you're testing the support of operations using conversion and operation extensions from OpenVINO Tokenizers. If you're testing changes in OpenVINO Tokenizers, build your local wheel package for installation. Find instructions on how to build on GitHub page
    pip install openvino_tokenizers.whl
    
  3. Install requirements for running layer tests.
    cd tests/layer_tests
    pip install -r requirements.txt
    

Run Tests

Set environment variables TEST_DEVICE and TEST_PRECISION to select device and inference precision for OpenVINO inference. Allowed values for TEST_DEVICE are CPU and GPU. Allowed values for TEST_PRECISION are FP32 and FP16.

Example to run the TensorFlow layer test for the tf.raw_ops.Unique operation on CPU with default inference precision for device:

cd tests/layer_tests
export TEST_DEVICE="CPU"
pytest tensorflow_tests/test_tf_Unique.py

Example to run the PyTorch layer test for the torch.linalg.cross operation on CPU and GPU with FP16 and FP32 inference precisions:

cd tests/layer_tests
export TEST_DEVICE="CPU;GPU"
export TEST_PRECISION="FP32;FP16"
pytest pytorch_tests/test_cross.py