Comments (8)
OK. To answer your last question, the report:
Matched query.mp3 5.6 sec 1896 raw hashes as Nine_Lives/05-Full_Circle.mp3 at -0.0 s
with 141 of 159 common hashes at rank 0
means that the query file query.mp3
was analyzed to 1,896 hashes. 159 of these also appeared in the Full_Circle reference item, but only 141 of those were consistent with the -0.0 s alignment time between query and reference. For efficiency, the first stage of matching simply selects reference items that contain many of the same hashes as the query. Then the second stage looks at the timings of those hashes, and sees if their relative timing is consistent between reference and query; it's the number of these timing-consistent common hashes that determines the overall match quality (inconsistent timings indicate coincidences).
Now, concerning --shifts: a larger number of shifts means that the audio is analyzed at greater density (it is reanalyzed at several small time shifts, to mitigate dependence on the precise framing of the STFT). By default, reference items are analyzed at 1 shift only, for speed and to reduce the size of the reference database. Query items, however, are analyzed at 4 shifts to increase the likelihood of finding matches. However, when precomputing hashes, the program doesn't know if the precomputed file will be used for reference or query; it defaults to 1 shift (the same as if were being directly imported as a reference item). Thus, when building a reference database, the results are the same with or without precompute:
$ python audfprint.py new --dbase fpdbase.pklz Nine_Lives/0*.mp3
...
Saved fprints for 9 files ( 2184 hashes) to fpdbase.pklz (0.00% dropped)
$ python audfprint.py precompute --precompdir precompdir Nine_Lives/0*.mp3
...
$ python audfprint.py new --dbase fpdbase.pklz precompdir/Nine_Lives/0*.afpt
...
Saved fprints for 9 files ( 2184 hashes) to fpdbase.pklz (0.00% dropped)
When matching, using the sound file directly uses 4 shifts, with the result that the match is found:
$ python audfprint.py match --dbase fpdbase.pklz query.mp3
...
Matched query.mp3 5.6 sec 271 raw hashes as precompdir/Nine_Lives/05-Full_Circle.afpt at 0.0 s
with 11 of 11 common hashes at rank 0
.. whereas using precomputed hashes for the query implicitly analyzes at 1 shift only, and fails to find the match:
$ python audfprint.py precompute --precompdir precompdir query.mp3
...
wrote precompdir/query.afpt ( 86 hashes, 5.832 sec)
...
$ python audfprint.py match --dbase fpdbase.pklz precompdir/query.afpt
...
NOMATCH precompdir/query.afpt 5.6 sec 86 raw hashes
Explicitly requesting 4 shifts during precompute restores the default behavior:
$ python audfprint.py precompute --precompdir precompdir --shifts 4 query.mp3
...
wrote precompdir/query.afpt ( 271 hashes, 5.832 sec)
...
$ python audfprint.py match --dbase fpdbase.pklz precompdir/query.afpt
...
Matched precompdir/query.afpt 5.6 sec 271 raw hashes as precompdir/Nine_Lives/05-Full_Circle.afpt at 0.0 s
with 11 of 11 common hashes at rank 0
I'm not sure if this is the cause of your issue, but I hope this makes things a little more clear.
DAn.
from audfprint.
from audfprint.
Hey Dan, sorry for being vague..
I tried to play around with the shifts parameter as you suggested but unfortunately it didn't solve the issue, so here goes my second try.
Here, I'll refer to the use case wherein we are looking to search ads in different recordings, as mentioned in "searching_for_ads.md"
So, in the first case The reference database was made out of the ad and the landmark features of all the recordings are saved as .afpt files, I then go on to match the precomputed landmarks against the reference database.
Here's the code for the same:
python3 audfprint.py match --dbase ad.db --min-count 100 --max-matches 100 --sortbytime --opfile precomp_test.csv --ncores 4 --find-time-range --exact-count --maxtimebits 18 --list precomp.list
whereas, in the second case, I pickle the recordings as the reference database and match the ad.mp3 with the reference database to get the results.
Code:
python3 audfprint.py match --dbase all_recordings.pklz --density 200 --hashbits 20 --find-time-range --exact-count --max-matches 100 --min-count 100 --ncores 4 --maxtimebits 18 --opfile result.csv /home/ubuntu/mm/audfprint-master/tests/data/ad.mp3
Now in the above example the 2nd method works great but the 1st one fails to identify the ad in many of the recordings, one such instance is stated below,
Result by 1st method : NOMATCH precomp/home/ubuntu/mm/audfprint-master/tests/data/Recording_number_420.afpt 3655.4 sec 377315 raw hashes
Result by 2nd method : Matched 46.5 s starting at 1846.5 s in ./tests/data/Recording_number_420.mp3 to time 2.1 s in ./tests/data/ad.mp3 with 1020 of 35792 common hashes at rank 0 count 3
So the algorithm identifies that there is an ad in the 2nd case but it's not able to do it in the 1st one.
I hope I make myself clear this time, also, I tried explicitly defining --shifts as 4 but it doesn't seem to work.
Thanks a ton!
Aditya
from audfprint.
from audfprint.
Okay, so the command i used to make all_recordings.pklz was,
python3 audfprint.py new --dbase all_recordings.pklz --density 100 --maxtimebits 18 '/home/ubuntu/mm/audfprint-master/tests/data/Recordings/*'
the commands I used to make the '.afpt'/fingerprinting database were:
ls -1 ./tests/data/test/Recordings/*.mp3 > records1.list
python3 audfprint.py precompute --maxtimebits 18 --density 100 --hashbits 20 --precompdir precomp --list records1.list --ncores 4
the commands that I used to make the reference database in the case of precompute was:
python3 audfprint.py new --dbase ad.db --density 200 --maxtimebits 18 ./tests/data/ad.mp3
I hope these inputs help, thanks a lot! :)
EDIT: Oh and another small thing, in the results, when the output says:
Matched... some_string ...with 1170 of 36594 common hashes at rank 0 count 1
Does this means that for the duration of the match, '36594' were the total landmarks out of which 1170 matched?
from audfprint.
from audfprint.
Did you try adding --shifts 4 to python3 audfprint.py precompute ... line (when creating the precomputed files used in the precomp.list match command)? DAn.
…
On Wed, Dec 5, 2018 at 7:19 AM 2407adi @.*> wrote: Okay, so the command i used to make all_recordings.pklz was, python3 audfprint.py new --dbase all_recordings.pklz --density 100 --maxtimebits 18 '/home/ubuntu/mm/audfprint-master/tests/data/Recordings/' the commands I used to make the '.afpt'/fingerprinting database were: 1. ls -1 ./tests/data/test/Recordings/.mp3 > records1.list 2. python3 audfprint.py precompute --maxtimebits 18 --density 100 --hashbits 20 --precompdir precomp --list records1.list --ncores 4 the commands that I used to make the reference database in the case of precompute was: 1. python3 audfprint.py new --dbase ad.db --density 200 --maxtimebits 18 ./tests/data/ad.mp3 I hope these inputs help, thanks a lot! :) — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#50 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhs0blK7gSmpR43pejBvcStFRcNNcdGks5u17nQgaJpZM4Y-Yjz .
Extremely sorry for the late reply Dan.
Yes I have tried the shifts = 4 argument in the pre-compute line, the results are the same.
Also, I'd be very grateful if you can shed some light on the common hashes issue i.e.
Matched... some_string ...with 1170 of 36594 common hashes at rank 0 count 1
Does this mean that for the duration of the match, '36594' were the total landmarks out of which 1170 matched, or is 36594 the total landmarks in the entire recording out of which 1170 common matches are found?
from audfprint.
This was some great explanation Dan, this surely makes things a bit less foggy.
Thanks!
from audfprint.
Related Issues (20)
- Incorrect time range HOT 1
- Incorrect Time range. HOT 1
- Convert .afpk files to mp3? HOT 1
- Problem with "spreadpeaksinvector"
- Reduce memory usage HOT 2
- Use audfprint as a module
- How to increase bits for storing IDs and timestamp?
- illustrate
- Scan every folder in every fingerprint base named as folder HOT 3
- UNICODE chaaracters ERROR HOT 11
- Show more than 1 finded matched names in results. HOT 4
- Can this algorithm load the historical features into memory first, so that the matching speed is improved, but I don't know how to modify your basic code HOT 7
- Hello, if the song is 1 million (the duration of the song is about 3 minutes), the matching time is very slow, how to optimize it? HOT 1
- I found that according to The time and hash generated by audfprint are not continuous in time, which led me to use the binary method to search for the same hash, conduct a statistical ranking of the number of hashes, and search for the original version of individual audio (the climax audio), and the ranking is not the first.
- I found that some match matches are inaccurate. I want to know, is the time and hash generated by this audfprint continuous at the start-end time, or is it a peak value, which leads to the fact that if one song is 1 minute, another song 3 minutes, there are a lot of hashes in the previous minute in the last two minutes of the next song, which leads to the fact that the hash statistics are larger than one minute, resulting in inaccurate sorting, then the match situation is inaccurate, how to optimize this? HOT 2
- output matching different between windows and linux. I created a database of filehashes which is around 340MB. When i try to query around 100 mp3 files my output is different between my windows machine and my raspberri pi. The database is identical, the query is identical but the windows machine finds significantly more matches. Both are running python 3.9. Database was created on the windows machine and transfered to the pi. Anyone encountered something similar? HOT 7
- Question about concatenate afpk files HOT 2
- How to avoid big % Dropped HOT 5
- Can someone take on audfprint-gui for audfprint or create a new gui for it? HOT 2
- Ability to split pklzs into smaller sizes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audfprint.