ClassificationModel class

Model wrapper for PyTorch classification tasks.

Provides methods for running image classification predictions with various output formats including labels, probabilities, and raw prediction scores.

Constructors

ClassificationModel(int _index, List<String> labels)

Properties

hashCode int
The hash code for this object.
no setterinherited
labels List<String>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getImagePrediction(Uint8List imageAsBytes, {List<double> mean = TORCHVISION_NORM_MEAN_RGB, List<double> std = TORCHVISION_NORM_STD_RGB}) Future<String>
Runs image classification and returns the predicted label.
getImagePredictionFromBytesList(List<Uint8List> imageAsBytesList, int imageWidth, int imageHeight, {List<double> mean = TORCHVISION_NORM_MEAN_RGB, List<double> std = TORCHVISION_NORM_STD_RGB}) Future<String>
Runs batch image classification and returns predicted labels.
getImagePredictionList(Uint8List imageAsBytes, {List<double> mean = TORCHVISION_NORM_MEAN_RGB, List<double> std = TORCHVISION_NORM_STD_RGB}) Future<List<double?>?>
Runs image classification and returns raw prediction scores.
getImagePredictionListAndProbs(Uint8List imageAsBytes, {List<double> mean = TORCHVISION_NORM_MEAN_RGB, List<double> std = TORCHVISION_NORM_STD_RGB}) Future<Map<String, List<double?>>>
Runs image classification and returns raw prediction scores with probabilities.
getImagePredictionListFromBytesList(List<Uint8List> imageAsBytesList, int imageWidth, int imageHeight, {List<double> mean = TORCHVISION_NORM_MEAN_RGB, List<double> std = TORCHVISION_NORM_STD_RGB}) Future<List<double?>?>
Runs batch image classification and returns raw prediction scores.
getImagePredictionListProbabilities(Uint8List imageAsBytes, {List<double> mean = TORCHVISION_NORM_MEAN_RGB, List<double> std = TORCHVISION_NORM_STD_RGB}) Future<List<double?>?>
Runs image classification and returns softmax probabilities.
getImagePredictionListProbabilitiesFromBytesList(List<Uint8List> imageAsBytesList, int imageWidth, int imageHeight, {List<double> mean = TORCHVISION_NORM_MEAN_RGB, List<double> std = TORCHVISION_NORM_STD_RGB}) Future<List<double?>?>
Runs batch image classification and returns softmax probabilities.
getImagePredictionResult(Uint8List imageAsBytes, {List<double> mean = TORCHVISION_NORM_MEAN_RGB, List<double> std = TORCHVISION_NORM_STD_RGB}) Future<Map<String, dynamic>>
Runs image classification and returns label with confidence.
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