deepstack 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deep_stack/custom_model.rb +4 -2
- data/lib/deep_stack/face.rb +19 -0
- data/lib/deep_stack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '02929889eabbeeb8b76cd2f588cef7452ef0bb6dd3687fad749105e6956191e9'
|
4
|
+
data.tar.gz: 2625f0bc5aac522d23461530dda2e581718c4f967c053db13c13ff0dcaa46f92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd37e76b9ad0fd30ddcc8a995fe2267d01f056cb3aa3a1d134b6335d91b6b300f61ce9929ab6b2e183ead1036135d2854a53858306395caadfaca7f2baf083d2
|
7
|
+
data.tar.gz: 275bba97d88a57d51de45a0ae2be230df5d2a8c749324ea748cd2a16c9e45de9c8f6c44d0d61fd860985400093e1caec636f1905bfbcab680631b39087bfbffa
|
@@ -1,10 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class DeepStack
|
4
|
-
# Custom
|
4
|
+
# Support for using Custom Models with DeepStack
|
5
5
|
module CustomModel
|
6
6
|
#
|
7
|
-
# Return predictions using a custom model
|
7
|
+
# Return predictions using a custom model.
|
8
|
+
# Custom models are *.pt models that have been saved in DeepStack's modelstore directory.
|
9
|
+
# See https://docs.deepstack.cc/custom-models/deployment/index.html
|
8
10
|
#
|
9
11
|
# @param [String] model custom model name
|
10
12
|
# @param [Object] image binary data or a File object
|
data/lib/deep_stack/face.rb
CHANGED
@@ -77,5 +77,24 @@ class DeepStack
|
|
77
77
|
target = 'vision/face/register'
|
78
78
|
api_post(target, images, userid: userid)&.dig('success') == true
|
79
79
|
end
|
80
|
+
|
81
|
+
#
|
82
|
+
# Call DeepStack's Face Match service. Compare two different pictures and tells the similarity between them.
|
83
|
+
#
|
84
|
+
# @example
|
85
|
+
# image1 = File.read('obama1.jpg')
|
86
|
+
# image2 = File.read('obama2.jpg')
|
87
|
+
# puts deepstack.face_match(image1, image2) > 0.6 ? 'similar' : 'different'
|
88
|
+
#
|
89
|
+
# @param [Array] *images two images to compare
|
90
|
+
# @param [kwargs] **args optional arguments to the API call
|
91
|
+
#
|
92
|
+
# @return [Float] The similarity score (0-1)
|
93
|
+
# @return [nil] if failed
|
94
|
+
#
|
95
|
+
def face_match(*images, **args)
|
96
|
+
target = 'vision/face/match'
|
97
|
+
api_post(target, images, **args)&.dig('similarity')
|
98
|
+
end
|
80
99
|
end
|
81
100
|
end
|
data/lib/deep_stack/version.rb
CHANGED