hand_detection 3.0.0
hand_detection: ^3.0.0 copied to clipboard
Hand, gesture and landmark detection using on-device TFLite models
3.0.0 #
Breaking:
-
HandDetectorconfiguration moves from the constructor toinitialize().HandDetector({mode: ..., landmarkModel: ..., ...})→HandDetector()+await detector.initialize(mode: ..., landmarkModel: ..., ...). MatchesFaceDetector's shape.HandDetector.create({...})continues to accept the same named params unchanged. -
HandDetector.detectnow takesUint8Listinstead ofList<int>. Callers passing a plainList<int>must convert (Uint8List.fromList(...)); callers already passingUint8List(includingFile.readAsBytes()andcameraplugin bytes) are unaffected. -
detect(...)no longer swallows exceptions. Previously, malformed image bytes resolved to an empty list; now they surface as an exception. Genuine errors (StateError, isolate failures, dispose races) also propagate. Wrapdetect(...)in atry/catchif your callsite depended on the previous silent-failure behavior. -
HandDetectornow runs all TFLite inference in a dedicated background isolate automatically, keeping the UI thread free. -
Deprecate
HandDetectorIsolate: useHandDetectordirectly.HandDetectorIsolateis kept as a thin wrapper for backward compatibility and will be removed in a future release. -
Add
HandDetector.create({...})static factory for one-step construction and initialization (mirrorsFaceDetector.create). -
Add
detectFromFilepath(String path)convenience method. -
Add
detectFromMatBytes(Uint8List, {required int width, required int height, int matType})fast path: transfers raw pixel bytes to the background isolate via zero-copyTransferableTypedData, avoidingcv.Matconstruction on the calling thread. -
Rename
detectOnMattodetectFromMatanddetectOnMatBytestodetectFromMatBytesfor naming parity withface_detection_tflite; old names kept as deprecated aliases. -
Expand
flutter_litertre-exports through thehand_detectionbarrel to matchface_detection_tflite: tensor helpers (createNHWCTensor4D,fillNHWC4D,allocTensorShape,flattenDynamicTensor), math helpers (sigmoid,sigmoidClipped,clamp01,clip), letterbox helpers (computeLetterboxParams,LetterboxParams), BGR→RGB byte helpers (bgrBytesToRgbFloat32,bgrBytesToSignedFloat32), andPerformanceMode. Consumers no longer need a directflutter_litertimport for these. -
Update example app to use
HandDetector.create()instead ofHandDetectorIsolate.spawn(). -
Rewrite README's Live Camera Detection section around the shared
packYuv420+ nativecv.cvtColorpattern, and drop the "Background Isolate Detection" / "OpenCV Mat Support" sections that pointed users at the deprecatedHandDetectorIsolate.
2.1.2 #
- Add public
HandDetector.modelVersionandHandDetector.modelVersionFor(...)APIs for downstream cache invalidation.
2.1.1 #
- Fix iOS camera preview lifecycle in example
2.1.0 #
- Fix Android live camera in the example app:
- Replace the per-pixel Dart YUV→BGR loop with
flutter_litert's sharedpackYuv420helper + nativecv.cvtColor, matchingface_detection_tflite. _rotationFlagForFramenow handles all four device orientations (portrait up/down, landscape left/right) via a combinedsensorOrientation+DeviceOrientationformula. Previously only one of the two landscape directions rendered correctly; the other was 180° off.- Mirror the detection overlay on Android front camera to match
CameraPreview's auto-mirrored preview texture.
- Replace the per-pixel Dart YUV→BGR loop with
- Align example app live-camera layout with
face_detection_tflite: Material+Row top bar (replaces AppBar), flip-camera button, FPS + detection-time display, rotating top bar in landscape with safe-area padding, and a settings popup housing hand-specific controls (Max Hands slider, gesture toggle). - Re-export
packYuv420,YuvPlane,YuvLayout, andPackedYuvfromflutter_litertthrough thehand_detectionbarrel. - Update
flutter_litertto^2.2.0.
2.0.9 #
- Update flutter_litert -> 2.1.0
2.0.8 #
- Update flutter_litert to 2.0.13
2.0.7 #
- Update flutter_litert -> 2.0.12
2.0.6 #
- Update flutter_litert 2.0.10 -> 2.0.11
2.0.5 #
- Update documentation
2.0.4 #
- Update flutter_litert 2.0.8 -> 2.0.10
2.0.3 #
- Enable auto hardware acceleration by default (XNNPACK on all native platforms, Metal GPU on iOS)
- Update flutter_litert 2.0.6 -> 2.0.8
2.0.2 #
- Update flutter_litert 2.0.5 -> 2.0.6
2.0.1 #
- Fix Xcode build warnings by declaring PrivacyInfo.xcprivacy as a resource bundle in iOS and macOS podspecs
2.0.0 #
Breaking: Point now uses double coordinates. BoundingBox.toMap() format changed to corner-based.
- Use shared
PointandBoundingBoxfromflutter_litert2.0.0 toPixel()now returns full-precisiondoublecoordinates (was truncating toint)- Remove duplicate NMS implementation, use shared
nms()fromflutter_litert - Refactor isolate worker to use
IsolateWorkerBasefrom flutter_litert - Simplify model classes (PalmDetector, HandLandmarkModel, GestureRecognizer)
- Remove integration tests from unit test suite
- Remove dead test helpers (
test_config.dart)
1.0.3 #
- Update
camera_desktop1.0.1 -> 1.0.3
1.0.2 #
- Update
flutter_litert-> 1.2.0 - Refactor to use
flutter_litertshared utilities (InterpreterFactory,InterpreterPool,PerformanceConfig,generateAnchors)
1.0.1 #
- Update
opencv_dart2.1.0 -> 2.2.1 - Update
flutter_litert1.0.2 -> 1.0.3
1.0.0 #
First stable release of hand_detection
Pipeline #
- Palm detection, SSD model with rotation-aware bounding boxes
- Hand landmarks, 21-point 3D landmarks with visibility scores
- Gesture recognition, 7 gestures (fist, open palm, pointing up, thumbs down/up, victory, I love you)
- Handedness, Left/right classification
Features #
- Two modes:
HandMode.boxes(bounding boxes only) andHandMode.boxesAndLandmarks(full landmarks) HandDetectorIsolatefor background-thread inference with zero-copy transfer- Direct
cv.Matinput for live camera processing - XNNPACK hardware acceleration with configurable thread count
- Configurable confidence thresholds and detection limits
Platforms #
- iOS, Android, macOS, Windows, Linux
0.0.4 #
- Update documentation
0.0.3 #
- Update
flutter_litertto 1.0.1,camerato 0.12.0
0.0.2 #
- Update
flutter_litertto 0.2.2
0.0.1 #
- Initial release