mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 19:19:53 +00:00
Update fingerprint.py
This commit is contained in:
parent
375189cf70
commit
a97ab6d35c
1 changed files with 2 additions and 2 deletions
|
@ -5,6 +5,7 @@ from scipy.ndimage.filters import maximum_filter
|
||||||
from scipy.ndimage.morphology import (generate_binary_structure,
|
from scipy.ndimage.morphology import (generate_binary_structure,
|
||||||
iterate_structure, binary_erosion)
|
iterate_structure, binary_erosion)
|
||||||
import hashlib
|
import hashlib
|
||||||
|
from operator import itemgetter
|
||||||
|
|
||||||
|
|
||||||
IDX_FREQ_I = 0
|
IDX_FREQ_I = 0
|
||||||
|
@ -96,8 +97,7 @@ def generate_hashes(peaks, fan_value=DEFAULT_FAN_VALUE):
|
||||||
[(e05b341a9b77a51fd26, 32), ... ]
|
[(e05b341a9b77a51fd26, 32), ... ]
|
||||||
"""
|
"""
|
||||||
fingerprinted = set() # to avoid rehashing same pairs
|
fingerprinted = set() # to avoid rehashing same pairs
|
||||||
|
|
||||||
from operator import itemgetter
|
|
||||||
peaks.sort(key=itemgetter(1))
|
peaks.sort(key=itemgetter(1))
|
||||||
|
|
||||||
for i in range(len(peaks)):
|
for i in range(len(peaks)):
|
||||||
|
|
Loading…
Reference in a new issue