| Crates.io | ai-pose-generator-3 |
| lib.rs | ai-pose-generator-3 |
| version | 66.0.23 |
| created_at | 2025-12-29 09:05:58.062567+00 |
| updated_at | 2025-12-29 09:05:58.062567+00 |
| description | High-quality integration for https://supermaker.ai/image/ai-pose-generator/ |
| homepage | https://supermaker.ai/image/ai-pose-generator/ |
| repository | https://github.com/qy-upup/ai-pose-generator-3 |
| max_upload_size | |
| id | 2010283 |
| size | 11,714 |
A Rust crate for generating AI-assisted human poses, providing a foundation for creative applications and image manipulation. This crate offers a simple and efficient API to create and manipulate pose data.
Add the following to your Cargo.toml file under the [dependencies] section:
toml
ai-pose-generator-3 = "0.1.0" # Replace with the actual version
Here are several examples illustrating how to use the ai-pose-generator-3 crate:
1. Generating a Basic Pose: rust use ai_pose_generator_3::{Pose, Keypoint};
fn main() { // Create a new pose with some keypoints. let mut pose = Pose::new();
// Add a keypoint for the nose.
pose.add_keypoint(Keypoint {
name: "nose".to_string(),
x: 0.5,
y: 0.2,
confidence: 0.95,
});
// Add a keypoint for the left eye.
pose.add_keypoint(Keypoint {
name: "left_eye".to_string(),
x: 0.4,
y: 0.15,
confidence: 0.9,
});
// Print the pose details (for demonstration purposes).
println!("{:?}", pose);
}
2. Modifying an Existing Pose: rust use ai_pose_generator_3::{Pose, Keypoint};
fn main() { let mut pose = Pose::new(); pose.add_keypoint(Keypoint { name: "right_shoulder".to_string(), x: 0.7, y: 0.4, confidence: 0.8, });
// Modify the x coordinate of the right shoulder.
if let Some(keypoint) = pose.get_mut_keypoint("right_shoulder") {
keypoint.x = 0.75;
}
println!("{:?}", pose);
}
3. Creating a Pose from a JSON String: rust use ai_pose_generator_3::Pose;
fn main() { let json_data = r#" { "keypoints": [ { "name": "left_wrist", "x": 0.2, "y": 0.8, "confidence": 0.7 }, { "name": "right_wrist", "x": 0.8, "y": 0.8, "confidence": 0.75 } ] } "#;
let pose = Pose::from_json(json_data).unwrap(); // Handle potential errors
println!("{:?}", pose);
}
4. Calculating the Distance Between Two Keypoints: rust use ai_pose_generator_3::{Pose, Keypoint};
fn main() { let mut pose = Pose::new(); pose.add_keypoint(Keypoint { name: "left_hip".to_string(), x: 0.3, y: 0.6, confidence: 0.8, }); pose.add_keypoint(Keypoint { name: "right_hip".to_string(), x: 0.7, y: 0.6, confidence: 0.75, });
let distance = pose.distance_between_keypoints("left_hip", "right_hip").unwrap_or(0.0); //Handle possible errors
println!("Distance between hips: {}", distance);
}
5. Filtering Keypoints by Confidence: rust use ai_pose_generator_3::{Pose, Keypoint};
fn main() { let mut pose = Pose::new(); pose.add_keypoint(Keypoint { name: "left_knee".to_string(), x: 0.3, y: 0.7, confidence: 0.6, }); pose.add_keypoint(Keypoint { name: "right_knee".to_string(), x: 0.7, y: 0.7, confidence: 0.9, });
let filtered_keypoints = pose.filter_keypoints_by_confidence(0.7);
println!("Filtered Keypoints: {:?}", filtered_keypoints);
}
MIT
This crate is part of the ai-pose-generator-3 ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/image/ai-pose-generator/