# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class DetectionOutput(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = DetectionOutput()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsDetectionOutput(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # DetectionOutput
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # DetectionOutput
    def ClassCount(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # DetectionOutput
    def NmsThresholdold(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

    # DetectionOutput
    def NmsTopK(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # DetectionOutput
    def KeepTopK(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # DetectionOutput
    def ConfidenceThreshold(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

    # DetectionOutput
    def ShareLocation(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # DetectionOutput
    def BackgroundLable(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # DetectionOutput
    def VarianceEncodedTarget(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # DetectionOutput
    def CodeType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # DetectionOutput
    def ObjectnessScore(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.01

def DetectionOutputStart(builder): builder.StartObject(10)
def Start(builder):
    return DetectionOutputStart(builder)
def DetectionOutputAddClassCount(builder, classCount): builder.PrependInt32Slot(0, classCount, 0)
def AddClassCount(builder, classCount):
    return DetectionOutputAddClassCount(builder, classCount)
def DetectionOutputAddNmsThresholdold(builder, nmsThresholdold): builder.PrependFloat32Slot(1, nmsThresholdold, 0.0)
def AddNmsThresholdold(builder, nmsThresholdold):
    return DetectionOutputAddNmsThresholdold(builder, nmsThresholdold)
def DetectionOutputAddNmsTopK(builder, nmsTopK): builder.PrependInt32Slot(2, nmsTopK, 0)
def AddNmsTopK(builder, nmsTopK):
    return DetectionOutputAddNmsTopK(builder, nmsTopK)
def DetectionOutputAddKeepTopK(builder, keepTopK): builder.PrependInt32Slot(3, keepTopK, 0)
def AddKeepTopK(builder, keepTopK):
    return DetectionOutputAddKeepTopK(builder, keepTopK)
def DetectionOutputAddConfidenceThreshold(builder, confidenceThreshold): builder.PrependFloat32Slot(4, confidenceThreshold, 0.0)
def AddConfidenceThreshold(builder, confidenceThreshold):
    return DetectionOutputAddConfidenceThreshold(builder, confidenceThreshold)
def DetectionOutputAddShareLocation(builder, shareLocation): builder.PrependInt32Slot(5, shareLocation, 0)
def AddShareLocation(builder, shareLocation):
    return DetectionOutputAddShareLocation(builder, shareLocation)
def DetectionOutputAddBackgroundLable(builder, backgroundLable): builder.PrependInt32Slot(6, backgroundLable, 0)
def AddBackgroundLable(builder, backgroundLable):
    return DetectionOutputAddBackgroundLable(builder, backgroundLable)
def DetectionOutputAddVarianceEncodedTarget(builder, varianceEncodedTarget): builder.PrependInt32Slot(7, varianceEncodedTarget, 0)
def AddVarianceEncodedTarget(builder, varianceEncodedTarget):
    return DetectionOutputAddVarianceEncodedTarget(builder, varianceEncodedTarget)
def DetectionOutputAddCodeType(builder, codeType): builder.PrependInt32Slot(8, codeType, 0)
def AddCodeType(builder, codeType):
    return DetectionOutputAddCodeType(builder, codeType)
def DetectionOutputAddObjectnessScore(builder, objectnessScore): builder.PrependFloat32Slot(9, objectnessScore, 0.01)
def AddObjectnessScore(builder, objectnessScore):
    return DetectionOutputAddObjectnessScore(builder, objectnessScore)
def DetectionOutputEnd(builder): return builder.EndObject()
def End(builder):
    return DetectionOutputEnd(builder)