Category

public abstract class Category

Category is a util class, that contains a category name, its display name, a float value as score, and the index of the label in the corresponding label file. Typically it's used as result of classification or detection tasks.

Public Constructors

Public Methods

abstract String
categoryName()
The label of this category object.
static Category
create(float score, int index, String categoryName, String displayName)
Creates a Category instance.
static Category
createFromProto(ClassificationProto.Classification proto)
Creates a Category object from a ERROR(/ClassificationProto.Classification) protobuf message.
static List<Category>
createListFromProto(ClassificationList classificationListProto)
abstract String
displayName()
The display name of the label, which may be translated for different locales.
final boolean
final int
abstract int
index()
The index of the label in the corresponding label file.
abstract float
score()
The probability score of this label category.
final String

Inherited Methods

Public Constructors

public Category ()

Public Methods

public abstract String categoryName ()

The label of this category object.

public static Category create (float score, int index, String categoryName, String displayName)

Creates a Category instance.

Parameters
score the probability score of this label category.
index the index of the label in the corresponding label file.
categoryName the label of this category object.
displayName the display name of the label.

public static Category createFromProto (ClassificationProto.Classification proto)

Creates a Category object from a ERROR(/ClassificationProto.Classification) protobuf message.

Parameters
proto the ERROR(/ClassificationProto.Classification) protobuf message to convert.

public static List<Category> createListFromProto (ClassificationList classificationListProto)

Parameters
classificationListProto the ERROR(/ClassificationProto.ClassificationList) protobuf message to convert.
Returns

public abstract String displayName ()

The display name of the label, which may be translated for different locales. For example, a label, "apple", may be translated into Spanish for display purpose, so that the display name is "manzana".

public final boolean equals (Object o)

Parameters
o

public final int hashCode ()

public abstract int index ()

The index of the label in the corresponding label file. Returns -1 if the index is not set.

public abstract float score ()

The probability score of this label category.

public final String toString ()