# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # Proposal
    def FeatStride(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

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

    # Proposal
    def PreNmsTopN(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

    # Proposal
    def AfterNmsTopN(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

    # Proposal
    def NmsThreshold(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

    # Proposal
    def MinSize(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

    # Proposal
    def Ratios(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = Blob()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Proposal
    def Scales(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = Blob()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Proposal
    def Anchors(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = Blob()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def ProposalStart(builder): builder.StartObject(9)
def Start(builder):
    return ProposalStart(builder)
def ProposalAddFeatStride(builder, featStride): builder.PrependInt32Slot(0, featStride, 0)
def AddFeatStride(builder, featStride):
    return ProposalAddFeatStride(builder, featStride)
def ProposalAddBaseSize(builder, baseSize): builder.PrependInt32Slot(1, baseSize, 0)
def AddBaseSize(builder, baseSize):
    return ProposalAddBaseSize(builder, baseSize)
def ProposalAddPreNmsTopN(builder, preNmsTopN): builder.PrependInt32Slot(2, preNmsTopN, 0)
def AddPreNmsTopN(builder, preNmsTopN):
    return ProposalAddPreNmsTopN(builder, preNmsTopN)
def ProposalAddAfterNmsTopN(builder, afterNmsTopN): builder.PrependInt32Slot(3, afterNmsTopN, 0)
def AddAfterNmsTopN(builder, afterNmsTopN):
    return ProposalAddAfterNmsTopN(builder, afterNmsTopN)
def ProposalAddNmsThreshold(builder, nmsThreshold): builder.PrependFloat32Slot(4, nmsThreshold, 0.0)
def AddNmsThreshold(builder, nmsThreshold):
    return ProposalAddNmsThreshold(builder, nmsThreshold)
def ProposalAddMinSize(builder, minSize): builder.PrependInt32Slot(5, minSize, 0)
def AddMinSize(builder, minSize):
    return ProposalAddMinSize(builder, minSize)
def ProposalAddRatios(builder, ratios): builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(ratios), 0)
def AddRatios(builder, ratios):
    return ProposalAddRatios(builder, ratios)
def ProposalAddScales(builder, scales): builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(scales), 0)
def AddScales(builder, scales):
    return ProposalAddScales(builder, scales)
def ProposalAddAnchors(builder, anchors): builder.PrependUOffsetTRelativeSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(anchors), 0)
def AddAnchors(builder, anchors):
    return ProposalAddAnchors(builder, anchors)
def ProposalEnd(builder): return builder.EndObject()
def End(builder):
    return ProposalEnd(builder)