RAPP Platform  v0.6.0
RAPP Platform is a collection of ROS nodes and back-end processes that aim to deliver ready-to-use generic services to robots
 All Classes Namespaces Files Functions Variables Macros
image_classification.ImageClassification Class Reference

Contains the necessary functions for classifying an images and requesting registration to the ontology. More...

Public Member Functions

def __init__
 Initializes Caffe. More...
 
def classifyImage
 Implements the imageClassificationSrv service main function. More...
 
def getImageClass
 Obtains the name of the class of the image from the caffe image classes file. More...
 
def getOntologyClass
 Calls the caffe wrapper service that registers the image to the ontology. More...
 
def registerToOntology
 Calls the caffe wrapper service that registers the image to the ontology. More...
 

Public Attributes

 caffe_root
 
 labels
 
 net
 
 transformer
 

Detailed Description

Contains the necessary functions for classifying an images and requesting registration to the ontology.

Definition at line 46 of file image_classification.py.

Constructor & Destructor Documentation

def image_classification.ImageClassification.__init__ (   self)

Initializes Caffe.

Definition at line 49 of file image_classification.py.

Member Function Documentation

def image_classification.ImageClassification.classifyImage (   self,
  req 
)

Implements the imageClassificationSrv service main function.

Parameters
req[rapp_platform_ros_communications::imageClassificationSrvRequest::Request&] The ROS service request
Returns
res [rapp_platform_ros_communications::imageClassificationSrvResponse::Response&] The ROS service response
Exceptions
ExceptionIndexError
ExceptionIOError
ExceptionAppError
ExceptionKeyError

Definition at line 86 of file image_classification.py.

def image_classification.ImageClassification.getImageClass (   self,
  req 
)

Obtains the name of the class of the image from the caffe image classes file.

Parameters
req[rapp_platform_ros_communications::ontologyClassBridgeSrvRequest::Request&] The ROS service request
Returns
res [string] The class of the image

Definition at line 163 of file image_classification.py.

def image_classification.ImageClassification.getOntologyClass (   self,
  caffeObjectClass 
)

Calls the caffe wrapper service that registers the image to the ontology.

Parameters
caffeObjectClass[string] The caffe object class
Returns
ontologyClassBridgeResponse.ontologyClass [string] The ontology class of the image
Exceptions
ExceptionAppError

Definition at line 124 of file image_classification.py.

def image_classification.ImageClassification.registerToOntology (   self,
  req,
  caffeObjectClass,
  ontologyClass,
  currentImagePath 
)

Calls the caffe wrapper service that registers the image to the ontology.

Parameters
req[rapp_platform_ros_communications::ontologyClassBridgeSrvRequest::Request&] The ROS service request
caffeObjectClass[string] The caffe object class
ontologyClass[string] The ontology object class
currentImagePath[string] The path of the image file
Returns
registerImageToOntologyResponse.object_entry [string] The ontology entry of the image
Exceptions
ExceptionAppError

Definition at line 145 of file image_classification.py.

Member Data Documentation

image_classification.ImageClassification.caffe_root

Definition at line 50 of file image_classification.py.

image_classification.ImageClassification.labels

Definition at line 76 of file image_classification.py.

image_classification.ImageClassification.net

Definition at line 60 of file image_classification.py.

image_classification.ImageClassification.transformer

Definition at line 66 of file image_classification.py.


The documentation for this class was generated from the following file: