YOLO class
YOLO (You Only Look Once) is a class that provides machine learning inference capabilities for object detection, segmentation, classification, pose estimation, and oriented bounding box detection.
This class handles the initialization of YOLO models and provides methods to perform inference on images.
Example usage:
final yolo = YOLO(
modelPath: 'assets/models/yolo11n.tflite',
task: YOLOTask.detect,
);
await yolo.loadModel();
final results = await yolo.predict(imageBytes);
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- modelPath → String
-
Path to the YOLO model file. This can be:
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- task → YOLOTask
-
The type of task this YOLO model will perform (detection, segmentation, etc.)
final
Methods
-
loadModel(
) → Future< bool> - Loads the YOLO model for inference.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
predict(
Uint8List imageBytes) → Future< Map< String, dynamic> > - Runs inference on a single image.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
checkModelExists(
String modelPath) → Future< Map< String, dynamic> > - Checks if a model exists at the specified path.
-
getStoragePaths(
) → Future< Map< String, String?> > - Gets the available storage paths for the app.