r2 - 04 Sep 2008 - 16:21:06 - MichaelCaseyYou are here: OMRAS2 >  Main Web  >  TWikiUsers > MichaelCasey > AudioDB > IndexingTutorial

AUDIODB INDEXING

AudioDB uses locality sensitive hashing to speed up queries. This is especially important for large databases (>2000 tracks)

The INDEX must reside in the same directory as the DATABASE. So you will need write access to that directory. To build an INDEX, the following method is recommended. Follow exactly:

Choose a $radius and a $seqLen to build the INDEX for (e.g. radius=0.01 and seqLen=10)

  • audioDB -d /path/to/database/mydb.adb --INDEX -R $radius -l $seqLen --lsh_k 40 --lsh_m 3 --lsh_N 10000000 -lsh_b 100000 --absolute-threshold -4.5 --adb_feature_root /path/to/features

The INDEX command will take a while to run depending on the size of your database. For 50,000 tracks with 20d 1s features it takes 15-20 minutes for the above parameters on a single 2.5GHz Intel x86 processor.

Once the INDEX is build in this way, we can perform a QUERY in the normal way and the INDEX will automatically be selected via the -d mydb.adb, -R $radius and -l $seqLen parameters.

  • audioDB -d mydb.adb -Q nseq -R $radius -l $seqLen -k key1 --absolute-threshold -4.5 -e --adb_root /path/to/database --adb_feature_root /path/to/features

However, the INDEX must be loaded into core each time a QUERY is called. This takes much more time than the QUERY since the INDEX is many megabytes. Instead, it is better to PERSIST the INDEX using an audioDB WEB SERVICE.

AUDIODB PERSISTENT INDEX WEB SERVICE

To make a memory-resident PERSISTENT INDEX, start audioDB as a WEB SERVICE issuing the --load_index command. We must be careful to provide the --adb_root and --adb_feature_root commands, the latter is required for LARGE_ADB if we are starting the server in a location other than the /path/to/features directory.

  • audioDB -s 14476 --load_index -d mydb.adb -R 0.01 -l 10 --adb_root /path/to/db --adb_feature_root /path/to/features

If successful AudioDB will report that it is LOADING INDEX myadb.adb.lsh.000000000.010000000.10

After a few mintues it will issue the message: INDEX READY

Now, we can query the AudioDB Web Service using an INDEX by issuing an AudioDB CLIENT QUERY command with the correct database name radius and sequenceLength paramters.

  • audioDB -c localhost:14476 --Q nseq -R $radius -l $seqLen -k key1 --absolute-threshold -4.5 -e

The paths are resolved by the SERVER and the correct audioDB database is located as well as the correct INDEX for this QUERY. The QUERY will run very quickly since the INDEX is already in core memory.

-- MichaelCasey - 04 Sep 2008

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
EPSRC OMRAS2
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding OMRAS2? Send feedback