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.
- checksums.yaml +4 -4
 - data/lib/ssimsort.rb +4 -4
 - data/ssimsort.gemspec +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7095204315521390662d67dcab333f23972fd94d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 0c3b343654e2cc38648694e0f97e706c78ceb84c
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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( 
     | 
| 
      
 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 
     | 
    
         
            -
            		 
     | 
| 
       67 
     | 
    
         
            -
            		 
     | 
| 
       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