Package adams.data.io.output
Class OpexObjectLocationsWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractReportWriter<Report>
-
- adams.data.io.output.OpexObjectLocationsWriter
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,GlobalInfoSupporter,FileFormatHandler,PrettyPrintingSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<AbstractReportWriter>,SizeOfHandler,ReportWriter<Report>,StringReportWriter<Report>,Serializable,Comparable
public class OpexObjectLocationsWriter extends AbstractReportWriter<Report> implements PrettyPrintingSupporter, StringReportWriter<Report>
Writes polygon annotations in VGG Image Annotator JSON format.
For more information, see:
http://www.robots.ox.ac.uk/~vgg/software/via/
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-output <adams.core.io.PlaceholderFile> (property: output) The file to write the report to. default: ${TMP}/out.json-finder <adams.data.objectfinder.ObjectFinder> (property: finder) The object finder to use. default: adams.data.objectfinder.AllFinder
-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]
-label-key <java.lang.String> (property: labelKey) The key in the meta-data containing the label, ignored if empty. default: type
-score-key <java.lang.String> (property: scoreKey) The key in the meta-data containing the sore, ignored if empty. default: score
-meta-prefix <java.lang.String> (property: metaPrefix) The report field prefix used in the report for the meta-data. default: Meta.
-pretty-printing <boolean> (property: prettyPrinting) If enabled, the output is printed in a 'pretty' format. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ObjectFinderm_Finderthe object finder to use.protected Fieldm_IDthe meta-data key with the ID.protected Stringm_LabelKeythe meta-data key with the label.protected Stringm_MetaPrefixthe prefix for the meta-data.protected booleanm_PrettyPrintingwhether to use pretty-printing.protected Stringm_ScoreKeythe meta-data key with the score.protected Fieldm_Timestampthe field with the timestamp.-
Fields inherited from class adams.data.io.output.AbstractReportWriter
m_Output
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description OpexObjectLocationsWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected opex4j.ObjectPredictionsconvert(Report data)Converts the report into OPEX format.voiddefineOptions()Adds options to the internal list of options.StringfinderTipText()Returns the tip text for this property.ObjectFindergetFinder()Returns the finder to use for locating the objects.StringgetFormatDescription()Returns a string describing the format (used in the file chooser).String[]getFormatExtensions()Returns the extension of the format.FieldgetID()Returns the field to use for the ID.StringgetLabelKey()Returns the key in the meta-data containing the label.StringgetMetaPrefix()Returns the field prefix used in the report for the meta-data.booleangetPrettyPrinting()Returns whether pretty-printing is used or not.StringgetScoreKey()Returns the key in the meta-data containing the score.FieldgetTimestamp()Returns the field to use for the timestamp.StringglobalInfo()Returns a string describing the object.StringIDTipText()Returns the tip text for this property.StringlabelKeyTipText()Returns the tip text for this property.StringmetaPrefixTipText()Returns the tip text for this property.StringprettyPrintingTipText()Returns the tip text for this property.StringscoreKeyTipText()Returns the tip text for this property.voidsetFinder(ObjectFinder value)Sets the finder to use for locating the objects.voidsetID(Field value)Sets the field to use for the ID.voidsetLabelKey(String value)Sets the key in the meta-data containing the label.voidsetMetaPrefix(String value)Sets the field prefix used in the report for the meta-data.voidsetPrettyPrinting(boolean value)Sets whether to use pretty-printing or not.voidsetScoreKey(String value)Sets the key in the meta-data containing the score.voidsetTimestamp(Field value)Sets the field to use for the timestamp.StringtimestampTipText()Returns the tip text for this property.Stringwrite(Report data, MessageCollection errors)Performs checks and converts the report to a string.protected booleanwriteData(Report data)Performs the actual writing.-
Methods inherited from class adams.data.io.output.AbstractReportWriter
checkData, cleanUp, compareTo, destroy, equals, forCommandLine, forName, getDefaultFormatExtension, getOutput, getWriters, outputTipText, reset, setOutput, shallowCopy, shallowCopy, write
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.data.io.output.ReportWriter
getOutput, outputTipText, setOutput, write
-
-
-
-
Field Detail
-
m_Finder
protected ObjectFinder m_Finder
the object finder to use.
-
m_Timestamp
protected Field m_Timestamp
the field with the timestamp.
-
m_ID
protected Field m_ID
the meta-data key with the ID.
-
m_LabelKey
protected String m_LabelKey
the meta-data key with the label.
-
m_ScoreKey
protected String m_ScoreKey
the meta-data key with the score.
-
m_MetaPrefix
protected String m_MetaPrefix
the prefix for the meta-data.
-
m_PrettyPrinting
protected boolean m_PrettyPrinting
whether to use pretty-printing.
-
-
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 classAbstractReportWriter<Report>
-
setFinder
public void setFinder(ObjectFinder value)
Sets the finder to use for locating the objects.- Parameters:
value- the finder
-
getFinder
public ObjectFinder getFinder()
Returns the finder to use for locating the objects.- Returns:
- the finder
-
finderTipText
public String finderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
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.
-
setLabelKey
public void setLabelKey(String value)
Sets the key in the meta-data containing the label.- Parameters:
value- the key
-
getLabelKey
public String getLabelKey()
Returns the key in the meta-data containing the label.- Returns:
- the key
-
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.
-
setScoreKey
public void setScoreKey(String value)
Sets the key in the meta-data containing the score.- Parameters:
value- the key
-
getScoreKey
public String getScoreKey()
Returns the key in the meta-data containing the score.- Returns:
- the key
-
scoreKeyTipText
public String scoreKeyTipText()
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.
-
setPrettyPrinting
public void setPrettyPrinting(boolean value)
Sets whether to use pretty-printing or not.- Specified by:
setPrettyPrintingin interfacePrettyPrintingSupporter- Parameters:
value- true if to use pretty-printing
-
getPrettyPrinting
public boolean getPrettyPrinting()
Returns whether pretty-printing is used or not.- Specified by:
getPrettyPrintingin interfacePrettyPrintingSupporter- Returns:
- true if to use pretty-printing
-
prettyPrintingTipText
public String prettyPrintingTipText()
Returns the tip text for this property.- Specified by:
prettyPrintingTipTextin interfacePrettyPrintingSupporter- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescriptionin interfaceFileFormatHandler- Specified by:
getFormatDescriptionin classAbstractReportWriter<Report>- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension of the format.- Specified by:
getFormatExtensionsin interfaceFileFormatHandler- Specified by:
getFormatExtensionsin classAbstractReportWriter<Report>- Returns:
- the extension (without the dot!)
-
convert
protected opex4j.ObjectPredictions convert(Report data)
Converts the report into OPEX format.- Parameters:
data- the report to convert- Returns:
- the generated OPEX data
-
writeData
protected boolean writeData(Report data)
Performs the actual writing.- Specified by:
writeDatain classAbstractReportWriter<Report>- Parameters:
data- the data to write- Returns:
- true if successfully written
-
write
public String write(Report data, MessageCollection errors)
Performs checks and converts the report to a string.- Specified by:
writein interfaceStringReportWriter<Report>- Parameters:
data- the data to writeerrors- for collecting errors- Returns:
- the generated data, null in case of failure
-
-