Class ClassificationInput
A single image within a classification request batch. Contains all necessary metadata and data for classifying one image.
public sealed class ClassificationInput : IMessage<ClassificationInput>, IEquatable<ClassificationInput>, IDeepCloneable<ClassificationInput>, IBufferMessage, IMessage
- Inheritance
-
ClassificationInput
- Implements
-
IMessage<ClassificationInput>IDeepCloneable<ClassificationInput>IBufferMessageIMessage
- Inherited Members
Constructors
ClassificationInput()
public ClassificationInput()
ClassificationInput(ClassificationInput)
public ClassificationInput(ClassificationInput other)
Parameters
otherClassificationInput
Fields
AffiliateFieldNumber
Field number for the "affiliate" field.
public const int AffiliateFieldNumber = 1
Field Value
CorrelationIdFieldNumber
Field number for the "correlation_id" field.
public const int CorrelationIdFieldNumber = 2
Field Value
DataFieldNumber
Field number for the "data" field.
public const int DataFieldNumber = 4
Field Value
EncodingFieldNumber
Field number for the "encoding" field.
public const int EncodingFieldNumber = 3
Field Value
FormatFieldNumber
Field number for the "format" field.
public const int FormatFieldNumber = 5
Field Value
HashesFieldNumber
Field number for the "hashes" field.
public const int HashesFieldNumber = 6
Field Value
Properties
Affiliate
The affiliate or source system that provided this image Used for tracking, analytics, and routing purposes.
public string Affiliate { get; set; }
Property Value
CorrelationId
Unique identifier for correlating this input with its response Must be unique within the deployment to properly match responses
public string CorrelationId { get; set; }
Property Value
Data
The raw image data bytes in the format specified by encoding Can be compressed or uncompressed based on the encoding field
public ByteString Data { get; set; }
Property Value
- ByteString
Descriptor
public static MessageDescriptor Descriptor { get; }
Property Value
- MessageDescriptor
Encoding
Specifies the encoding/compression format of the image data Allows the server to properly decode the image before classification
public RequestEncoding Encoding { get; set; }
Property Value
Format
The image file format of the data bytes
public ImageFormat Format { get; set; }
Property Value
Hashes
Hashes of the image data, can be multiple depending on image processing (e.g. of raw bytes, jpeg image, etc.) but must be for a single image.
public RepeatedField<ImageHash> Hashes { get; }
Property Value
- RepeatedField<ImageHash>
Parser
public static MessageParser<ClassificationInput> Parser { get; }
Property Value
- MessageParser<ClassificationInput>
Methods
CalculateSize()
Calculates the size of this message in Protocol Buffer wire format, in bytes.
public int CalculateSize()
Returns
- int
The number of bytes required to write this message to a coded output stream.
Clone()
Creates a deep clone of this object.
public ClassificationInput Clone()
Returns
- ClassificationInput
A deep clone of this object.
Equals(ClassificationInput)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ClassificationInput other)
Parameters
otherClassificationInputAn object to compare with this object.
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object other)
Parameters
otherobject
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
MergeFrom(CodedInputStream)
Merges the data from the specified coded input stream with the current message.
public void MergeFrom(CodedInputStream input)
Parameters
inputCodedInputStream
Remarks
See the user guide for precise merge semantics.
MergeFrom(ClassificationInput)
Merges the given message into this one.
public void MergeFrom(ClassificationInput other)
Parameters
otherClassificationInput
Remarks
See the user guide for precise merge semantics.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
WriteTo(CodedOutputStream)
Writes the data to the given coded output stream.
public void WriteTo(CodedOutputStream output)
Parameters
outputCodedOutputStreamCoded output stream to write the data to. Must not be null.