Package adams.data.objectoverlap
Class AreaRatio
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,LabelAwareObjectOverlap,ObjectOverlap,Serializable
public class AreaRatio extends AbstractObjectOverlap implements LabelAwareObjectOverlap
Uses the area ratio between the annotated and predicted objects.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_AdditionalObjectwhether to check for additional predicted objects not present in actual.protected booleanm_AverageRatiowhether to use average overlap ratio instead of just this->other.protected Stringm_LabelKeythe label meta-data key - ignored if empty.protected doublem_MinOverlapRatiothe minimum overlap ratio to use.protected booleanm_UseOtherObjectwhether to use the other object in the output in case of an overlap.static StringOVERLAP_COUNTthe overlap count.static StringOVERLAP_LABEL_HIGHESTthe label of the highest overlap.static StringOVERLAP_LABEL_HIGHEST_MATCHwhether the labels of the highest overlap match.static StringOVERLAP_PERCENTAGE_HIGHESTthe highest overlap percentage.-
Fields inherited from class adams.data.objectoverlap.AbstractObjectOverlap
m_CopyMetaData, m_ExcludeIdentical, m_MetaDataKeys
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.data.objectoverlap.ObjectOverlap
ADDITIONAL_OBJ, UNKNOWN_LABEL
-
-
Constructor Summary
Constructors Constructor Description AreaRatio()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringadditionalObjectTipText()Returns the tip text for this property.StringaverageRatioTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected LocatedObjectsdoCalculate(LocatedObjects annotations, LocatedObjects predictions, Map<LocatedObject,Map<LocatedObject,Double>> matches)Computes the overlapping objects between the annotations and the predictions.booleangetAdditionalObject()Returns whether to count additional predicted objects.booleangetAverageRatio()Returns whether to use average overlap ratio instead.StringgetLabelKey()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 usingOVERLAP_LABEL_HIGHEST,OVERLAP_LABEL_HIGHEST_MATCHstores whether the labels match.doublegetMinOverlapRatio()Returns the minimum overlap ratio to use.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.booleangetUseOtherObject()Returns whether to use/forward other object data.StringglobalInfo()Returns a string describing the object.StringlabelKeyTipText()Returns the tip text for this property.StringminOverlapRatioTipText()Returns the tip text for this property.voidsetAdditionalObject(boolean value)Sets whether to count additional predicted objects.voidsetAverageRatio(boolean value)Sets whether to use average overlap ratio instead.voidsetLabelKey(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 usingOVERLAP_LABEL_HIGHEST,OVERLAP_LABEL_HIGHEST_MATCHstores whether the labels match.voidsetMinOverlapRatio(double value)Sets the minimum overlap ratio to use.voidsetUseOtherObject(boolean value)Sets whether to use/forward other object data.com.github.fracpete.javautils.struct.Struct2<LocatedObjects,LocatedObjects>splitOverlaps(LocatedObjects overlaps)Splits the overlapping objects into subsets of matching labels and mismatching ones.StringuseOtherObjectTipText()Returns the tip text for this property.-
Methods inherited from class adams.data.objectoverlap.AbstractObjectOverlap
addMatch, calculate, check, copyMetaData, copyMetaDataTipText, excludeIdenticalTipText, getCopyMetaData, getExcludeIdentical, getMetaDataKeys, initMatch, matches, metaDataKeysTipText, setCopyMetaData, setExcludeIdentical, setMetaDataKeys
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.data.objectoverlap.ObjectOverlap
calculate, matches
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
OVERLAP_PERCENTAGE_HIGHEST
public static final String OVERLAP_PERCENTAGE_HIGHEST
the highest overlap percentage.- See Also:
- Constant Field Values
-
OVERLAP_LABEL_HIGHEST
public static final String OVERLAP_LABEL_HIGHEST
the label of the highest overlap.- See Also:
- Constant Field Values
-
OVERLAP_LABEL_HIGHEST_MATCH
public static final String OVERLAP_LABEL_HIGHEST_MATCH
whether the labels of the highest overlap match.- See Also:
- Constant Field Values
-
OVERLAP_COUNT
public static final String OVERLAP_COUNT
the overlap count.- See Also:
- Constant Field Values
-
m_MinOverlapRatio
protected double m_MinOverlapRatio
the minimum overlap 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_AverageRatio
protected boolean m_AverageRatio
whether to use average overlap ratio instead of just this->other.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractObjectOverlap
-
setMinOverlapRatio
public void setMinOverlapRatio(double value)
Sets the minimum overlap ratio to use.- Parameters:
value- the minimum ratio
-
getMinOverlapRatio
public double getMinOverlapRatio()
Returns the minimum overlap ratio to use.- Returns:
- the minimum ratio
-
minOverlapRatioTipText
public String minOverlapRatioTipText()
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 usingOVERLAP_LABEL_HIGHEST,OVERLAP_LABEL_HIGHEST_MATCHstores 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 usingOVERLAP_LABEL_HIGHEST,OVERLAP_LABEL_HIGHEST_MATCHstores 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.
-
setAverageRatio
public void setAverageRatio(boolean value)
Sets whether to use average overlap ratio instead.- Parameters:
value- true if to use average overlap ratio instead
-
getAverageRatio
public boolean getAverageRatio()
Returns whether to use average overlap ratio instead.- Returns:
- true if to use average overlap ratio instead
-
averageRatioTipText
public String averageRatioTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractObjectOverlap- Returns:
- null if no info available, otherwise short string
-
doCalculate
protected LocatedObjects doCalculate(LocatedObjects annotations, LocatedObjects predictions, Map<LocatedObject,Map<LocatedObject,Double>> matches)
Computes the overlapping objects between the annotations and the predictions.- Specified by:
doCalculatein classAbstractObjectOverlap- Parameters:
annotations- the annotations (ground truth)predictions- the predictions to compare withmatches- for collecting the matches- Returns:
- the overlapping objects
-
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:
splitOverlapsin interfaceLabelAwareObjectOverlap- Parameters:
overlaps- all overlaps, to split- Returns:
- split into matching/mismatching subsets
-
-