Frame Normalization =================== This example shows how you can normalize a frame before sending it to another neural network. Many neural network models require frames with RGB values (pixels) in range between :code:`-0.5` to :code:`0.5`. :ref:`ColorCamera`'s preview outputs values between :code:`0` and :code:`255`. Simple custom model, created with PyTorch (`link here `__, `tutorial here `__), allows users to specify mean and scale factors that will be applied to all frame values (pixels). .. math:: output = (input - mean) / scale .. image:: /_static/images/examples/normalize_model.png On the host, values are converted back to :code:`0`-:code:`255`, so they can be displayed by OpenCV. .. note:: This is just a demo, for normalization you should use OpenVINO's `model optimizer `__ arguments :code:`--mean_values` and :code:`--scale_values`. Setup ##### .. include:: /includes/install_from_pypi.rst Source code ########### .. tabs:: .. tab:: Python Also `available on GitHub `__ .. literalinclude:: ../../../../examples/NeuralNetwork/normalization_multi_input.py :language: python :linenos: .. tab:: C++ Also `available on GitHub `__ .. literalinclude:: ../../../../depthai-core/examples/NeuralNetwork/normalization_multi_input.cpp :language: cpp :linenos: .. include:: /includes/footer-short.rst