r1 - 04 Sep 2008 - 16:50:31 - MichaelCaseyYou are here: OMRAS2 >  Main Web  >  TWikiUsers > MichaelCasey > AudioDB > UsingKeysTutorial

Why Use Keys?

How does audioDB identify tracks once features are inserted features into an audioDB instance, using either --INSERT (-I) or --BATCHINSERT (-B) ?

  • audioDB -d mydb.adb -B -F fileList.txt

The answer is that the feature filename is the default identifier for a track. This is OK if we have a way to map from the features back to the media item to which they refer. But usually we want a more direct method to identify a track: the track name, the path and filename of the media or by a unique identifier such as an RDF triple describing a MusicBrainz? resource.

Keys provide a way to link a media item to a unique identifier. Keys are provided per audioDB entry during --INSERT or --BATCHINSERT operations

  • audioDB -d mydb.adb -I file1.feat -k keyString
  • audioDB -d mydb.adb -B -F fileList.txt -K keyList.txt

In the first form, each --INSERT call provides exactly one feature-file and key-string pair (and optionally a power file). In the second form, each line of fileList.txt and keyList.txt provides a feature-file name and a key-string pair (optionally use -W powerList.txt to specify power files for each feature file).

The AudioDB QUERY command uses KEYS to refer to matching items found during search:

audioDB -Q seq -d AWAL_large.adb -R 0.1 -l 7 -k md5_014fdfdbbb4bc7f2640ecae6ff7b1fda --adb_feature_root audioDB.dump -v 2 -e --lsh_exact -n 1
Calling indexed query on database AWAL_large.adb, radius=0.100000, sequenceLength=7
INDEX: Opened LSH index file AWAL_large.adb.lsh.000000000.100000000.7
md5_362a7f5a66e25a82ca5a9666fb86be64 2
md5_482bd42b0f6f9b68de1ec36e429fba38 2
md5_cc4879cb2d5cf49fe2fb6cfb5cc74dd2 1
md5_b236b40b710bad92c41e30307324249c 1
md5_d2e2b2d2d3211d22250a7639032c3d6e 1
md5_6889f3bc56029e1ffaf8bf50ebe24e3b 1
md5_cef2f01a774aa0d8895aeceadaa2fb18 1
md5_d8221abc3517bea17a49b964af34a3c8 1

elapsed time: 6 msec

This search returned a list of 10 tracks ordered by the number of points that matched the features referred to by QUERY_KEY (-k). MD5 sums were used as the trackKeys in this database.

The LISZT command

To see which keys a database contains use the --LISZT command:

The first example is for a database that was constructed with IMPLICIT keys, where the feature filenames are used as the keys. The number in ( ) brackets is the number of feature vectors for that track entry.

$ adb --LISZT -d AWAL_large_noKeys.adb
[0] audioDB.dump/00000.features (178)
[1] audioDB.dump/00001.features (257)
[2] audioDB.dump/00002.features (227)
[3] audioDB.dump/00003.features (400)
[4] audioDB.dump/00004.features (145)
[5] audioDB.dump/00005.features (260)
[6] audioDB.dump/00006.features (179)
[7] audioDB.dump/00007.features (218)
[8] audioDB.dump/00008.features (168)
[9] audioDB.dump/00009.features (213)
[10] audioDB.dump/00010.features (173)
[11] audioDB.dump/00011.features (161)
[12] audioDB.dump/00012.features (257)
[13] audioDB.dump/00013.features (218)
[14] audioDB.dump/00014.features (224)
[15] audioDB.dump/00015.features (242)
[16] audioDB.dump/00016.features (194)
[17] audioDB.dump/00017.features (158)
[18] audioDB.dump/00018.features (231)
[19] audioDB.dump/00019.features (170)
[20] audioDB.dump/00020.features (162)
[21] audioDB.dump/00021.features (382)
[22] audioDB.dump/00022.features (179)
[23] audioDB.dump/00023.features (347)
[24] audioDB.dump/00024.features (279)
[25] audioDB.dump/00025.features (138)
[26] audioDB.dump/00026.features (345)
[27] audioDB.dump/00027.features (231)
[28] audioDB.dump/00028.features (270)
[29] audioDB.dump/00029.features (278)
[30] audioDB.dump/00030.features (167)
[31] audioDB.dump/00031.features (224)

The second example shows the contents of the same database built using a keyList file consisting of the MD5 sums of the media items from which features were extracted:

$ adb --LISZT -d AWAL_large.adb
[0] md5_0011b9549d30e083a948d390490cf52a (178)
[1] md5_001206ef2e2e41a7aa2e0ac30190110e (257)
[2] md5_0013c1d8cb4d51f055ff34df5de4e383 (227)
[3] md5_00142af3e3945a05b90f89bf46e3b3c2 (400)
[4] md5_002513ba859b4a2f79529e1532f94f0d (145)
[5] md5_003d507ec291b5983ba790c214944b03 (260)
[6] md5_003d84dcdd2eef028ae209597156a4eb (179)
[7] md5_00401c10a2d24451bcad1bcbf62d996f (218)
[8] md5_004273dadf858b45f2a4ac10087b7138 (168)
[9] md5_004389f0b9f8d0f027e731fe54560afd (213)
[10] md5_005f87e5c78256433f1f5aa64a55b8d6 (173)
[11] md5_007fd74b078340b2d66d330fe2e0f7f9 (161)
[12] md5_0085b8fbba61bde3859d71a5f5c6c642 (257)
[13] md5_0087972cae2b743a14c36f242f08ca3b (218)
[14] md5_008ed4cdd237087ab15b01343f6a2f4a (224)
[15] md5_00970a23437a8f9fa359684361ee5bf2 (242)
[16] md5_009e628bc1bce7491a85400dc1fedf69 (194)
[17] md5_00a341e6b3503fa92412b6f6886b8995 (158)
[18] md5_00a80517cc2d19c5d95eabc7cfc2dc7a (231)
[19] md5_00b11e2d68cd9f48a7ea221f1d0e53a8 (170)
[20] md5_00ba610469fc93cab69194a045ba7654 (162)
[21] md5_00bc80f89caf478c5ca58752bf660c76 (382)
[22] md5_00cc79840a5ec47c28f3cf18b7c36db5 (179)
[23] md5_00dcf6dcbe77430225202e742c00ebac (347)
[24] md5_0101a0ead49e53941d12f9759ae4b297 (279)
[25] md5_010f25c5d99f986162b42a5cc4a255c6 (138)
[26] md5_011155070e54c8a9c96fee6766ab185a (345)
[27] md5_011348f465556731ec7d2aae24899e76 (231)
[28] md5_0117d1dfb82ee8b56dfdde447f469e7e (270)
[29] md5_013d8abc2d3cad0c77720cc983d3b0b1 (278)
[30] md5_0148ea00f9e44faf1e91d61e31dc4f4e (167)
[31] md5_014fdfdbbb4bc7f2640ecae6ff7b1fda (224)

-- MichaelCasey - 04 Sep 2008

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: 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