Class: Google::Cloud::Vision::Annotation::SafeSearch
- Inherits:
-
Object
- Object
- Google::Cloud::Vision::Annotation::SafeSearch
- Defined in:
- lib/google/cloud/vision/annotation/safe_search.rb
Overview
SafeSearch
A set of features pertaining to the image, computed by various computer vision methods over safe-search verticals (for example, adult, spoof, medical, violence).
Constant Summary collapse
- POSITIVE_RATINGS =
%w(POSSIBLE LIKELY VERY_LIKELY)
Instance Method Summary collapse
-
#adult ⇒ Object
Adult likelihood rating.
-
#adult? ⇒ Boolean
Adult likelihood.
-
#medical ⇒ Object
Medical likelihood rating.
-
#medical? ⇒ Boolean
Medical likelihood.
-
#spoof ⇒ Object
Spoof likelihood rating.
-
#spoof? ⇒ Boolean
Spoof likelihood.
-
#to_h ⇒ Hash
Converts object to a hash.
-
#violence ⇒ Object
Violence likelihood rating.
-
#violence? ⇒ Boolean
Violence likelihood.
Instance Method Details
#adult ⇒ Object
Adult likelihood rating. Possible values are VERY_UNLIKELY
,
UNLIKELY
, POSSIBLE
, LIKELY
, and VERY_LIKELY
.
57 58 59 |
# File 'lib/google/cloud/vision/annotation/safe_search.rb', line 57 def adult @gapi.adult end |
#adult? ⇒ Boolean
Adult likelihood. Returns true
if #adult is POSSIBLE
,
LIKELY
, or VERY_LIKELY
.
67 68 69 |
# File 'lib/google/cloud/vision/annotation/safe_search.rb', line 67 def adult? POSITIVE_RATINGS.include? adult end |
#medical ⇒ Object
Medical likelihood rating. Possible values are VERY_UNLIKELY
,
UNLIKELY
, POSSIBLE
, LIKELY
, and VERY_LIKELY
.
91 92 93 |
# File 'lib/google/cloud/vision/annotation/safe_search.rb', line 91 def medical @gapi.medical end |
#medical? ⇒ Boolean
Medical likelihood. Returns true
if #medical is POSSIBLE
,
LIKELY
, or VERY_LIKELY
.
101 102 103 |
# File 'lib/google/cloud/vision/annotation/safe_search.rb', line 101 def medical? POSITIVE_RATINGS.include? medical end |
#spoof ⇒ Object
Spoof likelihood rating. Possible values are VERY_UNLIKELY
,
UNLIKELY
, POSSIBLE
, LIKELY
, and VERY_LIKELY
.
74 75 76 |
# File 'lib/google/cloud/vision/annotation/safe_search.rb', line 74 def spoof @gapi.spoof end |
#spoof? ⇒ Boolean
Spoof likelihood. Returns true
if #spoof is POSSIBLE
,
LIKELY
, or VERY_LIKELY
.
84 85 86 |
# File 'lib/google/cloud/vision/annotation/safe_search.rb', line 84 def spoof? POSITIVE_RATINGS.include? spoof end |
#to_h ⇒ Hash
Converts object to a hash. All keys will be symbolized.
127 128 129 130 |
# File 'lib/google/cloud/vision/annotation/safe_search.rb', line 127 def to_h { adult: adult?, spoof: spoof?, medical: medical?, violence: violence? } end |
#violence ⇒ Object
Violence likelihood rating. Possible values are VERY_UNLIKELY
,
UNLIKELY
, POSSIBLE
, LIKELY
, and VERY_LIKELY
.
108 109 110 |
# File 'lib/google/cloud/vision/annotation/safe_search.rb', line 108 def violence @gapi.violence end |
#violence? ⇒ Boolean
Violence likelihood. Returns true
if #violence is POSSIBLE
,
LIKELY
, or VERY_LIKELY
.
118 119 120 |
# File 'lib/google/cloud/vision/annotation/safe_search.rb', line 118 def violence? POSITIVE_RATINGS.include? violence end |