deepstack 1.3.0 → 1.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be874725c205c1b4c704649e99506f362fc711eeff315d9616deb112f7caecd5
4
- data.tar.gz: f3a54bde1b2d8a533e9af9c58154a9004c7133f3e383d8e612a91d6052187fe1
3
+ metadata.gz: '02929889eabbeeb8b76cd2f588cef7452ef0bb6dd3687fad749105e6956191e9'
4
+ data.tar.gz: 2625f0bc5aac522d23461530dda2e581718c4f967c053db13c13ff0dcaa46f92
5
5
  SHA512:
6
- metadata.gz: 9c7d7c9f0abe1465489936961e9cc297c1e9961b2e6afe6b2612fea975b5b0cc0c24a95748fd6fe14e5b45e480d15a27237ad5e5b01d4f84a8617258a659fcc1
7
- data.tar.gz: d4d9f966dd440a3cd3031c3ba64b029d0f94b427945d64b77cd23aea3f1a900de2fea85a2f24ddd49fca8c1c821c7e3c6b7c63a9e120fc38e481ed1452ec388b
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 Model
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
@@ -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
@@ -5,5 +5,5 @@
5
5
  #
6
6
  class DeepStack
7
7
  # @return [String] Version of DeepStack helper libraries
8
- VERSION = '1.3.0'
8
+ VERSION = '1.4.0'
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deepstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Tanagra