RAPP Platform API
Main Page
Packages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
FaceDetection.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
FaceDetection
(CloudMsg):
12
""" Face Detection CloudMsg object"""
13
14
class
Request
(CloudRequest):
15
""" Face Detection Cloud Request object. FaceDetection.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
- @ref fast
23
"""
24
25
## File path to the image to load. This is the image to perform
26
# face-detection on.
27
self.
imageFilepath
=
''
28
## If true, detection will take less time but it will be less
29
# accurate
30
self.
fast
=
False
31
# Apply passed keyword arguments to the Request object.
32
super(
FaceDetection.Request
, self).
__init__
(**kwargs)
33
34
35
def
make_payload
(self):
36
""" Create and return the Payload of the Request. """
37
return
Payload(fast=self.
fast
)
38
39
def
make_files
(self):
40
""" Create and return Array of File objects of the Request. """
41
return
[File(self.
imageFilepath
, postfield=
'file'
)]
42
43
44
class
Response
(CloudResponse):
45
""" Face Detection Cloud Response object. FaceDetection.Response """
46
def
__init__
(self, **kwargs):
47
"""!
48
Constructor
49
50
@param **kwargs - Keyword arguments. Apply values to the request attributes.
51
- @ref error
52
- @ref faces
53
"""
54
55
## Error message
56
self.
error
=
''
57
## Detected faces. Array of face objects. TODO create face object.
58
self.
faces
= []
59
## Apply passed keyword arguments to the Request object.
60
super(
FaceDetection.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.fast
69
- @ref Request.imageFilepath
70
"""
71
72
# Create and hold the Request object for this CloudMsg
73
self.
req
=
FaceDetection.Request
()
74
# Create and hold the Response object for this CloudMsg
75
self.
resp
=
FaceDetection.Response
()
76
super(FaceDetection, self).
__init__
(svcname=
'face_detection'
, **kwargs)
77
78
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Request
Definition:
FaceDetection.py:14
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Request.__init__
def __init__
Constructor.
Definition:
FaceDetection.py:16
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Request.fast
fast
If true, detection will take less time but it will be less accurate.
Definition:
FaceDetection.py:30
RappCloud.Objects
Definition:
__init__.py:1
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Response.faces
faces
Detected faces.
Definition:
FaceDetection.py:58
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Request.imageFilepath
imageFilepath
File path to the image to load.
Definition:
FaceDetection.py:27
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Request.make_payload
def make_payload
Definition:
FaceDetection.py:35
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Request.make_files
def make_files
Definition:
FaceDetection.py:39
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Response
Definition:
FaceDetection.py:44
RappCloud.CloudMsgs.FaceDetection.FaceDetection
Definition:
FaceDetection.py:11
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Response.error
error
Error message.
Definition:
FaceDetection.py:56
RappCloud.CloudMsgs.FaceDetection.FaceDetection.req
req
Definition:
FaceDetection.py:73
RappCloud.CloudMsgs.FaceDetection.FaceDetection.__init__
def __init__
Constructor.
Definition:
FaceDetection.py:63
RappCloud.CloudMsgs.FaceDetection.FaceDetection.resp
resp
Definition:
FaceDetection.py:75
RappCloud.CloudMsgs.FaceDetection.FaceDetection.Response.__init__
def __init__
Constructor.
Definition:
FaceDetection.py:46
python
RappCloud
CloudMsgs
FaceDetection.py
Generated on Fri Jul 29 2016 18:45:01 for RAPP Platform API by
1.8.6