ssimsort 0.1.5 → 0.1.6

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ssimsort.rb +4 -4
  3. data/ssimsort.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adfe74cb2e85227dd8cf598400e1275c170e4320
4
- data.tar.gz: 6abc4d25a01a20db39e36e152b94251f129f02d1
3
+ metadata.gz: 7095204315521390662d67dcab333f23972fd94d
4
+ data.tar.gz: 0c3b343654e2cc38648694e0f97e706c78ceb84c
5
5
  SHA512:
6
- metadata.gz: 6223df1608c4c1a017ce8c3d68e9a43a682096fc8bc9a71594efe6b3fe27e430f49a2aecc46fac4565cd90bced1bb8d807d6668e56c93f665671ebf859b43d2a
7
- data.tar.gz: 3ff54b3258a449255ebee47846a39f947e2ee66f8c3f850513ffb9656a09d1e22f64f823fb80717f7cb5ba5114e4b6ee777910e9d8006e1e5c6079f2999c12c0
6
+ metadata.gz: effdb716040adbf4923fded5073b79e3c44962505f6c2e4c4024ba2e5cb79a3b96576f8b5de091d2f630df406b1dfce05f8bb4e1ea6e3b396f62734a080fa263
7
+ data.tar.gz: f0a1dbdff2ec11a359cc6b51dccb3ed9746220109f28c5b540227a4cb872767c26608dd8db7f83d2d59dd48416f540f2df1d7e5fdcb94359bc295fd3596a24c5
data/lib/ssimsort.rb CHANGED
@@ -30,7 +30,7 @@ module SsimSort
30
30
  moy_x, moy_y = x.mean, y.mean
31
31
  a = (2*moy_x*moy_y+cA)*(2*(cov(x,y))+cB)
32
32
  b = (moy_x**2+moy_y**2+cA)*(var_x+var_y+cB)
33
- (a/b) < 0 ? 0 : (a/b).round(4)
33
+ (a/b) < 0 ? 0 : (a/b).round(5)
34
34
  end
35
35
 
36
36
 
@@ -63,9 +63,9 @@ module SsimSort
63
63
  simil = SsimSort.ssim(filecomp,file)
64
64
  sim_dict[file] = simil
65
65
  end
66
- sim_dict = sim_dict.sort_by {|k,v| v}.reverse.map {|k,v| k}
67
- sim_dict.each_with_index do |k,i|
68
- FileUtils.cp(k,"#{output_path}/#{i}#{File.extname(k)}")
66
+ sim_list = sim_dict.sort_by {|k,v| v}.reverse
67
+ sim_list.each_with_index do |k,i|
68
+ FileUtils.cp(k[0],"#{output_path}/#{i}(#{k[0]})#{File.extname(k)}")
69
69
  end
70
70
  end
71
71
 
data/ssimsort.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ssimsort'
3
- s.version = '0.1.5'
3
+ s.version = '0.1.6'
4
4
  s.date = '2013-11-25'
5
5
  s.summary = "SsimSort"
6
6
  s.description = "Sort images easily by their similarity"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssimsort
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Galaad Gauthier