// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/automl/v1beta1/detection.proto

package com.google.cloud.automl.v1beta1;

/**
 *
 *
 * <pre>
 * Bounding box matching model metrics for a single intersection-over-union
 * threshold and multiple label match confidence thresholds.
 * </pre>
 *
 * Protobuf type {@code google.cloud.automl.v1beta1.BoundingBoxMetricsEntry}
 */
public final class BoundingBoxMetricsEntry extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry)
    BoundingBoxMetricsEntryOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use BoundingBoxMetricsEntry.newBuilder() to construct.
  private BoundingBoxMetricsEntry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private BoundingBoxMetricsEntry() {
    confidenceMetricsEntries_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private BoundingBoxMetricsEntry(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 13:
            {
              iouThreshold_ = input.readFloat();
              break;
            }
          case 21:
            {
              meanAveragePrecision_ = input.readFloat();
              break;
            }
          case 26:
            {
              if (!((mutable_bitField0_ & 0x00000004) != 0)) {
                confidenceMetricsEntries_ =
                    new java.util.ArrayList<
                        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry
                            .ConfidenceMetricsEntry>();
                mutable_bitField0_ |= 0x00000004;
              }
              confidenceMetricsEntries_.add(
                  input.readMessage(
                      com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
                          .parser(),
                      extensionRegistry));
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000004) != 0)) {
        confidenceMetricsEntries_ =
            java.util.Collections.unmodifiableList(confidenceMetricsEntries_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.automl.v1beta1.Detection
        .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.automl.v1beta1.Detection
        .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.class,
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.Builder.class);
  }

  public interface ConfidenceMetricsEntryOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Output only. The confidence threshold value used to compute the metrics.
     * </pre>
     *
     * <code>float confidence_threshold = 1;</code>
     */
    float getConfidenceThreshold();

    /**
     *
     *
     * <pre>
     * Output only. Recall under the given confidence threshold.
     * </pre>
     *
     * <code>float recall = 2;</code>
     */
    float getRecall();

    /**
     *
     *
     * <pre>
     * Output only. Precision under the given confidence threshold.
     * </pre>
     *
     * <code>float precision = 3;</code>
     */
    float getPrecision();

    /**
     *
     *
     * <pre>
     * Output only. The harmonic mean of recall and precision.
     * </pre>
     *
     * <code>float f1_score = 4;</code>
     */
    float getF1Score();
  }
  /**
   *
   *
   * <pre>
   * Metrics for a single confidence threshold.
   * </pre>
   *
   * Protobuf type {@code
   * google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry}
   */
  public static final class ConfidenceMetricsEntry extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry)
      ConfidenceMetricsEntryOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use ConfidenceMetricsEntry.newBuilder() to construct.
    private ConfidenceMetricsEntry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private ConfidenceMetricsEntry() {}

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    private ConfidenceMetricsEntry(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 13:
              {
                confidenceThreshold_ = input.readFloat();
                break;
              }
            case 21:
              {
                recall_ = input.readFloat();
                break;
              }
            case 29:
              {
                precision_ = input.readFloat();
                break;
              }
            case 37:
              {
                f1Score_ = input.readFloat();
                break;
              }
            default:
              {
                if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                break;
              }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.automl.v1beta1.Detection
          .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.automl.v1beta1.Detection
          .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.class,
              com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder
                  .class);
    }

    public static final int CONFIDENCE_THRESHOLD_FIELD_NUMBER = 1;
    private float confidenceThreshold_;
    /**
     *
     *
     * <pre>
     * Output only. The confidence threshold value used to compute the metrics.
     * </pre>
     *
     * <code>float confidence_threshold = 1;</code>
     */
    public float getConfidenceThreshold() {
      return confidenceThreshold_;
    }

    public static final int RECALL_FIELD_NUMBER = 2;
    private float recall_;
    /**
     *
     *
     * <pre>
     * Output only. Recall under the given confidence threshold.
     * </pre>
     *
     * <code>float recall = 2;</code>
     */
    public float getRecall() {
      return recall_;
    }

    public static final int PRECISION_FIELD_NUMBER = 3;
    private float precision_;
    /**
     *
     *
     * <pre>
     * Output only. Precision under the given confidence threshold.
     * </pre>
     *
     * <code>float precision = 3;</code>
     */
    public float getPrecision() {
      return precision_;
    }

    public static final int F1_SCORE_FIELD_NUMBER = 4;
    private float f1Score_;
    /**
     *
     *
     * <pre>
     * Output only. The harmonic mean of recall and precision.
     * </pre>
     *
     * <code>float f1_score = 4;</code>
     */
    public float getF1Score() {
      return f1Score_;
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (confidenceThreshold_ != 0F) {
        output.writeFloat(1, confidenceThreshold_);
      }
      if (recall_ != 0F) {
        output.writeFloat(2, recall_);
      }
      if (precision_ != 0F) {
        output.writeFloat(3, precision_);
      }
      if (f1Score_ != 0F) {
        output.writeFloat(4, f1Score_);
      }
      unknownFields.writeTo(output);
    }

    @java.lang.Override
    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (confidenceThreshold_ != 0F) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, confidenceThreshold_);
      }
      if (recall_ != 0F) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, recall_);
      }
      if (precision_ != 0F) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, precision_);
      }
      if (f1Score_ != 0F) {
        size += com.google.protobuf.CodedOutputStream.computeFloatSize(4, f1Score_);
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
        return true;
      }
      if (!(obj
          instanceof
          com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry)) {
        return super.equals(obj);
      }
      com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry other =
          (com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) obj;

      if (java.lang.Float.floatToIntBits(getConfidenceThreshold())
          != java.lang.Float.floatToIntBits(other.getConfidenceThreshold())) return false;
      if (java.lang.Float.floatToIntBits(getRecall())
          != java.lang.Float.floatToIntBits(other.getRecall())) return false;
      if (java.lang.Float.floatToIntBits(getPrecision())
          != java.lang.Float.floatToIntBits(other.getPrecision())) return false;
      if (java.lang.Float.floatToIntBits(getF1Score())
          != java.lang.Float.floatToIntBits(other.getF1Score())) return false;
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + CONFIDENCE_THRESHOLD_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidenceThreshold());
      hash = (37 * hash) + RECALL_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getRecall());
      hash = (37 * hash) + PRECISION_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getPrecision());
      hash = (37 * hash) + F1_SCORE_FIELD_NUMBER;
      hash = (53 * hash) + java.lang.Float.floatToIntBits(getF1Score());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(
            java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(
            com.google.protobuf.ByteString data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseDelimitedFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
          PARSER, input, extensionRegistry);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        parseFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     *
     *
     * <pre>
     * Metrics for a single confidence threshold.
     * </pre>
     *
     * Protobuf type {@code
     * google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry)
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.automl.v1beta1.Detection
            .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.cloud.automl.v1beta1.Detection
            .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
                    .class,
                com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
                    .Builder.class);
      }

      // Construct using
      // com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }

      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        confidenceThreshold_ = 0F;

        recall_ = 0F;

        precision_ = 0F;

        f1Score_ = 0F;

        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.cloud.automl.v1beta1.Detection
            .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_ConfidenceMetricsEntry_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
          getDefaultInstanceForType() {
        return com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
          build() {
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
          buildPartial() {
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry result =
            new com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry(
                this);
        result.confidenceThreshold_ = confidenceThreshold_;
        result.recall_ = recall_;
        result.precision_ = precision_;
        result.f1Score_ = f1Score_;
        onBuilt();
        return result;
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other
            instanceof
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry) {
          return mergeFrom(
              (com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry)
                  other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry other) {
        if (other
            == com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
                .getDefaultInstance()) return this;
        if (other.getConfidenceThreshold() != 0F) {
          setConfidenceThreshold(other.getConfidenceThreshold());
        }
        if (other.getRecall() != 0F) {
          setRecall(other.getRecall());
        }
        if (other.getPrecision() != 0F) {
          setPrecision(other.getPrecision());
        }
        if (other.getF1Score() != 0F) {
          setF1Score(other.getF1Score());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

      @java.lang.Override
      public final boolean isInitialized() {
        return true;
      }

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
            parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage =
              (com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry)
                  e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private float confidenceThreshold_;
      /**
       *
       *
       * <pre>
       * Output only. The confidence threshold value used to compute the metrics.
       * </pre>
       *
       * <code>float confidence_threshold = 1;</code>
       */
      public float getConfidenceThreshold() {
        return confidenceThreshold_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The confidence threshold value used to compute the metrics.
       * </pre>
       *
       * <code>float confidence_threshold = 1;</code>
       */
      public Builder setConfidenceThreshold(float value) {

        confidenceThreshold_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The confidence threshold value used to compute the metrics.
       * </pre>
       *
       * <code>float confidence_threshold = 1;</code>
       */
      public Builder clearConfidenceThreshold() {

        confidenceThreshold_ = 0F;
        onChanged();
        return this;
      }

      private float recall_;
      /**
       *
       *
       * <pre>
       * Output only. Recall under the given confidence threshold.
       * </pre>
       *
       * <code>float recall = 2;</code>
       */
      public float getRecall() {
        return recall_;
      }
      /**
       *
       *
       * <pre>
       * Output only. Recall under the given confidence threshold.
       * </pre>
       *
       * <code>float recall = 2;</code>
       */
      public Builder setRecall(float value) {

        recall_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Recall under the given confidence threshold.
       * </pre>
       *
       * <code>float recall = 2;</code>
       */
      public Builder clearRecall() {

        recall_ = 0F;
        onChanged();
        return this;
      }

      private float precision_;
      /**
       *
       *
       * <pre>
       * Output only. Precision under the given confidence threshold.
       * </pre>
       *
       * <code>float precision = 3;</code>
       */
      public float getPrecision() {
        return precision_;
      }
      /**
       *
       *
       * <pre>
       * Output only. Precision under the given confidence threshold.
       * </pre>
       *
       * <code>float precision = 3;</code>
       */
      public Builder setPrecision(float value) {

        precision_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. Precision under the given confidence threshold.
       * </pre>
       *
       * <code>float precision = 3;</code>
       */
      public Builder clearPrecision() {

        precision_ = 0F;
        onChanged();
        return this;
      }

      private float f1Score_;
      /**
       *
       *
       * <pre>
       * Output only. The harmonic mean of recall and precision.
       * </pre>
       *
       * <code>float f1_score = 4;</code>
       */
      public float getF1Score() {
        return f1Score_;
      }
      /**
       *
       *
       * <pre>
       * Output only. The harmonic mean of recall and precision.
       * </pre>
       *
       * <code>float f1_score = 4;</code>
       */
      public Builder setF1Score(float value) {

        f1Score_ = value;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Output only. The harmonic mean of recall and precision.
       * </pre>
       *
       * <code>float f1_score = 4;</code>
       */
      public Builder clearF1Score() {

        f1Score_ = 0F;
        onChanged();
        return this;
      }

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }

      // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry)
    private static final com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry
            .ConfidenceMetricsEntry
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry();
    }

    public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ConfidenceMetricsEntry> PARSER =
        new com.google.protobuf.AbstractParser<ConfidenceMetricsEntry>() {
          @java.lang.Override
          public ConfidenceMetricsEntry parsePartialFrom(
              com.google.protobuf.CodedInputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
            return new ConfidenceMetricsEntry(input, extensionRegistry);
          }
        };

    public static com.google.protobuf.Parser<ConfidenceMetricsEntry> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<ConfidenceMetricsEntry> getParserForType() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  private int bitField0_;
  public static final int IOU_THRESHOLD_FIELD_NUMBER = 1;
  private float iouThreshold_;
  /**
   *
   *
   * <pre>
   * Output only. The intersection-over-union threshold value used to compute
   * this metrics entry.
   * </pre>
   *
   * <code>float iou_threshold = 1;</code>
   */
  public float getIouThreshold() {
    return iouThreshold_;
  }

  public static final int MEAN_AVERAGE_PRECISION_FIELD_NUMBER = 2;
  private float meanAveragePrecision_;
  /**
   *
   *
   * <pre>
   * Output only. The mean average precision, most often close to au_prc.
   * </pre>
   *
   * <code>float mean_average_precision = 2;</code>
   */
  public float getMeanAveragePrecision() {
    return meanAveragePrecision_;
  }

  public static final int CONFIDENCE_METRICS_ENTRIES_FIELD_NUMBER = 3;
  private java.util.List<
          com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry>
      confidenceMetricsEntries_;
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each label-match confidence_threshold from
   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
   * derived from them.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
   * </code>
   */
  public java.util.List<
          com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry>
      getConfidenceMetricsEntriesList() {
    return confidenceMetricsEntries_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each label-match confidence_threshold from
   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
   * derived from them.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
   * </code>
   */
  public java.util.List<
          ? extends
              com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry
                  .ConfidenceMetricsEntryOrBuilder>
      getConfidenceMetricsEntriesOrBuilderList() {
    return confidenceMetricsEntries_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each label-match confidence_threshold from
   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
   * derived from them.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
   * </code>
   */
  public int getConfidenceMetricsEntriesCount() {
    return confidenceMetricsEntries_.size();
  }
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each label-match confidence_threshold from
   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
   * derived from them.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
   * </code>
   */
  public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
      getConfidenceMetricsEntries(int index) {
    return confidenceMetricsEntries_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Output only. Metrics for each label-match confidence_threshold from
   * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
   * derived from them.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
   * </code>
   */
  public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder
      getConfidenceMetricsEntriesOrBuilder(int index) {
    return confidenceMetricsEntries_.get(index);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (iouThreshold_ != 0F) {
      output.writeFloat(1, iouThreshold_);
    }
    if (meanAveragePrecision_ != 0F) {
      output.writeFloat(2, meanAveragePrecision_);
    }
    for (int i = 0; i < confidenceMetricsEntries_.size(); i++) {
      output.writeMessage(3, confidenceMetricsEntries_.get(i));
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (iouThreshold_ != 0F) {
      size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, iouThreshold_);
    }
    if (meanAveragePrecision_ != 0F) {
      size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, meanAveragePrecision_);
    }
    for (int i = 0; i < confidenceMetricsEntries_.size(); i++) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              3, confidenceMetricsEntries_.get(i));
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry)) {
      return super.equals(obj);
    }
    com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry other =
        (com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry) obj;

    if (java.lang.Float.floatToIntBits(getIouThreshold())
        != java.lang.Float.floatToIntBits(other.getIouThreshold())) return false;
    if (java.lang.Float.floatToIntBits(getMeanAveragePrecision())
        != java.lang.Float.floatToIntBits(other.getMeanAveragePrecision())) return false;
    if (!getConfidenceMetricsEntriesList().equals(other.getConfidenceMetricsEntriesList()))
      return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + IOU_THRESHOLD_FIELD_NUMBER;
    hash = (53 * hash) + java.lang.Float.floatToIntBits(getIouThreshold());
    hash = (37 * hash) + MEAN_AVERAGE_PRECISION_FIELD_NUMBER;
    hash = (53 * hash) + java.lang.Float.floatToIntBits(getMeanAveragePrecision());
    if (getConfidenceMetricsEntriesCount() > 0) {
      hash = (37 * hash) + CONFIDENCE_METRICS_ENTRIES_FIELD_NUMBER;
      hash = (53 * hash) + getConfidenceMetricsEntriesList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(
      com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Bounding box matching model metrics for a single intersection-over-union
   * threshold and multiple label match confidence thresholds.
   * </pre>
   *
   * Protobuf type {@code google.cloud.automl.v1beta1.BoundingBoxMetricsEntry}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry)
      com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntryOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.automl.v1beta1.Detection
          .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.automl.v1beta1.Detection
          .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.class,
              com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.Builder.class);
    }

    // Construct using com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getConfidenceMetricsEntriesFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      iouThreshold_ = 0F;

      meanAveragePrecision_ = 0F;

      if (confidenceMetricsEntriesBuilder_ == null) {
        confidenceMetricsEntries_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
      } else {
        confidenceMetricsEntriesBuilder_.clear();
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.automl.v1beta1.Detection
          .internal_static_google_cloud_automl_v1beta1_BoundingBoxMetricsEntry_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry getDefaultInstanceForType() {
      return com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry build() {
      com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry buildPartial() {
      com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry result =
          new com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.iouThreshold_ = iouThreshold_;
      result.meanAveragePrecision_ = meanAveragePrecision_;
      if (confidenceMetricsEntriesBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)) {
          confidenceMetricsEntries_ =
              java.util.Collections.unmodifiableList(confidenceMetricsEntries_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.confidenceMetricsEntries_ = confidenceMetricsEntries_;
      } else {
        result.confidenceMetricsEntries_ = confidenceMetricsEntriesBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry) {
        return mergeFrom((com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry other) {
      if (other == com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.getDefaultInstance())
        return this;
      if (other.getIouThreshold() != 0F) {
        setIouThreshold(other.getIouThreshold());
      }
      if (other.getMeanAveragePrecision() != 0F) {
        setMeanAveragePrecision(other.getMeanAveragePrecision());
      }
      if (confidenceMetricsEntriesBuilder_ == null) {
        if (!other.confidenceMetricsEntries_.isEmpty()) {
          if (confidenceMetricsEntries_.isEmpty()) {
            confidenceMetricsEntries_ = other.confidenceMetricsEntries_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureConfidenceMetricsEntriesIsMutable();
            confidenceMetricsEntries_.addAll(other.confidenceMetricsEntries_);
          }
          onChanged();
        }
      } else {
        if (!other.confidenceMetricsEntries_.isEmpty()) {
          if (confidenceMetricsEntriesBuilder_.isEmpty()) {
            confidenceMetricsEntriesBuilder_.dispose();
            confidenceMetricsEntriesBuilder_ = null;
            confidenceMetricsEntries_ = other.confidenceMetricsEntries_;
            bitField0_ = (bitField0_ & ~0x00000004);
            confidenceMetricsEntriesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getConfidenceMetricsEntriesFieldBuilder()
                    : null;
          } else {
            confidenceMetricsEntriesBuilder_.addAllMessages(other.confidenceMetricsEntries_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private float iouThreshold_;
    /**
     *
     *
     * <pre>
     * Output only. The intersection-over-union threshold value used to compute
     * this metrics entry.
     * </pre>
     *
     * <code>float iou_threshold = 1;</code>
     */
    public float getIouThreshold() {
      return iouThreshold_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The intersection-over-union threshold value used to compute
     * this metrics entry.
     * </pre>
     *
     * <code>float iou_threshold = 1;</code>
     */
    public Builder setIouThreshold(float value) {

      iouThreshold_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The intersection-over-union threshold value used to compute
     * this metrics entry.
     * </pre>
     *
     * <code>float iou_threshold = 1;</code>
     */
    public Builder clearIouThreshold() {

      iouThreshold_ = 0F;
      onChanged();
      return this;
    }

    private float meanAveragePrecision_;
    /**
     *
     *
     * <pre>
     * Output only. The mean average precision, most often close to au_prc.
     * </pre>
     *
     * <code>float mean_average_precision = 2;</code>
     */
    public float getMeanAveragePrecision() {
      return meanAveragePrecision_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The mean average precision, most often close to au_prc.
     * </pre>
     *
     * <code>float mean_average_precision = 2;</code>
     */
    public Builder setMeanAveragePrecision(float value) {

      meanAveragePrecision_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The mean average precision, most often close to au_prc.
     * </pre>
     *
     * <code>float mean_average_precision = 2;</code>
     */
    public Builder clearMeanAveragePrecision() {

      meanAveragePrecision_ = 0F;
      onChanged();
      return this;
    }

    private java.util.List<
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry>
        confidenceMetricsEntries_ = java.util.Collections.emptyList();

    private void ensureConfidenceMetricsEntriesIsMutable() {
      if (!((bitField0_ & 0x00000004) != 0)) {
        confidenceMetricsEntries_ =
            new java.util.ArrayList<
                com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry>(
                confidenceMetricsEntries_);
        bitField0_ |= 0x00000004;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry,
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder,
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder>
        confidenceMetricsEntriesBuilder_;

    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public java.util.List<
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry>
        getConfidenceMetricsEntriesList() {
      if (confidenceMetricsEntriesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(confidenceMetricsEntries_);
      } else {
        return confidenceMetricsEntriesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public int getConfidenceMetricsEntriesCount() {
      if (confidenceMetricsEntriesBuilder_ == null) {
        return confidenceMetricsEntries_.size();
      } else {
        return confidenceMetricsEntriesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
        getConfidenceMetricsEntries(int index) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        return confidenceMetricsEntries_.get(index);
      } else {
        return confidenceMetricsEntriesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public Builder setConfidenceMetricsEntries(
        int index,
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry value) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureConfidenceMetricsEntriesIsMutable();
        confidenceMetricsEntries_.set(index, value);
        onChanged();
      } else {
        confidenceMetricsEntriesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public Builder setConfidenceMetricsEntries(
        int index,
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder
            builderForValue) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        ensureConfidenceMetricsEntriesIsMutable();
        confidenceMetricsEntries_.set(index, builderForValue.build());
        onChanged();
      } else {
        confidenceMetricsEntriesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public Builder addConfidenceMetricsEntries(
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry value) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureConfidenceMetricsEntriesIsMutable();
        confidenceMetricsEntries_.add(value);
        onChanged();
      } else {
        confidenceMetricsEntriesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public Builder addConfidenceMetricsEntries(
        int index,
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry value) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureConfidenceMetricsEntriesIsMutable();
        confidenceMetricsEntries_.add(index, value);
        onChanged();
      } else {
        confidenceMetricsEntriesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public Builder addConfidenceMetricsEntries(
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder
            builderForValue) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        ensureConfidenceMetricsEntriesIsMutable();
        confidenceMetricsEntries_.add(builderForValue.build());
        onChanged();
      } else {
        confidenceMetricsEntriesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public Builder addConfidenceMetricsEntries(
        int index,
        com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder
            builderForValue) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        ensureConfidenceMetricsEntriesIsMutable();
        confidenceMetricsEntries_.add(index, builderForValue.build());
        onChanged();
      } else {
        confidenceMetricsEntriesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public Builder addAllConfidenceMetricsEntries(
        java.lang.Iterable<
                ? extends
                    com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry>
            values) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        ensureConfidenceMetricsEntriesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, confidenceMetricsEntries_);
        onChanged();
      } else {
        confidenceMetricsEntriesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public Builder clearConfidenceMetricsEntries() {
      if (confidenceMetricsEntriesBuilder_ == null) {
        confidenceMetricsEntries_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
      } else {
        confidenceMetricsEntriesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public Builder removeConfidenceMetricsEntries(int index) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        ensureConfidenceMetricsEntriesIsMutable();
        confidenceMetricsEntries_.remove(index);
        onChanged();
      } else {
        confidenceMetricsEntriesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder
        getConfidenceMetricsEntriesBuilder(int index) {
      return getConfidenceMetricsEntriesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder
        getConfidenceMetricsEntriesOrBuilder(int index) {
      if (confidenceMetricsEntriesBuilder_ == null) {
        return confidenceMetricsEntries_.get(index);
      } else {
        return confidenceMetricsEntriesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public java.util.List<
            ? extends
                com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry
                    .ConfidenceMetricsEntryOrBuilder>
        getConfidenceMetricsEntriesOrBuilderList() {
      if (confidenceMetricsEntriesBuilder_ != null) {
        return confidenceMetricsEntriesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(confidenceMetricsEntries_);
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder
        addConfidenceMetricsEntriesBuilder() {
      return getConfidenceMetricsEntriesFieldBuilder()
          .addBuilder(
              com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
                  .getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder
        addConfidenceMetricsEntriesBuilder(int index) {
      return getConfidenceMetricsEntriesFieldBuilder()
          .addBuilder(
              index,
              com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
                  .getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Output only. Metrics for each label-match confidence_threshold from
     * 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
     * derived from them.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry confidence_metrics_entries = 3;
     * </code>
     */
    public java.util.List<
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder>
        getConfidenceMetricsEntriesBuilderList() {
      return getConfidenceMetricsEntriesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry,
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry.Builder,
            com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntryOrBuilder>
        getConfidenceMetricsEntriesFieldBuilder() {
      if (confidenceMetricsEntriesBuilder_ == null) {
        confidenceMetricsEntriesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry,
                com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry.ConfidenceMetricsEntry
                    .Builder,
                com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry
                    .ConfidenceMetricsEntryOrBuilder>(
                confidenceMetricsEntries_,
                ((bitField0_ & 0x00000004) != 0),
                getParentForChildren(),
                isClean());
        confidenceMetricsEntries_ = null;
      }
      return confidenceMetricsEntriesBuilder_;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.automl.v1beta1.BoundingBoxMetricsEntry)
  private static final com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry();
  }

  public static com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<BoundingBoxMetricsEntry> PARSER =
      new com.google.protobuf.AbstractParser<BoundingBoxMetricsEntry>() {
        @java.lang.Override
        public BoundingBoxMetricsEntry parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new BoundingBoxMetricsEntry(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<BoundingBoxMetricsEntry> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<BoundingBoxMetricsEntry> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.automl.v1beta1.BoundingBoxMetricsEntry getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
