| Crates.io | sm-ai-pose-generator |
| lib.rs | sm-ai-pose-generator |
| version | 67.0.7 |
| created_at | 2025-12-29 09:24:05.466374+00 |
| updated_at | 2025-12-29 09:24:05.466374+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/sm-ai-pose-generator |
| max_upload_size | |
| id | 2010316 |
| size | 12,231 |
A Rust crate to streamline the generation of AI pose data from various input formats. It provides tools for parsing, processing, and exporting pose information, facilitating integration with AI training pipelines and related applications.
Add the following to your Cargo.toml file under the [dependencies] section:
toml
sm-ai-pose-generator = "0.1.0" # Replace with the actual version number
Here are a few examples demonstrating how to use the sm-ai-pose-generator crate:
1. Parsing Pose Data from a JSON File:
This example shows how to load pose data from a JSON file and process it. rust use sm_ai_pose_generator::pose_data::PoseData; use std::fs;
fn main() -> Result<(), Box
println!("Number of keypoints: {}", pose_data.keypoints.len());
// Perform further processing on the pose data here
Ok(())
}
2. Converting Pose Data to a Different Format:
This example demonstrates converting the loaded pose data to a different format, such as a custom binary format. rust use sm_ai_pose_generator::pose_data::PoseData; use std::fs;
fn main() -> Result<(), Box
// Convert pose data to a custom binary format (example)
let binary_data = pose_data.to_binary();
fs::write("pose_data.bin", binary_data)?;
Ok(())
}
impl PoseData {
fn to_binary(&self) -> Vec
3. Filtering Pose Data Based on Confidence Scores:
This example shows how to filter pose data based on the confidence scores associated with each keypoint. rust use sm_ai_pose_generator::pose_data::PoseData; use std::fs;
fn main() -> Result<(), Box
// Filter keypoints with confidence scores below a threshold
pose_data.keypoints.retain(|keypoint| keypoint.confidence > 0.8);
println!("Number of keypoints after filtering: {}", pose_data.keypoints.len());
Ok(())
}
4. Creating Pose Data Programmatically:
This example demonstrates how to create PoseData instances programmatically, useful for generating synthetic data or manipulating existing data.
rust
use sm_ai_pose_generator::pose_data::{PoseData, Keypoint};
fn main() { let mut pose_data = PoseData::default();
// Add some keypoints
pose_data.keypoints.push(Keypoint { x: 10.0, y: 20.0, confidence: 0.9 });
pose_data.keypoints.push(Keypoint { x: 30.0, y: 40.0, confidence: 0.7 });
println!("Created pose data with {} keypoints", pose_data.keypoints.len());
}
MIT
This crate is part of the sm-ai-pose-generator ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/image/ai-pose-generator/