| 114 | } // namespace |
| 115 | |
| 116 | void ExportOpNormalize(py::module &m) |
| 117 | { |
| 118 | using namespace pybind11::literals; |
| 119 | |
| 120 | py::options options; |
| 121 | options.disable_function_signatures(); |
| 122 | |
| 123 | py::enum_<OpFlags>(m, "NormalizeFlags").value("SCALE_IS_STDDEV", OpFlags::SCALE_IS_STDDEV); |
| 124 | |
| 125 | float defGlobalScale = 1; |
| 126 | float defGlobalShift = 0; |
| 127 | float defEpsilon = 0; |
| 128 | |
| 129 | m.def("normalize", &Normalize, "src"_a, "base"_a, "scale"_a, "flags"_a = std::nullopt, py::kw_only(), |
| 130 | "globalscale"_a = defGlobalScale, "globalshift"_a = defGlobalShift, "epsilon"_a = defEpsilon, |
| 131 | "stream"_a = nullptr, R"pbdoc( |
| 132 | |
| 133 | cvcuda.normalize(src: cvcuda.Tensor, base: cvcuda.Tensor, scale: cvcuda.Tensor, flags: int, globalscale: float, globalshift: float, epsilon: float, stream: Optional[cvcuda.Stream] = None) -> cvcuda.Tensor |
| 134 | |
| 135 | Executes the Normalize operation on the given cuda stream. |
| 136 | |
| 137 | See also: |
| 138 | Refer to the CV-CUDA C API reference for the Normalize operator |
| 139 | for more details and usage examples. |
| 140 | |
| 141 | Args: |
| 142 | src (cvcuda.Tensor): Input tensor containing one or more images. |
| 143 | base (cvcuda.Tensor): Tensor providing base values for normalization. |
| 144 | scale (cvcuda.Tensor): Tensor providing scale values for normalization. |
| 145 | flags (int, optional): Algorithm flags, use cvcuda.NormalizeFlags.SCALE_IS_STDDEV if scale passed as argument |
| 146 | is standard deviation instead or 0 if it is scaling. |
| 147 | globalscale (float, optional): Additional scale value to be used in addition to scale. |
| 148 | globalshift (float, optional): Additional bias value to be used in addition to base. |
| 149 | epsilon (float, optional): Epsilon to use when cvcuda.NormalizeFlags.SCALE_IS_STDDEV flag is set as a regularizing |
| 150 | term to be added to variance. |
| 151 | stream (cvcuda.Stream, optional): CUDA Stream on which to perform the operation. |
| 152 | |
| 153 | Returns: |
| 154 | cvcuda.Tensor: The output tensor. |
| 155 | |
| 156 | Caution: |
| 157 | Restrictions to several arguments may apply. Check the C |
| 158 | API references of the CV-CUDA operator. |
| 159 | )pbdoc"); |
| 160 | |
| 161 | m.def("normalize_into", &NormalizeInto, "dst"_a, "src"_a, "base"_a, "scale"_a, "flags"_a = std::nullopt, |
| 162 | py::kw_only(), "globalscale"_a = defGlobalScale, "globalshift"_a = defGlobalShift, "epsilon"_a = defEpsilon, |
| 163 | "stream"_a = nullptr, R"pbdoc( |
| 164 | |
| 165 | cvcuda.normalize_into(dst: cvcuda.Tensor, src: cvcuda.Tensor, base: cvcuda.Tensor, scale: cvcuda.Tensor, flags: int, globalscale: float, globalshift: float, epsilon: float, stream: Optional[cvcuda.Stream] = None) |
| 166 | |
| 167 | Executes the Normalize operation on the given cuda stream. |
| 168 | |
| 169 | See also: |
| 170 | Refer to the CV-CUDA C API reference for the Normalize operator |
| 171 | for more details and usage examples. |
| 172 | |
| 173 | Args: |
no test coverage detected