ai-pose-generator-3
v1766999.123.874
Published
Professional integration for https://supermaker.ai/image/ai-pose-generator/
Maintainers
Readme
AI Pose Generator 3
A JavaScript library to generate realistic human poses for image manipulation and AI training datasets. This package provides a convenient way to create diverse and customizable pose data directly within your JavaScript applications.
Installation
Install the package using npm: bash npm install ai-pose-generator-3
Usage Examples
Here are a few examples demonstrating how to use ai-pose-generator-3 in different scenarios:
1. Generating a Single Pose: javascript const aiPoseGenerator = require('ai-pose-generator-3');
const pose = aiPoseGenerator.generatePose();
console.log(pose); // Output: An object representing a human pose.
2. Generating Multiple Poses with Customization: javascript const aiPoseGenerator = require('ai-pose-generator-3');
const options = { count: 5, // Generate 5 poses gender: 'female', // Specify gender (optional) style: 'athletic' // Specify style (optional) };
const poses = aiPoseGenerator.generatePoses(options);
poses.forEach(pose => { console.log(pose); });
3. Integrating with a Game Engine (Example with a hypothetical GameCharacter class):
javascript
const aiPoseGenerator = require('ai-pose-generator-3');
class GameCharacter { constructor() { this.pose = null; }
updatePose() { this.pose = aiPoseGenerator.generatePose(); }
render() { // Use this.pose data to animate the character console.log("Rendering character with pose:", this.pose); } }
const character = new GameCharacter(); character.updatePose(); character.render();
4. Creating a Dataset for AI Training: javascript const aiPoseGenerator = require('ai-pose-generator-3'); const fs = require('fs');
const numberOfPoses = 100; const poses = [];
for (let i = 0; i < numberOfPoses; i++) { poses.push(aiPoseGenerator.generatePose()); }
fs.writeFileSync('poses.json', JSON.stringify(poses, null, 2)); // Save poses to a JSON file
console.log(${numberOfPoses} poses generated and saved to poses.json);
5. Generating Poses with Specific Body Part Focus (Example: Arm Movement): javascript const aiPoseGenerator = require('ai-pose-generator-3');
const poseOptions = { focusArea: 'arm', // Focus generation on arm poses. armMotion: 'raising' // Suggest raising motion };
const armPose = aiPoseGenerator.generatePose(poseOptions);
console.log("Arm-focused pose:", armPose);
API Summary
generatePose(options?: object): object: Generates a single human pose. Theoptionsobject can include properties likegender,style,focusArea, andarmMotionto customize the generated pose.options.gender: (optional) Specifies the gender of the generated pose ('male', 'female', or undefined for random).options.style: (optional) Specifies the style of the generated pose (e.g., 'athletic', 'casual', or undefined for random).options.focusArea: (optional) Specifies the body part to focus the pose generation on (e.g., 'arm', 'leg', 'torso').options.armMotion: (optional) Specifies the desired arm motion (e.g., 'raising', 'extending'). Only effective whenfocusAreais set to 'arm'.
generatePoses(options: object): array: Generates an array of human poses. Theoptionsobject must include thecountproperty, and can also includegenderandstyleproperties for customization.options.count: (required) The number of poses to generate.options.gender: (optional) Specifies the gender of the generated poses ('male', 'female', or undefined for random).options.style: (optional) Specifies the style of the generated poses (e.g., 'athletic', 'casual', or undefined for random).
License
MIT
This package is part of the ai-pose-generator-3 ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/image/ai-pose-generator/
