Download modules/dnn/src/cuda/bbox_utils.hpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/tgollogly/test/resolve/main/modules/dnn/src/cuda/bbox_utils.hpp
- Command line
-
hf download hf://tgollogly/test/modules/dnn/src/cuda/bbox_utils.hpp
-
curl -L -o bbox_utils.hpp https://huggingface.co/tgollogly/test/resolve/main/modules/dnn/src/cuda/bbox_utils.hpp
1.03 kB
| // This file is part of OpenCV project. | |
| // It is subject to the license terms in the LICENSE file found in the top-level directory | |
| // of this distribution and at http://opencv.org/license.html. | |
| namespace cv { namespace dnn { namespace cuda4dnn { namespace kernels { | |
| struct BoundingBox | |
| { | |
| float xmin, ymin, xmax, ymax; | |
| }; | |
| template <bool NORMALIZED_BBOX> | |
| __device__ __forceinline__ float compute_bbox_size(BoundingBox bbox) | |
| { | |
| float width = bbox.xmax - bbox.xmin; | |
| float height = bbox.ymax - bbox.ymin; | |
| if (width < 0 || height < 0) | |
| return 0.0; | |
| if (!NORMALIZED_BBOX) | |
| { | |
| width += 1; | |
| height += 1; | |
| } | |
| using csl::device::mul_ftz; | |
| return mul_ftz(width, height); | |
| } | |
| }}}} /* namespace cv::dnn::cuda4dnn::kernels */ | |