YOLOResult class
Represents a detection result from YOLO models.
This class encapsulates all the information returned by YOLO models for a single detected object, including its location, classification, and task-specific data like segmentation masks or pose keypoints.
Example:
final result = YOLOResult(
classIndex: 0,
className: 'person',
confidence: 0.95,
boundingBox: Rect.fromLTWH(100, 100, 200, 300),
normalizedBox: Rect.fromLTWH(0.1, 0.1, 0.2, 0.3),
);
Constructors
-
YOLOResult.new({required int classIndex, required String className, required double confidence, required Rect boundingBox, required Rect normalizedBox, List<
List< ? mask, List<double> >Point> ? keypoints, List<double> ? keypointConfidences}) - YOLOResult.fromMap(Map map)
-
Creates a YOLOResult from a map representation.
factory
Properties
- boundingBox → Rect
-
The bounding box of the detected object in pixel coordinates.
final
- classIndex → int
-
The index of the detected class in the model's class list.
final
- className → String
-
The human-readable name of the detected class.
final
- confidence → double
-
The confidence score of the detection.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
keypointConfidences
→ List<
double> ? -
The confidence values for each detected keypoint.
final
-
keypoints
→ List<
Point> ? -
The detected keypoints for pose estimation tasks.
final
-
mask
→ List<
List< ?double> > -
The segmentation mask for instance segmentation tasks.
final
- normalizedBox → Rect
-
The normalized bounding box coordinates.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> - Converts this YOLOResult to a map representation.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited