A Flutter widget that allows you to detect and analyze poses in real-time using the device's camera, with a specific focus on push-up tracking.
Add pose_camera_view
to dependecies in your file pubspec.yaml
:
dependencies:
pose_camera_view: <última_versión>
Make the import in your code.
import 'package:pose_camera_view/pose_camera_view.dart';
How use it
PoseCameraView(
onPoseData: (poseData) {
switch (poseData.pushUpState) {
case PushUpState.middle:
print("MIDDLE");
break;
case PushUpState.completed:
print("COMPLETED");
counterNotifier.value++;
break;
case PushUpState.init:
print("INIT");
break;
case PushUpState.neutral:
// Manejar este caso
break;
}
},
elbowAngleMin: 60.0,
elbowAngleMax: 160.0,
)
- onPoseData: Callback that is called with the detected pose data.
- elbowAngleMin: Minimum elbow angle to consider a valid flexion.
- elbowAngleMax: Maximum elbow angle to consider a valid flexion.
- PushUpState.init: Initial position of pushup.
- PushUpState.middle: Halfway through pushup.
- PushUpState.completed: Pushup completed.
For a more complete example, see the example folder in this repository. Contributions Contributions are welcome. Please open an issue or send a pull request with your suggestions.
This project is licensed under the MIT License - see the LICENSE file for more details.