| Crates.io | ai-pose-generator-2 |
| lib.rs | ai-pose-generator-2 |
| version | 66.0.55 |
| created_at | 2025-12-29 09:03:16.41779+00 |
| updated_at | 2025-12-29 09:03:16.41779+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-2 |
| max_upload_size | |
| id | 2010277 |
| size | 12,951 |
A Rust crate for generating realistic human pose data, useful for training and evaluating AI models that understand human movement. This crate provides a robust and efficient way to create diverse pose datasets.
To include ai-pose-generator-2 in your Rust project, add the following line to your Cargo.toml file under the [dependencies] section:
toml
ai-pose-generator-2 = "0.1.0" # Replace with the latest version
Here are some examples demonstrating how to use the ai-pose-generator-2 crate:
1. Generating a Single Pose: rust use ai_pose_generator_2::{PoseGenerator, PoseConfig};
fn main() -> Result<(), Box
let pose = generator.generate_pose()?;
println!("Generated Pose: {:?}", pose);
Ok(())
}
This example showcases the simplest use case: creating a PoseGenerator with the default configuration and generating a single pose. The generated pose data is then printed to the console.
2. Generating Multiple Poses with Custom Configuration: rust use ai_pose_generator_2::{PoseGenerator, PoseConfig, LimbConfig};
fn main() -> Result<(), Box
let mut generator = PoseGenerator::new(config);
for _ in 0..10 {
let pose = generator.generate_pose()?;
println!("Generated Pose: {:?}", pose);
}
Ok(())
}
This example demonstrates generating multiple poses while customizing the PoseConfig. Specifically, it adjusts the LimbConfig for the elbow to restrict its range of motion.
3. Saving Poses to a File: rust use ai_pose_generator_2::{PoseGenerator, PoseConfig}; use std::fs::File; use std::io::Write;
fn main() -> Result<(), Box
let mut file = File::create("poses.txt")?;
for _ in 0..5 {
let pose = generator.generate_pose()?;
let pose_string = format!("{:?}\n", pose); // Convert pose to string
file.write_all(pose_string.as_bytes())?;
}
Ok(())
}
This example shows how to generate poses and save them to a file. It opens a file named "poses.txt" and writes each generated pose to it as a string.
4. Controlling Pose Variation with Seed Values: rust use ai_pose_generator_2::{PoseGenerator, PoseConfig};
fn main() -> Result<(), Box
// Set the same seed for both generators
generator1.set_seed(12345);
generator2.set_seed(12345);
let pose1 = generator1.generate_pose()?;
let pose2 = generator2.generate_pose()?;
// pose1 and pose2 should be very similar (or identical)
println!("Pose 1: {:?}", pose1);
println!("Pose 2: {:?}", pose2);
Ok(())
}
By setting the same seed value for two different PoseGenerator instances, you can ensure that they produce similar or identical pose sequences. This is useful for debugging and reproducibility.
This crate is licensed under the MIT License.
This crate is part of the ai-pose-generator-2 ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/image/ai-pose-generator/