OpYoloV5Decode.h#

Fully qualified name: public/src/operator/include/OpYoloV5Decode.h

File members: public/src/operator/include/OpYoloV5Decode.h

/*
 * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef PVA_SOLUTIONS_OPYOLOV5DECODE_H
#define PVA_SOLUTIONS_OPYOLOV5DECODE_H

#include <PvaOperator.h>
#include <PvaOperatorTypes.h>
#include <cuda_runtime.h>
#include <cupva_host_scheduling.h>
#include <nvcv/Status.h>
#include <nvcv/Tensor.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum
{
    PVA_YOLOV5_DECODE_INPUT_CHW = 0,
    PVA_YOLOV5_DECODE_INPUT_HWC = 1
} PVAYoloV5DecodeInputLayout;

NVCVStatus pvaYoloV5DecodeCreate(NVCVOperatorHandle *handle, NVCVTensorRequirements const *inPredReqs,
                                 NVCVTensorRequirements const *inAnchorReqs, NVCVTensorRequirements const *outBoxesReqs,
                                 NVCVTensorRequirements const *outScoresReqs,
                                 NVCVTensorRequirements const *outClassesReqs,
                                 NVCVTensorRequirements const *outCountReqs, int numClasses, float confThreshold,
                                 int imgHeight, int imgWidth, PVAYoloV5DecodeInputLayout inputLayout);

#ifdef __cplusplus
}

NVCVStatus pvaYoloV5DecodeSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, NVCVTensorHandle predictions,
                                 NVCVTensorHandle anchors, NVCVTensorHandle boxes, NVCVTensorHandle scores,
                                 NVCVTensorHandle classes, NVCVTensorHandle count);

NVCVStatus pvaYoloV5DecodeSubmit(NVCVOperatorHandle handle, cudaStream_t stream, NVCVTensorHandle predictions,
                                 NVCVTensorHandle anchors, NVCVTensorHandle boxes, NVCVTensorHandle scores,
                                 NVCVTensorHandle classes, NVCVTensorHandle count);

#endif // __cplusplus

#endif /* PVA_SOLUTIONS_OPYOLOV5DECODE_H */