mbortnyck / qfp

Quad-based audio fingerprinting and recognition in Python
42 stars 13 forks source link

IndexError: list index out of range #11

Open LINUX3932 opened 4 years ago

LINUX3932 commented 4 years ago

About 70% of my files work fine.

However, the remaining fingerprints give an IndexError when attempting to store. Others store okay but give an error when a match exists (If I don't store a fingerprint for these particular files it works correctly, returning '[ ]').

store error example: Traceback (most recent call last): File "go_storedb.py", line 5, in fp_r.create() File "/qfp/fingerprint.py", line 58, in create self.strongest = n_strongest(spectrogram, quads, q) File "/qfp/utils.py", line 66, in n_strongest partitions = _find_partitions(quads) File "/qfp/utils.py", line 80, in _find_partitions last_x = quads[-1].A.x IndexError: list index out of range

query error example: Traceback (most recent call last): File "go_querydb.py", line 9, in db.query(fp_q) File "/qfp/db.py", line 153, in query fp.match_candidates = self._find_match_candidates(fp) File "/qfp/db.py", line 177, in _find_match_candidates for k, v in binned.items() if len(v[list(v.keys())[0]]) >= 4} File "/qfp/db.py", line 177, in for k, v in binned.items() if len(v[list(v.keys())[0]]) >= 4} IndexError: list index out of range

I have checked the wav and mp3 files for any errors and they're fine.

erfankab commented 3 years ago

I have same problem. Did you find any solution for this error?

SuperSonicHub1 commented 2 years ago

Also having this issue. I'm starting to become familiar with the codebase and am planning to read the paper, so I hopefully will be able to fix this in my fork: https://github.com/SuperSonicHub1/qfp

sixyang commented 2 years ago

The following lines of code can solve the problem

        result = {}
        for k, v in binned.items():
            if k and v and v.keys() and len(v[list(v.keys())[0]]) >= 4:
                results[k] = self._scales(v)