Skip to content

Commit

Permalink
+add Support of RGBA-32 input image format in base implementation, SS…
Browse files Browse the repository at this point in the history
…E4.1, AVX2 optimizations of function SynetSetInput.
  • Loading branch information
ermig1979 committed Nov 29, 2023
1 parent e0fdc23 commit bae41b8
Show file tree
Hide file tree
Showing 10 changed files with 238 additions and 49 deletions.
5 changes: 5 additions & 0 deletions docs/2023.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ <h1>Simd Library Release Notes (2023).</h1>
<hr/>
<h3 id="R132">December X, 2023 (version X.X.132)</h3>
<h4>Algorithms</h4>
<h5>New features</h5>
<ul>
<li>Support of RGBA-32 input image format in base implementation, SSE4.1, AVX2 optimizations of function SynetSetInput.</li>
</ul>

<h5>Bug fixing</h5>
<ul>
<li>Wrong order of SIMD_DEPRECATED macro.</li>
Expand Down
68 changes: 68 additions & 0 deletions docs/help/group__python.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/help/namespace_simd.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/help/namespacemembers_func_s.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/help/namespacemembers_s.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions py/SimdPy/Simd.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,15 +759,12 @@ def Resized(src : Image, width :int, height: int, method = Simd.ResizeMethod.Bil

## @ingroup python
# Sets image to the input of neural network of <a href="http://github.com/ermig1979/Synet">Synet Framework</a>.
# @param src - an original input image.
# @param dst - a resized output image.
# @param method - a resizing method. By default it is equal to Simd.ResizeMethod.Bilinear.
# @param src - an input image. There are following supported pixel format: aSimd.PixelFormat.Gray8, Simd.PixelFormat.Bgr24, Simd.PixelFormat.Bgra32, Simd.PixelFormat.Rgb24.
# @param lower - an array with lower bound of values of the output tensor. The size of the array have to correspond number of channels in the output image tensor.
# @param upper - an array with upper bound of values of the output tensor. The size of the array have to correspond number of channels in the output image tensor.
# @param dst - a pointer to the output 32-bit float image tensor.
# @param channels - a number of channels in the output image tensor. It can be 1 or 3.
# @param format - a format of output image tensor. There are supported following tensor formats: Simd.TensorFormat.Nchw, Simd.TensorFormat.Nhwc.
# @param src - an input image. There are following supported pixel format: aSimd.PixelFormat.Gray8, Simd.PixelFormat.Bgr24, Simd.PixelFormat.Bgra32, Simd.PixelFormat.Rgb24.
# @param lower - an array with lower bound of values of the output tensor. The size of the array have to correspond number of channels in the output image tensor.
# @param upper - an array with upper bound of values of the output tensor. The size of the array have to correspond number of channels in the output image tensor.
# @param dst - a pointer to the output 32-bit float image tensor.
# @param channels - a number of channels in the output image tensor. It can be 1 or 3.
# @param format - a format of output image tensor. There are supported following tensor formats: Simd.TensorFormat.Nchw, Simd.TensorFormat.Nhwc.
def SynetSetInput(src : Image, lower, upper, dst : ctypes.c_void_p, channels : int, format : Simd.TensorFormat) :
if src.Format() != PixelFormat.Gray8 and src.Format() != PixelFormat.Bgr24 and src.Format() != PixelFormat.Bgra32 and src.Format() != PixelFormat.Rgb24 :
raise Exception("Incompatible image pixel format: {0}!".format(src.Format()))
Expand Down
Loading

0 comments on commit bae41b8

Please sign in to comment.