Class PascalVOCObjectLocationsReader

  • All Implemented Interfaces:
    CleanUpHandler, Destroyable, GlobalInfoSupporter, FileFormatHandler, LoggingLevelHandler, LoggingSupporter, OptionHandler, ShallowCopySupporter<AbstractReportReader>, SizeOfHandler, Stoppable, StoppableWithFeedback, ReportReader<Report>, ObjectPrefixHandler, Serializable, Comparable

    public class PascalVOCObjectLocationsReader
    extends AbstractReportReader<Report>
    implements ObjectPrefixHandler
    Reads object locations in Pascal VOC format.

    See more:
    https://github.com/WaikatoLink2020/objdet-predictions-exchange-format

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -input <adams.core.io.PlaceholderFile> (property: input)
        The file to read and turn into a report.
        default: ${CWD}
     
    -id <adams.data.report.Field> (property: ID)
        The field to use for storing the ID.
        default: ID[S]
     
    -timestamp <adams.data.report.Field> (property: timestamp)
        The field to use for storing the timestamp.
        default: Timestamp[S]
     
    -prefix <java.lang.String> (property: prefix)
        The report field prefix used in the report for the objects.
        default: Object.
     
    -label-suffix <java.lang.String> (property: labelSuffix)
        The suffix to use in the report for labels.
        default: type
     
    -meta-prefix <java.lang.String> (property: metaPrefix)
        The report field prefix used in the report for the meta-data.
        default: Meta.
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_ID

        protected Field m_ID
        the field to use for the ID.
      • m_Timestamp

        protected Field m_Timestamp
        the field to use for the timestamp.
      • m_Prefix

        protected String m_Prefix
        the prefix to use for objects.
      • m_LabelSuffix

        protected String m_LabelSuffix
        the label suffix to use.
      • m_MetaPrefix

        protected String m_MetaPrefix
        the prefix for the meta-data.
    • Constructor Detail

      • PascalVOCObjectLocationsReader

        public PascalVOCObjectLocationsReader()
    • Method Detail

      • setID

        public void setID​(Field value)
        Sets the field to use for the ID.
        Parameters:
        value - the field
      • getID

        public Field getID()
        Returns the field to use for the ID.
        Returns:
        the field
      • IDTipText

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

        public void setTimestamp​(Field value)
        Sets the field to use for the timestamp.
        Parameters:
        value - the field
      • getTimestamp

        public Field getTimestamp()
        Returns the field to use for the timestamp.
        Returns:
        the field
      • timestampTipText

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

        public void setPrefix​(String value)
        Sets the field prefix used in the report for the objects.
        Specified by:
        setPrefix in interface ObjectPrefixHandler
        Parameters:
        value - the field prefix
      • getPrefix

        public String getPrefix()
        Returns the field prefix used in the report for the objects.
        Specified by:
        getPrefix in interface ObjectPrefixHandler
        Returns:
        the field prefix
      • prefixTipText

        public String prefixTipText()
        Returns the tip text for this property.
        Specified by:
        prefixTipText in interface ObjectPrefixHandler
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setLabelSuffix

        public void setLabelSuffix​(String value)
        Sets the field suffix used in the report for labels.
        Parameters:
        value - the field suffix
      • getLabelSuffix

        public String getLabelSuffix()
        Returns the field suffix used in the report for labels.
        Returns:
        the field suffix
      • labelSuffixTipText

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

        public void setMetaPrefix​(String value)
        Sets the field prefix used in the report for the meta-data.
        Parameters:
        value - the field prefix
      • getMetaPrefix

        public String getMetaPrefix()
        Returns the field prefix used in the report for the meta-data.
        Returns:
        the field prefix
      • metaPrefixTipText

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

        protected int determineParentID​(Report report)
        Tries to determine the parent ID for the current report.
        Specified by:
        determineParentID in class AbstractReportReader<Report>
        Parameters:
        report - the report to determine the ID for
        Returns:
        the parent database ID, -1 if it cannot be determined
      • getNode

        protected Element getNode​(Document dom,
                                  String tag)
        Returns the (first) node.
        Parameters:
        dom - the document to look for tag (picks first)
        tag - the tag name
        Returns:
        the node, null if not found
      • getNodeText

        protected String getNodeText​(Document dom,
                                     String tag)
        Returns the node's text.
        Parameters:
        dom - the document to look for tag (picks first)
        tag - the tag name
        Returns:
        the text, null if not found
      • getSubNode

        protected Element getSubNode​(Element parent,
                                     String tag)
        Returns the node from the specified sub-node.
        Parameters:
        parent - the node to start from
        tag - the sub-node tag to look for
        Returns:
        the sub-node, null if not found
      • getSubNodeText

        protected String getSubNodeText​(Element parent,
                                        String tag)
        Returns the node text from the specified sub-node.
        Parameters:
        parent - the node to start from
        tag - the sub-node tag to look for
        Returns:
        the text, null if not found
      • addString

        protected boolean addString​(Report report,
                                    String name,
                                    String value)
        Adds the string value to the report.
        Parameters:
        report - the report to update
        name - the name of the field
        value - the string value
        Returns:
        whether successfully added
      • addNumeric

        protected boolean addNumeric​(Report report,
                                     String name,
                                     String value)
        Adds the numeric value to the report.
        Parameters:
        report - the report to update
        name - the name of the field
        value - the numeric value
        Returns:
        whether successfully added
      • addBoolean

        protected boolean addBoolean​(Report report,
                                     String name,
                                     Boolean value)
        Adds the boolean value to the report.
        Parameters:
        report - the report to update
        name - the name of the field
        value - the numeric value
        Returns:
        whether successfully added