Class: Google::Apis::VisionV1::SafeSearchAnnotation

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/vision_v1/classes.rb,
generated/google/apis/vision_v1/representations.rb,
generated/google/apis/vision_v1/representations.rb

Overview

Set of features pertaining to the image, computed by computer vision methods over safe-search verticals (for example, adult, spoof, medical, violence).

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ SafeSearchAnnotation

Returns a new instance of SafeSearchAnnotation



12608
12609
12610
# File 'generated/google/apis/vision_v1/classes.rb', line 12608

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#adultString

Represents the adult content likelihood for the image. Adult content may contain elements such as nudity, pornographic images or cartoons, or sexual activities. Corresponds to the JSON property adult

Returns:

  • (String)


12545
12546
12547
# File 'generated/google/apis/vision_v1/classes.rb', line 12545

def adult
  @adult
end

#adult_confidenceFloat

Confidence of adult_score. Range [0, 1]. 0 means not confident, 1 means very confident. Corresponds to the JSON property adultConfidence

Returns:

  • (Float)


12551
12552
12553
# File 'generated/google/apis/vision_v1/classes.rb', line 12551

def adult_confidence
  @adult_confidence
end

#medicalString

Likelihood that this is a medical image. Corresponds to the JSON property medical

Returns:

  • (String)


12556
12557
12558
# File 'generated/google/apis/vision_v1/classes.rb', line 12556

def medical
  @medical
end

#medical_confidenceFloat

Confidence of medical_score. Range [0, 1]. 0 means not confident, 1 means very confident. Corresponds to the JSON property medicalConfidence

Returns:

  • (Float)


12562
12563
12564
# File 'generated/google/apis/vision_v1/classes.rb', line 12562

def medical_confidence
  @medical_confidence
end

#nsfw_confidenceFloat

Confidence of nsfw_score. Range [0, 1]. 0 means not confident, 1 means very confident. Corresponds to the JSON property nsfwConfidence

Returns:

  • (Float)


12568
12569
12570
# File 'generated/google/apis/vision_v1/classes.rb', line 12568

def nsfw_confidence
  @nsfw_confidence
end

#racyString

Likelihood that the request image contains racy content. Racy content may include (but is not limited to) skimpy or sheer clothing, strategically covered nudity, lewd or provocative poses, or close-ups of sensitive body areas. Corresponds to the JSON property racy

Returns:

  • (String)


12576
12577
12578
# File 'generated/google/apis/vision_v1/classes.rb', line 12576

def racy
  @racy
end

#racy_confidenceFloat

Confidence of racy_score. Range [0, 1]. 0 means not confident, 1 means very confident. Corresponds to the JSON property racyConfidence

Returns:

  • (Float)


12582
12583
12584
# File 'generated/google/apis/vision_v1/classes.rb', line 12582

def racy_confidence
  @racy_confidence
end

#spoofString

Spoof likelihood. The likelihood that an modification was made to the image's canonical version to make it appear funny or offensive. Corresponds to the JSON property spoof

Returns:

  • (String)


12589
12590
12591
# File 'generated/google/apis/vision_v1/classes.rb', line 12589

def spoof
  @spoof
end

#spoof_confidenceFloat

Confidence of spoof_score. Range [0, 1]. 0 means not confident, 1 means very confident. Corresponds to the JSON property spoofConfidence

Returns:

  • (Float)


12595
12596
12597
# File 'generated/google/apis/vision_v1/classes.rb', line 12595

def spoof_confidence
  @spoof_confidence
end

#violenceString

Likelihood that this image contains violent content. Corresponds to the JSON property violence

Returns:

  • (String)


12600
12601
12602
# File 'generated/google/apis/vision_v1/classes.rb', line 12600

def violence
  @violence
end

#violence_confidenceFloat

Confidence of violence_score. Range [0, 1]. 0 means not confident, 1 means very confident. Corresponds to the JSON property violenceConfidence

Returns:

  • (Float)


12606
12607
12608
# File 'generated/google/apis/vision_v1/classes.rb', line 12606

def violence_confidence
  @violence_confidence
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
# File 'generated/google/apis/vision_v1/classes.rb', line 12613

def update!(**args)
  @adult = args[:adult] if args.key?(:adult)
  @adult_confidence = args[:adult_confidence] if args.key?(:adult_confidence)
  @medical = args[:medical] if args.key?(:medical)
  @medical_confidence = args[:medical_confidence] if args.key?(:medical_confidence)
  @nsfw_confidence = args[:nsfw_confidence] if args.key?(:nsfw_confidence)
  @racy = args[:racy] if args.key?(:racy)
  @racy_confidence = args[:racy_confidence] if args.key?(:racy_confidence)
  @spoof = args[:spoof] if args.key?(:spoof)
  @spoof_confidence = args[:spoof_confidence] if args.key?(:spoof_confidence)
  @violence = args[:violence] if args.key?(:violence)
  @violence_confidence = args[:violence_confidence] if args.key?(:violence_confidence)
end