RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
HumanDetection.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 HumanDetection(CloudMsg):
12  """ Human Detection Cloud Message object"""
13 
14  class Request(CloudRequest):
15  """ Human Detection Cloud Request object. HumanDetection.Request """
16  def __init__(self, **kwargs):
17  """!
18  Constructor
19 
20  @param **kwargs - Keyword arguments. Apply values to the request attributes.
21  - @ref imageFilepath
22  """
23  ## File path to the image to load. This is the image to perform
24  # qr-detection on.
25  self.imageFilepath = ''
26  super(HumanDetection.Request, self).__init__(**kwargs)
27 
28 
29  def make_payload(self):
30  """ Create and return the Payload of the Request. """
31  return Payload()
32 
33 
34  def make_files(self):
35  """ Create and return Array of File objects of the Request. """
36  return [File(self.imageFilepath, postfield='file')]
37 
38 
39  class Response(CloudResponse):
40  """ Human Detection Cloud Response object. HumanDetection.Response """
41  def __init__(self, **kwargs):
42  """!
43  Constructor
44 
45  @param **kwargs - Keyword arguments. Apply values to the request attributes.
46  - @ref error
47  - @ref humans
48  """
49 
50  ## Error message
51  self.error = ''
52  ## Array of detected humans
53  # TODO Create human objects
54  self.humans = []
55  super(HumanDetection.Response, self).__init__(**kwargs)
56 
57 
58  def __init__(self, **kwargs):
59  """!
60  Constructor
61 
62  @param **kwargs - Keyword arguments. Apply values to the request attributes.
63  - @ref Request.imageFilepath
64  """
65 
66  # Create and hold the Request object for this CloudMsg
68  # Create and hold the Response object for this CloudMsg
70  super(HumanDetection, self).__init__(svcname='human_detection', **kwargs)
71 
72 
humans
Array of detected humans TODO Create human objects.