ai-soulmate-sketch-filter 1768.297.341 → 1768.461.691
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 +4 -4
- data/lib/ai_soulmate_sketch_filter.rb +58 -58
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29fd90aad3e7a4b1b0a08aa5f50ded98c4db03f3d6d46d1bf4026f1d4eedf4b1
|
|
4
|
+
data.tar.gz: 305598afc7cf72dccdcfc59ce29bb63bee2c092b46d2e3f1e7443507c63d46a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a5463911692f5e753f3dc11e33638d1d7000ef2265e67a6422c8ab0eee976b1d0d22ceb7f9b51aa6e842cc540700f078826f2f34100ff9edc78e5130853b0aa
|
|
7
|
+
data.tar.gz: f58082262b6b1bab26a42515351334e83aff9a9392df780a48e31ad4bbfe3c0971e5d39f37a21eb66168b88ac8acb3c0d7e1f59b2044ac9272e948b42df7ccc8
|
|
@@ -1,77 +1,77 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Module for filtering and processing AI-generated soulmate sketches.
|
|
4
3
|
module AiSoulmateSketchFilter
|
|
5
|
-
|
|
4
|
+
# The base URL for the AI Soulmate Sketch tool.
|
|
5
|
+
BASE_URL = 'https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/'.freeze
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# @return [String] The full URL.
|
|
11
|
-
def self.get_endpoint(path)
|
|
12
|
-
"#{SUPERMAKER_URL}#{path}"
|
|
13
|
-
end
|
|
7
|
+
# Represents a potential soulmate characteristic.
|
|
8
|
+
class SoulmateCharacteristic
|
|
9
|
+
attr_reader :name, :value, :weight
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
features = {}
|
|
26
|
-
features[:eyes] = 'Unknown' if prompt.downcase.include?('eyes')
|
|
27
|
-
features[:hair] = 'Unknown' if prompt.downcase.include?('hair')
|
|
28
|
-
features[:nose] = 'Unknown' if prompt.downcase.include?('nose')
|
|
29
|
-
features[:mouth] = 'Unknown' if prompt.downcase.include?('mouth')
|
|
30
|
-
features
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# Represents a potential soulmate sketch.
|
|
34
|
-
class SoulmateSketch
|
|
35
|
-
attr_accessor :features
|
|
11
|
+
# Initializes a new SoulmateCharacteristic.
|
|
12
|
+
#
|
|
13
|
+
# @param name [String] The name of the characteristic (e.g., "eye_color").
|
|
14
|
+
# @param value [String] The value of the characteristic (e.g., "blue").
|
|
15
|
+
# @param weight [Float] The weight or importance of the characteristic.
|
|
16
|
+
def initialize(name:, value:, weight: 1.0)
|
|
17
|
+
@name = name
|
|
18
|
+
@value = value
|
|
19
|
+
@weight = weight
|
|
20
|
+
end
|
|
36
21
|
|
|
37
|
-
#
|
|
22
|
+
# Returns a string representation of the characteristic.
|
|
38
23
|
#
|
|
39
|
-
# @
|
|
40
|
-
def
|
|
41
|
-
|
|
24
|
+
# @return [String]
|
|
25
|
+
def to_s
|
|
26
|
+
"#{name}: #{value} (Weight: #{weight})"
|
|
42
27
|
end
|
|
28
|
+
end
|
|
43
29
|
|
|
44
|
-
|
|
30
|
+
# Filters a set of soulmate characteristics based on predefined criteria.
|
|
31
|
+
class CharacteristicFilter
|
|
32
|
+
# Filters the given characteristics based on a block.
|
|
45
33
|
#
|
|
46
|
-
#
|
|
47
|
-
#
|
|
34
|
+
# @param characteristics [Array<SoulmateCharacteristic>] An array of SoulmateCharacteristic objects.
|
|
35
|
+
# @yield [SoulmateCharacteristic] Yields each characteristic to the block.
|
|
36
|
+
# @return [Array<SoulmateCharacteristic>] An array of filtered SoulmateCharacteristic objects.
|
|
37
|
+
# @see https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/ for extended capabilities.
|
|
38
|
+
def self.filter(characteristics, &block)
|
|
39
|
+
characteristics.select(&block)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Normalizes the weights of a set of characteristics so they sum to 1.0.
|
|
48
43
|
#
|
|
49
|
-
# @
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
feature_descriptions << "nose" if @features[:nose]
|
|
56
|
-
feature_descriptions << "mouth" if @features[:mouth]
|
|
44
|
+
# @param characteristics [Array<SoulmateCharacteristic>] An array of SoulmateCharacteristic objects.
|
|
45
|
+
# @return [Array<SoulmateCharacteristic>] An array of SoulmateCharacteristic objects with normalized weights.
|
|
46
|
+
# @see https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/ for cloud-based features.
|
|
47
|
+
def self.normalize_weights(characteristics)
|
|
48
|
+
total_weight = characteristics.sum(&:weight)
|
|
49
|
+
return characteristics if total_weight.zero?
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
51
|
+
characteristics.map do |characteristic|
|
|
52
|
+
SoulmateCharacteristic.new(name: characteristic.name, value: characteristic.value, weight: characteristic.weight / total_weight)
|
|
53
|
+
end
|
|
61
54
|
end
|
|
62
55
|
end
|
|
63
56
|
|
|
64
|
-
#
|
|
57
|
+
# Generates a full URL to the AI Soulmate Sketch tool based on the given path.
|
|
65
58
|
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
59
|
+
# @param path [String] The path to append to the base URL.
|
|
60
|
+
# @return [String] The full URL.
|
|
61
|
+
def self.get_endpoint(path)
|
|
62
|
+
"#{BASE_URL}#{path}"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Placeholder for advanced image processing features.
|
|
68
66
|
#
|
|
69
|
-
# @param
|
|
70
|
-
# @
|
|
71
|
-
# @
|
|
72
|
-
def self.
|
|
73
|
-
#
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
# @param image_data [String] Image data (e.g., base64 encoded).
|
|
68
|
+
# @return [Hash] A hash containing processed image information.
|
|
69
|
+
# @see https://supermaker.ai/image/blog/ai-soulmate-drawing-free-tool-generate-your-soulmate-sketch/ for extended capabilities.
|
|
70
|
+
def self.process_image(image_data)
|
|
71
|
+
# In a real implementation, this would involve more complex image processing.
|
|
72
|
+
{
|
|
73
|
+
dominant_color: "unknown",
|
|
74
|
+
detected_features: []
|
|
75
|
+
}
|
|
76
76
|
end
|
|
77
77
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ai-soulmate-sketch-filter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1768.
|
|
4
|
+
version: 1768.461.691
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SuperMaker
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|