sm-ai-pose-generator
A Dart package for generating AI-powered pose estimations from images. This utility simplifies the integration of pose estimation capabilities into your Dart applications.
Installation
To use this package, add it as a dependency in your pubspec.yaml file:
yaml
dependencies:
sm_ai_pose_generator: ^1.0.0 # Replace with the latest version
Then, run dart pub get to install the package.
Usage
Here are some examples demonstrating how to use the sm-ai-pose-generator package:
1. Basic Pose Estimation from a Local Image File: dart import 'dart:io'; import 'package:sm_ai_pose_generator/sm_ai_pose_generator.dart';
void main() async { final poseGenerator = PoseGenerator(); final File imageFile = File('path/to/your/image.jpg'); // Replace with your image path
try { final poseEstimationResult = await poseGenerator.estimatePoseFromFile(imageFile);
if (poseEstimationResult.isNotEmpty) {
print('Pose Estimation Result: $poseEstimationResult');
// Process the pose estimation data.
} else {
print('No poses detected in the image.');
}
} catch (e) { print('Error during pose estimation: $e'); } }
2. Pose Estimation from a Network Image URL: dart import 'package:sm_ai_pose_generator/sm_ai_pose_generator.dart';
void main() async { final poseGenerator = PoseGenerator(); final String imageUrl = 'https://example.com/image.jpg'; // Replace with your image URL
try { final poseEstimationResult = await poseGenerator.estimatePoseFromUrl(imageUrl);
if (poseEstimationResult.isNotEmpty) {
print('Pose Estimation Result: $poseEstimationResult');
// Process the pose estimation data.
} else {
print('No poses detected in the image.');
}
} catch (e) { print('Error during pose estimation: $e'); } }
3. Customizing Pose Estimation Parameters (Example with confidence threshold): dart import 'package:sm_ai_pose_generator/sm_ai_pose_generator.dart';
void main() async { final poseGenerator = PoseGenerator(confidenceThreshold: 0.7); // Adjust threshold as needed final String imageUrl = 'https://example.com/image.jpg';
try { final poseEstimationResult = await poseGenerator.estimatePoseFromUrl(imageUrl);
if (poseEstimationResult.isNotEmpty) {
print('Pose Estimation Result: $poseEstimationResult');
// Process the pose estimation data.
} else {
print('No poses detected in the image.');
}
} catch (e) { print('Error during pose estimation: $e'); } }
4. Handling Multiple Poses: dart import 'package:sm_ai_pose_generator/sm_ai_pose_generator.dart';
void main() async { final poseGenerator = PoseGenerator(); final String imageUrl = 'https://example.com/image_with_multiple_people.jpg';
try { final List<Map<String, dynamic>> poseEstimationResults = await poseGenerator.estimatePoseFromUrl(imageUrl);
if (poseEstimationResults.isNotEmpty) {
for (var i = 0; i < poseEstimationResults.length; i++) {
print('Pose ${i + 1}: ${poseEstimationResults[i]}');
// Process each pose estimation result.
}
} else {
print('No poses detected in the image.');
}
} catch (e) { print('Error during pose estimation: $e'); } }
Features
- Pose Estimation: Accurately identifies and estimates human poses within images.
- Image Source Flexibility: Supports both local image files and remote image URLs.
- Customizable Parameters: Allows adjustment of parameters like confidence thresholds for fine-tuning the estimation process.
- Multiple Pose Detection: Capable of detecting and estimating multiple poses within a single image.
- Easy Integration: Simple and straightforward API for seamless integration into your Dart projects.
License
MIT License
This package is part of the sm-ai-pose-generator ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/image/ai-pose-generator/