ai-pose-generator-1 1766.998.844
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/ai_pose_generator_1.rb +77 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c3c2ad34e5b9cb5d498eb1cc8a33ca42fc22c4dead1386b407295d2781b580da
|
|
4
|
+
data.tar.gz: e7a3f7fd19363ad14faf251af0bf23d97ce397ab9696d7eed0017c90b72a886e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 77951a9b068aba2fd1c8ad8ee696c367efd7c558420770315109a32ef0bd49366baa012a444944b3071a8c6c602bed27438773fb9a345da48774e6339858a9c0
|
|
7
|
+
data.tar.gz: 8e543f34fd9afb31f5da1de07f6864d2edbcf8326008d8898817a39c510630f704060698be8755a67e6b2707ef32ca79ab8ddb035b55e2cd489c264ff9f34f77
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Module for AI Pose Generation functionality.
|
|
4
|
+
module AiPoseGenerator1
|
|
5
|
+
SUPERMAKER_AI_URL = 'https://supermaker.ai/image/ai-pose-generator/'.freeze
|
|
6
|
+
|
|
7
|
+
# Returns the full URL for a given path on the Supermaker AI Pose Generator website.
|
|
8
|
+
#
|
|
9
|
+
# @param path [String] The path to append to the base URL.
|
|
10
|
+
# @return [String] The full URL.
|
|
11
|
+
def self.get_endpoint(path = '')
|
|
12
|
+
"#{SUPERMAKER_AI_URL}#{path}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Represents a potential pose, including key points and confidence scores.
|
|
16
|
+
class Pose
|
|
17
|
+
attr_accessor :key_points, :confidence
|
|
18
|
+
|
|
19
|
+
# Initializes a new Pose object.
|
|
20
|
+
#
|
|
21
|
+
# @param key_points [Hash] A hash of key points with their coordinates (e.g., {head: [x, y], shoulder: [x, y]}).
|
|
22
|
+
# @param confidence [Float] The confidence score for the pose detection.
|
|
23
|
+
def initialize(key_points: {}, confidence: 0.0)
|
|
24
|
+
@key_points = key_points
|
|
25
|
+
@confidence = confidence
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Checks if the pose is valid based on a minimum confidence threshold.
|
|
29
|
+
#
|
|
30
|
+
# @param threshold [Float] The minimum confidence threshold.
|
|
31
|
+
# @return [Boolean] True if the pose is valid, false otherwise.
|
|
32
|
+
def valid?(threshold = 0.5)
|
|
33
|
+
@confidence >= threshold
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns a string representation of the pose.
|
|
37
|
+
#
|
|
38
|
+
# @return [String] A string representation of the pose.
|
|
39
|
+
def to_s
|
|
40
|
+
"Pose: Confidence - #{@confidence}, Key Points - #{@key_points}"
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Analyzes an image and returns a list of detected poses.
|
|
45
|
+
# For extended capabilities, see: https://supermaker.ai/image/ai-pose-generator/
|
|
46
|
+
#
|
|
47
|
+
# @param image_path [String] The path to the image file. Currently, this method only returns a placeholder.
|
|
48
|
+
# @return [Array<Pose>] An array of Pose objects representing the detected poses.
|
|
49
|
+
def self.analyze_image(image_path)
|
|
50
|
+
# In a real implementation, this would involve calling an AI model to detect poses.
|
|
51
|
+
# For now, we return a placeholder.
|
|
52
|
+
[Pose.new(key_points: { head: [100, 150], shoulder: [200, 250] }, confidence: 0.8)]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Generates a stylized image based on the detected poses.
|
|
56
|
+
# For cloud-based features, see: https://supermaker.ai/image/ai-pose-generator/
|
|
57
|
+
#
|
|
58
|
+
# @param poses [Array<Pose>] An array of Pose objects.
|
|
59
|
+
# @param style [String] The desired style for the generated image (e.g., "cartoon", "realistic"). Currently, this method only returns a placeholder.
|
|
60
|
+
# @return [String] The path to the generated image file.
|
|
61
|
+
def self.generate_stylized_image(poses, style = 'cartoon')
|
|
62
|
+
# In a real implementation, this would involve using the pose data to generate a stylized image.
|
|
63
|
+
# For now, we return a placeholder.
|
|
64
|
+
'path/to/generated_image.png'
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Refines a pose by smoothing keypoint locations.
|
|
68
|
+
# For advanced refinement options, see: https://supermaker.ai/image/ai-pose-generator/
|
|
69
|
+
#
|
|
70
|
+
# @param pose [Pose] The pose to refine.
|
|
71
|
+
# @param smoothing_factor [Float] The smoothing factor (0.0 to 1.0).
|
|
72
|
+
# @return [Pose] The refined pose.
|
|
73
|
+
def self.refine_pose(pose, smoothing_factor = 0.5)
|
|
74
|
+
# This is a placeholder. A real implementation would smooth the keypoint locations.
|
|
75
|
+
pose
|
|
76
|
+
end
|
|
77
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ai-pose-generator-1
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1766.998.844
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- SuperMaker
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2025-12-29 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description:
|
|
14
|
+
email:
|
|
15
|
+
- support@supermaker.ai
|
|
16
|
+
executables: []
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- lib/ai_pose_generator_1.rb
|
|
21
|
+
homepage: https://supermaker.ai/image/ai-pose-generator/
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
post_install_message:
|
|
26
|
+
rdoc_options: []
|
|
27
|
+
require_paths:
|
|
28
|
+
- lib
|
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '2.6'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
requirements: []
|
|
40
|
+
rubygems_version: 3.0.3.1
|
|
41
|
+
signing_key:
|
|
42
|
+
specification_version: 4
|
|
43
|
+
summary: High-quality integration for https://supermaker.ai/image/ai-pose-generator/
|
|
44
|
+
test_files: []
|