Classifications

public abstract class Classifications


Represents the list of classification for a given classifier head. Typically used as a result for classification tasks.

Summary

Public constructors

Public methods

abstract List<Category>

A list of Category objects.

static Classifications
create(
    List<Category> categories,
    int headIndex,
    Optional<String> headName
)

Creates a Classifications instance.

static Classifications
createFromProto(ClassificationsProto.Classifications proto)

Creates a Classifications object from a ClassificationsProto.Classifications protobuf message.

abstract int

The index of the classifier head these entries refer to.

abstract Optional<String>

The optional name of the classifier head, which is the corresponding tensor metadata name.

Public constructors

Classifications

public Classifications()

Public methods

categories

public abstract List<Category> categories()

A list of Category objects.

create

public static Classifications create(
    List<Category> categories,
    int headIndex,
    Optional<String> headName
)

Creates a Classifications instance.

Parameters
List<Category> categories

the list of Category objects containing the predicted categories.

int headIndex

the index of the classifier head.

Optional<String> headName

the optional name of the classifier head.

createFromProto

public static Classifications createFromProto(ClassificationsProto.Classifications proto)

Creates a Classifications object from a ClassificationsProto.Classifications protobuf message.

Parameters
ClassificationsProto.Classifications proto

the ClassificationsProto.Classifications protobuf message to convert.

headIndex

public abstract int headIndex()

The index of the classifier head these entries refer to. This is useful for multi-head models.

headName

public abstract Optional<String> headName()

The optional name of the classifier head, which is the corresponding tensor metadata name.