Package de.swa.fuh.aws.plugins
Class ClarifaiBasePlugin
java.lang.Object
de.swa.fuh.aws.plugins.ClarifaiBasePlugin
- All Implemented Interfaces:
GMAF_Plugin
public class ClarifaiBasePlugin extends java.lang.Object implements GMAF_Plugin
GMAF Plugin for Clarifai API. Is the basis for the Clarifai API and contains
standard methods for authentication, authorisaton and API Calls.
-
Constructor Summary
Constructors Constructor Description ClarifaiBasePlugin()Initiates Clarifai-Image-Labeler Class. -
Method Summary
Modifier and Type Method Description booleancanProcess(java.lang.String extension)this method returns, if the plugin is able to process files with a given extensionjava.util.Vector<Node>getDetectedNodes()this method is called by the GMAF to receive the results of this plugin and to fuse it into the MMFGbooleanisGeneralPlugin()if this plugin contains overall metadata, e.g.voidprocess(java.net.URL url, java.io.File f, byte[] bytes, MMFG fv)If response of API Call was successful, the data is extracted and added to the MMFG.booleanprovidesRecoursiveData()this method should indicate, if it returns recursive data, which are then re-processed within the GMAF frameworkvoidsetThreshold(float threshold)Sets threshold for confidence: which concepts should be added to the mmfg.
-
Constructor Details
-
ClarifaiBasePlugin
public ClarifaiBasePlugin()Initiates Clarifai-Image-Labeler Class.
-
-
Method Details
-
canProcess
public boolean canProcess(java.lang.String extension)Description copied from interface:GMAF_Pluginthis method returns, if the plugin is able to process files with a given extension- Specified by:
canProcessin interfaceGMAF_Plugin- Returns:
- true or false
-
getDetectedNodes
Description copied from interface:GMAF_Pluginthis method is called by the GMAF to receive the results of this plugin and to fuse it into the MMFG- Specified by:
getDetectedNodesin interfaceGMAF_Plugin- Returns:
- a vector of MMFG nodes
-
isGeneralPlugin
public boolean isGeneralPlugin()Description copied from interface:GMAF_Pluginif this plugin contains overall metadata, e.g. EXIF data, this method should return true to indicate, that these general data have to be attached to the MMFG's root node- Specified by:
isGeneralPluginin interfaceGMAF_Plugin- Returns:
- true, if it is a general plugin
-
process
If response of API Call was successful, the data is extracted and added to the MMFG.- Specified by:
processin interfaceGMAF_Plugin- Parameters:
url- represents the temporary URL of the Multimedia asset to be processf- represents the temporary file of the asset to be processedbytes- contains the file's bytesfv- represents the current MMFG, where the results of this plugin should be fused into
-
providesRecoursiveData
public boolean providesRecoursiveData()Description copied from interface:GMAF_Pluginthis method should indicate, if it returns recursive data, which are then re-processed within the GMAF framework- Specified by:
providesRecoursiveDatain interfaceGMAF_Plugin- Returns:
- true, if recursive data is available
-
setThreshold
public void setThreshold(float threshold)Sets threshold for confidence: which concepts should be added to the mmfg.- Parameters:
threshold- as float in decimal, e.g. 0.5f (also default value).
-