|
@ -108,7 +108,6 @@ impl<'a> PIHash<'a> { |
|
|
second: &Path,
|
|
|
second: &Path,
|
|
|
sensitivity: Option<u64>)
|
|
|
sensitivity: Option<u64>)
|
|
|
-> bool {
|
|
|
-> bool {
|
|
|
|
|
|
|
|
|
let threshold = match sensitivity {
|
|
|
let threshold = match sensitivity {
|
|
|
Some(value) => value,
|
|
|
Some(value) => value,
|
|
|
None => 4,
|
|
|
None => 4,
|
|
@ -118,9 +117,9 @@ impl<'a> PIHash<'a> { |
|
|
let second_pihash = self.get_phashes(second);
|
|
|
let second_pihash = self.get_phashes(second);
|
|
|
if hash::calculate_hamming_distance(first_pihash.ahash, second_pihash.ahash) <= threshold {
|
|
|
if hash::calculate_hamming_distance(first_pihash.ahash, second_pihash.ahash) <= threshold {
|
|
|
if hash::calculate_hamming_distance(first_pihash.dhash, second_pihash.dhash) <=
|
|
|
if hash::calculate_hamming_distance(first_pihash.dhash, second_pihash.dhash) <=
|
|
|
threshold {
|
|
|
|
|
|
|
|
|
threshold {
|
|
|
if hash::calculate_hamming_distance(first_pihash.phash, second_pihash.phash) <=
|
|
|
if hash::calculate_hamming_distance(first_pihash.phash, second_pihash.phash) <=
|
|
|
threshold {
|
|
|
|
|
|
|
|
|
threshold {
|
|
|
return true;
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@ -229,7 +228,6 @@ fn to_hex_string(bytes: &[u8]) -> String { |
|
|
//
|
|
|
//
|
|
|
#[cfg(test)]
|
|
|
#[cfg(test)]
|
|
|
mod tests {
|
|
|
mod tests {
|
|
|
|
|
|
|
|
|
use std::fs;
|
|
|
use std::fs;
|
|
|
use std::path::Path;
|
|
|
use std::path::Path;
|
|
|
use hash;
|
|
|
use hash;
|
|
@ -307,28 +305,28 @@ mod tests { |
|
|
let lib = PIHash::new(Some(cache::DEFAULT_CACHE_DIR));
|
|
|
let lib = PIHash::new(Some(cache::DEFAULT_CACHE_DIR));
|
|
|
let sample_01_base_image = &Path::new("./test_images/sample_01_large.jpg");
|
|
|
let sample_01_base_image = &Path::new("./test_images/sample_01_large.jpg");
|
|
|
let sample_01_images: [&Path; 2] = [&Path::new("./test_images/sample_01_medium.jpg"),
|
|
|
let sample_01_images: [&Path; 2] = [&Path::new("./test_images/sample_01_medium.jpg"),
|
|
|
&Path::new("./test_images/sample_01_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_01_small.jpg")];
|
|
|
let sample_01_results = lib.get_similar_images(&sample_01_base_image, &sample_01_images)
|
|
|
let sample_01_results = lib.get_similar_images(&sample_01_base_image, &sample_01_images)
|
|
|
.unwrap();
|
|
|
.unwrap();
|
|
|
assert_eq!(sample_01_results.len(), 2);
|
|
|
assert_eq!(sample_01_results.len(), 2);
|
|
|
|
|
|
|
|
|
let sample_02_base_image = &Path::new("./test_images/sample_02_large.jpg");
|
|
|
let sample_02_base_image = &Path::new("./test_images/sample_02_large.jpg");
|
|
|
let sample_02_images: [&Path; 2] = [&Path::new("./test_images/sample_02_medium.jpg"),
|
|
|
let sample_02_images: [&Path; 2] = [&Path::new("./test_images/sample_02_medium.jpg"),
|
|
|
&Path::new("./test_images/sample_02_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_02_small.jpg")];
|
|
|
let sample_02_results = lib.get_similar_images(&sample_02_base_image, &sample_02_images)
|
|
|
let sample_02_results = lib.get_similar_images(&sample_02_base_image, &sample_02_images)
|
|
|
.unwrap();
|
|
|
.unwrap();
|
|
|
assert_eq!(sample_02_results.len(), 2);
|
|
|
assert_eq!(sample_02_results.len(), 2);
|
|
|
|
|
|
|
|
|
let sample_03_base_image = &Path::new("./test_images/sample_03_large.jpg");
|
|
|
let sample_03_base_image = &Path::new("./test_images/sample_03_large.jpg");
|
|
|
let sample_03_images: [&Path; 2] = [&Path::new("./test_images/sample_03_medium.jpg"),
|
|
|
let sample_03_images: [&Path; 2] = [&Path::new("./test_images/sample_03_medium.jpg"),
|
|
|
&Path::new("./test_images/sample_03_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_03_small.jpg")];
|
|
|
let sample_03_results = lib.get_similar_images(&sample_03_base_image, &sample_03_images)
|
|
|
let sample_03_results = lib.get_similar_images(&sample_03_base_image, &sample_03_images)
|
|
|
.unwrap();
|
|
|
.unwrap();
|
|
|
assert_eq!(sample_03_results.len(), 2);
|
|
|
assert_eq!(sample_03_results.len(), 2);
|
|
|
|
|
|
|
|
|
let sample_04_base_image = &Path::new("./test_images/sample_04_large.jpg");
|
|
|
let sample_04_base_image = &Path::new("./test_images/sample_04_large.jpg");
|
|
|
let sample_04_images: [&Path; 2] = [&Path::new("./test_images/sample_04_medium.jpg"),
|
|
|
let sample_04_images: [&Path; 2] = [&Path::new("./test_images/sample_04_medium.jpg"),
|
|
|
&Path::new("./test_images/sample_04_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_04_small.jpg")];
|
|
|
let sample_04_results = lib.get_similar_images(&sample_04_base_image, &sample_04_images)
|
|
|
let sample_04_results = lib.get_similar_images(&sample_04_base_image, &sample_04_images)
|
|
|
.unwrap();
|
|
|
.unwrap();
|
|
|
assert_eq!(sample_04_results.len(), 2);
|
|
|
assert_eq!(sample_04_results.len(), 2);
|
|
@ -341,8 +339,8 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_01 tests
|
|
|
// Sample_01 tests
|
|
|
let sample_01_images: [&Path; 3] = [&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
let sample_01_images: [&Path; 3] = [&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
&Path::new("./test_images/sample_01_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_01_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_01_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_01_small.jpg")];
|
|
|
let sample_01_hashes: [u64; 3] = [857051991849750, 857051991849750, 857051992374038];
|
|
|
let sample_01_hashes: [u64; 3] = [857051991849750, 857051991849750, 857051992374038];
|
|
|
test_imageset_hash(hash::HashType::AHash,
|
|
|
test_imageset_hash(hash::HashType::AHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
@ -353,11 +351,11 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_02 tests
|
|
|
// Sample_02 tests
|
|
|
let sample_02_images: [&Path; 3] = [&Path::new("./test_images/sample_02_large.jpg"),
|
|
|
let sample_02_images: [&Path; 3] = [&Path::new("./test_images/sample_02_large.jpg"),
|
|
|
&Path::new("./test_images/sample_02_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_02_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_02_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_02_small.jpg")];
|
|
|
let sample_02_hashes: [u64; 3] = [18446744073441116160,
|
|
|
let sample_02_hashes: [u64; 3] = [18446744073441116160,
|
|
|
18446744073441116160,
|
|
|
|
|
|
18446744073441116160];
|
|
|
|
|
|
|
|
|
18446744073441116160,
|
|
|
|
|
|
18446744073441116160];
|
|
|
test_imageset_hash(hash::HashType::AHash,
|
|
|
test_imageset_hash(hash::HashType::AHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
|
1u64,
|
|
|
1u64,
|
|
@ -367,8 +365,8 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_03 tests
|
|
|
// Sample_03 tests
|
|
|
let sample_03_images: [&Path; 3] = [&Path::new("./test_images/sample_03_large.jpg"),
|
|
|
let sample_03_images: [&Path; 3] = [&Path::new("./test_images/sample_03_large.jpg"),
|
|
|
&Path::new("./test_images/sample_03_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_03_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_03_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_03_small.jpg")];
|
|
|
let sample_03_hashes: [u64; 3] =
|
|
|
let sample_03_hashes: [u64; 3] =
|
|
|
[135670932300497406, 135670932300497406, 135670932300497406];
|
|
|
[135670932300497406, 135670932300497406, 135670932300497406];
|
|
|
test_imageset_hash(hash::HashType::AHash,
|
|
|
test_imageset_hash(hash::HashType::AHash,
|
|
@ -380,11 +378,11 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_04 tests
|
|
|
// Sample_04 tests
|
|
|
let sample_04_images: [&Path; 3] = [&Path::new("./test_images/sample_04_large.jpg"),
|
|
|
let sample_04_images: [&Path; 3] = [&Path::new("./test_images/sample_04_large.jpg"),
|
|
|
&Path::new("./test_images/sample_04_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_04_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_04_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_04_small.jpg")];
|
|
|
let sample_04_hashes: [u64; 3] = [18446460933090836480,
|
|
|
let sample_04_hashes: [u64; 3] = [18446460933090836480,
|
|
|
18446460933090836480,
|
|
|
|
|
|
18446460933090836480];
|
|
|
|
|
|
|
|
|
18446460933090836480,
|
|
|
|
|
|
18446460933090836480];
|
|
|
test_imageset_hash(hash::HashType::AHash,
|
|
|
test_imageset_hash(hash::HashType::AHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
|
1u64,
|
|
|
1u64,
|
|
@ -403,11 +401,11 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_01 tests
|
|
|
// Sample_01 tests
|
|
|
let sample_01_images: [&Path; 3] = [&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
let sample_01_images: [&Path; 3] = [&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
&Path::new("./test_images/sample_01_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_01_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_01_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_01_small.jpg")];
|
|
|
let sample_01_hashes: [u64; 3] = [7937395827556495926,
|
|
|
let sample_01_hashes: [u64; 3] = [7937395827556495926,
|
|
|
7937395827556495926,
|
|
|
|
|
|
7939647627370181174];
|
|
|
|
|
|
|
|
|
7937395827556495926,
|
|
|
|
|
|
7939647627370181174];
|
|
|
test_imageset_hash(hash::HashType::DHash,
|
|
|
test_imageset_hash(hash::HashType::DHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
|
1u64,
|
|
|
1u64,
|
|
@ -417,11 +415,11 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_02 tests
|
|
|
// Sample_02 tests
|
|
|
let sample_02_images: [&Path; 3] = [&Path::new("./test_images/sample_02_large.jpg"),
|
|
|
let sample_02_images: [&Path; 3] = [&Path::new("./test_images/sample_02_large.jpg"),
|
|
|
&Path::new("./test_images/sample_02_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_02_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_02_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_02_small.jpg")];
|
|
|
let sample_02_hashes: [u64; 3] = [11018273919551199541,
|
|
|
let sample_02_hashes: [u64; 3] = [11018273919551199541,
|
|
|
11009266719759587637,
|
|
|
|
|
|
11009847262435924277];
|
|
|
|
|
|
|
|
|
11009266719759587637,
|
|
|
|
|
|
11009847262435924277];
|
|
|
test_imageset_hash(hash::HashType::DHash,
|
|
|
test_imageset_hash(hash::HashType::DHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
|
3u64,
|
|
|
3u64,
|
|
@ -431,8 +429,8 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_03 tests
|
|
|
// Sample_03 tests
|
|
|
let sample_03_images: [&Path; 3] = [&Path::new("./test_images/sample_03_large.jpg"),
|
|
|
let sample_03_images: [&Path; 3] = [&Path::new("./test_images/sample_03_large.jpg"),
|
|
|
&Path::new("./test_images/sample_03_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_03_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_03_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_03_small.jpg")];
|
|
|
let sample_03_hashes: [u64; 3] =
|
|
|
let sample_03_hashes: [u64; 3] =
|
|
|
[262683193365159876, 225528496439353284, 225528496435158982];
|
|
|
[262683193365159876, 225528496439353284, 225528496435158982];
|
|
|
test_imageset_hash(hash::HashType::DHash,
|
|
|
test_imageset_hash(hash::HashType::DHash,
|
|
@ -444,11 +442,11 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_04 tests
|
|
|
// Sample_04 tests
|
|
|
let sample_04_images: [&Path; 3] = [&Path::new("./test_images/sample_04_large.jpg"),
|
|
|
let sample_04_images: [&Path; 3] = [&Path::new("./test_images/sample_04_large.jpg"),
|
|
|
&Path::new("./test_images/sample_04_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_04_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_04_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_04_small.jpg")];
|
|
|
let sample_04_hashes: [u64; 3] = [14620651386429567209,
|
|
|
let sample_04_hashes: [u64; 3] = [14620651386429567209,
|
|
|
14620651386429567209,
|
|
|
|
|
|
14620651386429567209];
|
|
|
|
|
|
|
|
|
14620651386429567209,
|
|
|
|
|
|
14620651386429567209];
|
|
|
test_imageset_hash(hash::HashType::DHash,
|
|
|
test_imageset_hash(hash::HashType::DHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
|
1u64,
|
|
|
1u64,
|
|
@ -467,8 +465,8 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_01 tests
|
|
|
// Sample_01 tests
|
|
|
let sample_01_images: [&Path; 3] = [&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
let sample_01_images: [&Path; 3] = [&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
&Path::new("./test_images/sample_01_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_01_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_01_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_01_small.jpg")];
|
|
|
let sample_01_hashes: [u64; 3] = [72357778504597504, 72357778504597504, 72357778504597504];
|
|
|
let sample_01_hashes: [u64; 3] = [72357778504597504, 72357778504597504, 72357778504597504];
|
|
|
test_imageset_hash(hash::HashType::PHash,
|
|
|
test_imageset_hash(hash::HashType::PHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
@ -479,11 +477,11 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_02 tests
|
|
|
// Sample_02 tests
|
|
|
let sample_02_images: [&Path; 3] = [&Path::new("./test_images/sample_02_large.jpg"),
|
|
|
let sample_02_images: [&Path; 3] = [&Path::new("./test_images/sample_02_large.jpg"),
|
|
|
&Path::new("./test_images/sample_02_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_02_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_02_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_02_small.jpg")];
|
|
|
let sample_02_hashes: [u64; 3] = [5332332327550844928,
|
|
|
let sample_02_hashes: [u64; 3] = [5332332327550844928,
|
|
|
5332332327550844928,
|
|
|
|
|
|
5332332327550844928];
|
|
|
|
|
|
|
|
|
5332332327550844928,
|
|
|
|
|
|
5332332327550844928];
|
|
|
test_imageset_hash(hash::HashType::PHash,
|
|
|
test_imageset_hash(hash::HashType::PHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
|
0u64,
|
|
|
0u64,
|
|
@ -493,11 +491,11 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_03 tests
|
|
|
// Sample_03 tests
|
|
|
let sample_03_images: [&Path; 3] = [&Path::new("./test_images/sample_03_large.jpg"),
|
|
|
let sample_03_images: [&Path; 3] = [&Path::new("./test_images/sample_03_large.jpg"),
|
|
|
&Path::new("./test_images/sample_03_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_03_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_03_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_03_small.jpg")];
|
|
|
let sample_03_hashes: [u64; 3] = [6917529027641081856,
|
|
|
let sample_03_hashes: [u64; 3] = [6917529027641081856,
|
|
|
6917529027641081856,
|
|
|
|
|
|
6917529027641081856];
|
|
|
|
|
|
|
|
|
6917529027641081856,
|
|
|
|
|
|
6917529027641081856];
|
|
|
test_imageset_hash(hash::HashType::PHash,
|
|
|
test_imageset_hash(hash::HashType::PHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
|
0u64,
|
|
|
0u64,
|
|
@ -507,11 +505,11 @@ mod tests { |
|
|
|
|
|
|
|
|
// Sample_04 tests
|
|
|
// Sample_04 tests
|
|
|
let sample_04_images: [&Path; 3] = [&Path::new("./test_images/sample_04_large.jpg"),
|
|
|
let sample_04_images: [&Path; 3] = [&Path::new("./test_images/sample_04_large.jpg"),
|
|
|
&Path::new("./test_images/sample_04_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_04_small.jpg")];
|
|
|
|
|
|
|
|
|
&Path::new("./test_images/sample_04_medium.jpg"),
|
|
|
|
|
|
&Path::new("./test_images/sample_04_small.jpg")];
|
|
|
let sample_04_hashes: [u64; 3] = [10997931646002397184,
|
|
|
let sample_04_hashes: [u64; 3] = [10997931646002397184,
|
|
|
10997931646002397184,
|
|
|
|
|
|
10997931646002397184];
|
|
|
|
|
|
|
|
|
10997931646002397184,
|
|
|
|
|
|
10997931646002397184];
|
|
|
test_imageset_hash(hash::HashType::PHash,
|
|
|
test_imageset_hash(hash::HashType::PHash,
|
|
|
hash::Precision::Medium,
|
|
|
hash::Precision::Medium,
|
|
|
0u64,
|
|
|
0u64,
|
|
@ -530,17 +528,17 @@ mod tests { |
|
|
let lib = PIHash::new(Some(cache::DEFAULT_CACHE_DIR));
|
|
|
let lib = PIHash::new(Some(cache::DEFAULT_CACHE_DIR));
|
|
|
|
|
|
|
|
|
// Setup the caches to make sure we're good to properly bench
|
|
|
// Setup the caches to make sure we're good to properly bench
|
|
|
// All phashes so that the matricies are pulled from cache as well
|
|
|
|
|
|
|
|
|
// All phashes so that the matrices are pulled from cache as well
|
|
|
lib.get_perceptual_hash(&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
lib.get_perceptual_hash(&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
&hash::Precision::Medium,
|
|
|
&hash::Precision::Medium,
|
|
|
&hash::HashType::PHash);
|
|
|
&hash::HashType::PHash);
|
|
|
|
|
|
|
|
|
bench.iter(|| {
|
|
|
bench.iter(|| {
|
|
|
// Sample_01 Bench
|
|
|
|
|
|
lib.get_perceptual_hash(&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium,
|
|
|
|
|
|
&hash::HashType::PHash);
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
// Sample_01 Bench
|
|
|
|
|
|
lib.get_perceptual_hash(&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium,
|
|
|
|
|
|
&hash::HashType::PHash);
|
|
|
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
#[cfg(feature = "bench")]
|
|
|
#[cfg(feature = "bench")]
|
|
@ -550,10 +548,10 @@ mod tests { |
|
|
let lib = PIHash::new(None);
|
|
|
let lib = PIHash::new(None);
|
|
|
|
|
|
|
|
|
bench.iter(|| {
|
|
|
bench.iter(|| {
|
|
|
// Sample_01 Bench
|
|
|
|
|
|
lib.get_perceptual_hash(&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium,
|
|
|
|
|
|
&hash::HashType::PHash);
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
// Sample_01 Bench
|
|
|
|
|
|
lib.get_perceptual_hash(&Path::new("./test_images/sample_01_large.jpg"),
|
|
|
|
|
|
&hash::Precision::Medium,
|
|
|
|
|
|
&hash::HashType::PHash);
|
|
|
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|