# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

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

    # PriorBox
    def MinSizes(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # PriorBox
    def MinSizesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
        return 0

    # PriorBox
    def MinSizesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # PriorBox
    def MinSizesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        return o == 0

    # PriorBox
    def MaxSizes(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # PriorBox
    def MaxSizesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
        return 0

    # PriorBox
    def MaxSizesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # PriorBox
    def MaxSizesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

    # PriorBox
    def AspectRatios(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # PriorBox
    def AspectRatiosAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
        return 0

    # PriorBox
    def AspectRatiosLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # PriorBox
    def AspectRatiosIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

    # PriorBox
    def Variances(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # PriorBox
    def VariancesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
        return 0

    # PriorBox
    def VariancesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # PriorBox
    def VariancesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        return o == 0

    # PriorBox
    def Flip(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # PriorBox
    def Clip(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # PriorBox
    def ImageWidth(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

    # PriorBox
    def ImageHeight(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

    # PriorBox
    def StepWidth(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

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

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

def PriorBoxStart(builder): builder.StartObject(11)
def Start(builder):
    return PriorBoxStart(builder)
def PriorBoxAddMinSizes(builder, minSizes): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(minSizes), 0)
def AddMinSizes(builder, minSizes):
    return PriorBoxAddMinSizes(builder, minSizes)
def PriorBoxStartMinSizesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartMinSizesVector(builder, numElems):
    return PriorBoxStartMinSizesVector(builder, numElems)
def PriorBoxAddMaxSizes(builder, maxSizes): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(maxSizes), 0)
def AddMaxSizes(builder, maxSizes):
    return PriorBoxAddMaxSizes(builder, maxSizes)
def PriorBoxStartMaxSizesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartMaxSizesVector(builder, numElems):
    return PriorBoxStartMaxSizesVector(builder, numElems)
def PriorBoxAddAspectRatios(builder, aspectRatios): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(aspectRatios), 0)
def AddAspectRatios(builder, aspectRatios):
    return PriorBoxAddAspectRatios(builder, aspectRatios)
def PriorBoxStartAspectRatiosVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartAspectRatiosVector(builder, numElems):
    return PriorBoxStartAspectRatiosVector(builder, numElems)
def PriorBoxAddVariances(builder, variances): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(variances), 0)
def AddVariances(builder, variances):
    return PriorBoxAddVariances(builder, variances)
def PriorBoxStartVariancesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartVariancesVector(builder, numElems):
    return PriorBoxStartVariancesVector(builder, numElems)
def PriorBoxAddFlip(builder, flip): builder.PrependBoolSlot(4, flip, 0)
def AddFlip(builder, flip):
    return PriorBoxAddFlip(builder, flip)
def PriorBoxAddClip(builder, clip): builder.PrependBoolSlot(5, clip, 0)
def AddClip(builder, clip):
    return PriorBoxAddClip(builder, clip)
def PriorBoxAddImageWidth(builder, imageWidth): builder.PrependInt32Slot(6, imageWidth, 0)
def AddImageWidth(builder, imageWidth):
    return PriorBoxAddImageWidth(builder, imageWidth)
def PriorBoxAddImageHeight(builder, imageHeight): builder.PrependInt32Slot(7, imageHeight, 0)
def AddImageHeight(builder, imageHeight):
    return PriorBoxAddImageHeight(builder, imageHeight)
def PriorBoxAddStepWidth(builder, stepWidth): builder.PrependInt32Slot(8, stepWidth, 0)
def AddStepWidth(builder, stepWidth):
    return PriorBoxAddStepWidth(builder, stepWidth)
def PriorBoxAddStepHeight(builder, stepHeight): builder.PrependInt32Slot(9, stepHeight, 0)
def AddStepHeight(builder, stepHeight):
    return PriorBoxAddStepHeight(builder, stepHeight)
def PriorBoxAddOffset(builder, offset): builder.PrependFloat32Slot(10, offset, 0.0)
def AddOffset(builder, offset):
    return PriorBoxAddOffset(builder, offset)
def PriorBoxEnd(builder): return builder.EndObject()
def End(builder):
    return PriorBoxEnd(builder)