RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
ObjectRecognitionCaffe.py
Go to the documentation of this file.
1 from RappCloud.Objects import (
2  File,
3  Payload)
4 
5 from Cloud import (
6  CloudMsg,
7  CloudRequest,
8  CloudResponse)
9 
10 
11 class ObjectRecognitionCaffe(CloudMsg):
12  """ Object Recognition Cloud Message object"""
13 
14  class Request(CloudRequest):
15  """ Object Recognition (Caffe) Cloud Request object.
16 
17  ObjectRecognitionCaffe.Request
18  """
19  def __init__(self, **kwargs):
20  """!
21  Constructor
22 
23  @param **kwargs - Keyword arguments. Apply values to the request attributes.
24  - @ref imageFilepath
25  """
26  ## File path to the image to load. This is the image to perform
27  # qr-detection on.
28  self.imageFilepath = ''
29  super(ObjectRecognitionCaffe.Request, self).__init__(**kwargs)
30 
31 
32  def make_payload(self):
33  """ Create and return the Payload of the Request. """
34  return Payload()
35 
36 
37  def make_files(self):
38  """ Create and return Array of File objects of the Request. """
39  return [File(self.imageFilepath, postfield='file')]
40 
41 
42  class Response(CloudResponse):
43  """ Object Recognition (Caffe) Cloud Response object.
44 
45  ObjectRecognitionCaffe.Response
46  """
47  def __init__(self, **kwargs):
48  """!
49  Constructor
50 
51  @param **kwargs - Keyword arguments. Apply values to the request attributes.
52  - @ref error
53  - @ref object_class
54  """
55 
56  ## Error message
57  self.error = ''
58  ## Recognized object class.
59  self.object_class = ''
60  super(ObjectRecognitionCaffe.Response, self).__init__(**kwargs)
61 
62 
63  def __init__(self, **kwargs):
64  """!
65  Constructor
66 
67  @param **kwargs - Keyword arguments. Apply values to the request attributes.
68  - @ref Request.imageFilepath
69  """
70 
71  # Create and hold the Request object for this CloudMsg
73  # Create and hold the Response object for this CloudMsg
75  super(ObjectRecognitionCaffe, self).__init__(
76  svcname='object_recognition_caffe', **kwargs)
77 
78