Class IntersectOverUnionRatio

    • Field Detail

      • IOU_PERCENTAGE_HIGHEST

        public static final String IOU_PERCENTAGE_HIGHEST
        the highest IOU percentage.
        See Also:
        Constant Field Values
      • IOU_LABEL_HIGHEST_MATCH

        public static final String IOU_LABEL_HIGHEST_MATCH
        whether the labels of the highest IOU match.
        See Also:
        Constant Field Values
      • m_MinIntersectOverUnionRatio

        protected double m_MinIntersectOverUnionRatio
        the minimum IOU ratio to use.
      • m_LabelKey

        protected String m_LabelKey
        the label meta-data key - ignored if empty.
      • m_UseOtherObject

        protected boolean m_UseOtherObject
        whether to use the other object in the output in case of an overlap.
      • m_AdditionalObject

        protected boolean m_AdditionalObject
        whether to check for additional predicted objects not present in actual.
      • m_Geometry

        protected GeometryType m_Geometry
        the geometry to use.
      • m_Fallback

        protected boolean m_Fallback
        whether to fallback on bounding box.
      • m_BoundingBoxFallbackRatio

        protected double m_BoundingBoxFallbackRatio
        the ratio used for determining whether to fall back from polygon on bbox.
    • Constructor Detail

      • IntersectOverUnionRatio

        public IntersectOverUnionRatio()
    • Method Detail

      • setMinIntersectOverUnionRatio

        public void setMinIntersectOverUnionRatio​(double value)
        Sets the minimum IOU ratio to use.
        Parameters:
        value - the minimum ratio
      • getMinIntersectOverUnionRatio

        public double getMinIntersectOverUnionRatio()
        Returns the minimum IOU ratio to use.
        Returns:
        the minimum ratio
      • minIntersectOverUnionRatioTipText

        public String minIntersectOverUnionRatioTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setLabelKey

        public void setLabelKey​(String value)
        Sets the (optional) key for a string label in the meta-data; if supplied the value of the object with the highest overlap gets stored in the report using IOU_LABEL_HIGHEST, IOU_LABEL_HIGHEST_MATCH stores whether the labels match.
        Parameters:
        value - the key, ignored if empty
      • getLabelKey

        public String getLabelKey()
        Returns the (optional) key for a string label in the meta-data; if supplied the value of the object with the highest overlap gets stored in the report using IOU_LABEL_HIGHEST, IOU_LABEL_HIGHEST_MATCH stores whether the labels match.
        Returns:
        the key, ignored if empty
      • labelKeyTipText

        public String labelKeyTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setUseOtherObject

        public void setUseOtherObject​(boolean value)
        Sets whether to use/forward other object data.
        Parameters:
        value - true if to use other object
      • getUseOtherObject

        public boolean getUseOtherObject()
        Returns whether to use/forward other object data.
        Returns:
        true if to use other object
      • useOtherObjectTipText

        public String useOtherObjectTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setAdditionalObject

        public void setAdditionalObject​(boolean value)
        Sets whether to count additional predicted objects.
        Parameters:
        value - true if to count additional predicted objects
      • getAdditionalObject

        public boolean getAdditionalObject()
        Returns whether to count additional predicted objects.
        Returns:
        true if to count additional predicted objects
      • additionalObjectTipText

        public String additionalObjectTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setGeometry

        public void setGeometry​(GeometryType value)
        Sets the geometry type to use for the calculations.
        Parameters:
        value - the type
      • getGeometry

        public GeometryType getGeometry()
        Returns the geometry type to use for the calculations.
        Returns:
        the type
      • geometryTipText

        public String geometryTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setFallback

        public void setFallback​(boolean value)
        Sets whether to fall back on the bounding box if no polygon available.
        Specified by:
        setFallback in interface OptionalBoundingBoxFallbackSupporter
        Parameters:
        value - true if to use
      • setBoundingBoxFallbackRatio

        public void setBoundingBoxFallbackRatio​(double value)
        Sets the ratio between shape area over bbox area. If below the bbox is used instead of the polygon.
        Specified by:
        setBoundingBoxFallbackRatio in interface BoundingBoxFallbackSupporter
        Parameters:
        value - the ratio
      • getBoundingBoxFallbackRatio

        public double getBoundingBoxFallbackRatio()
        Returns the ratio between shape area over bbox area. If below the bbox is used instead of the polygon.
        Specified by:
        getBoundingBoxFallbackRatio in interface BoundingBoxFallbackSupporter
        Returns:
        the ratio
      • calculateIoU

        protected double calculateIoU​(LocatedObject thisObj,
                                      LocatedObject otherObj)
        Calculates the IoU for the two objects.
        Parameters:
        thisObj - first object
        otherObj - second object
        Returns:
        the IoU
      • splitOverlaps

        public com.github.fracpete.javautils.struct.Struct2<LocatedObjects,​LocatedObjects> splitOverlaps​(LocatedObjects overlaps)
        Splits the overlapping objects into subsets of matching labels and mismatching ones.
        Specified by:
        splitOverlaps in interface LabelAwareObjectOverlap
        Parameters:
        overlaps - all overlaps, to split
        Returns:
        split into matching/mismatching subsets