Category class

Dart representation of MediaPipe's "Category" concept.

Category is a util class that contains a categoryName, its displayName, a float value as score, and the index of the label in the corresponding label file. It is typically used as result of classification or detection tasks.

See more:

This io-friendly implementation is not immutable strictly for memoization of computed fields. All values used by pkg:equatable are in fact immutable.

Inheritance

Constructors

Category({required int index, required double score, required String? categoryName, required String? displayName})
Initializes a Category instance with mock values for testing.
Category.native(Pointer<Category>? _pointer)
Instantiates a Category object as a wrapper around native memory.

Properties

categoryName String?
The label of this category object.
no setteroverride
displayName String?
The display name of the label, which may be translated for different locales.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
index int
The index of the label in the corresponding label file.
no setteroverride
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
score double
The probability score of this label category.
no setteroverride
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromNativeArray(Pointer<Category> structs, int count) Iterable<Category>
Accepts a pointer to a list of structs, and a count representing the length of the list, and returns a list of pure-Dart Category instances.