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
Category()
|
Public Methods
abstract String |
categoryName()
The label of this category object.
|
static Category | |
static Category |
createFromProto(ClassificationProto.Classification proto)
Creates a
Category object from a ERROR(/ClassificationProto.Classification) protobuf
message. |
static List<Category> |
createListFromProto(ClassificationList classificationListProto)
Creates a list of
Category objects from a ERROR(/ClassificationProto.ClassificationList) . |
abstract String |
displayName()
The display name of the label, which may be translated for different locales.
|
final boolean | |
final int |
hashCode()
|
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 |
toString()
|
Inherited Methods
Public Constructors
public Category ()
Public Methods
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)
Creates a list of Category
objects from a ERROR(/ClassificationProto.ClassificationList)
.
Parameters
classificationListProto | the ERROR(/ClassificationProto.ClassificationList) protobuf
message to convert. |
---|
Returns
- A list of
Category
objects.
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 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.