Covers1000.py
def doZappaComparisons(Kappa, BeatsPerBlock):
    """
    Compare the 8 zappa covers to all songs in the covers
    1000 dataset, and save the results to "ResultsZappa.mat"
    :param Kappa: Nearest neighbor cutoff for SNF and
        binary CSMs
    :param BeatsPerBlock: BeatsPerBlock for HPCPs/MFCCs
    """
    FeatureParams = {'MFCCBeatsPerBlock':BeatsPerBlock, 'MFCCSamplesPerBlock':200, 'DPixels':50, 'ChromaBeatsPerBlock':BeatsPerBlock, 'ChromasPerBlock':40}

    songs1 = ["Covers1000/Zappa/%i"%i for i in range(1, 9)]
    songs2 = getSongPrefixes() + songs1
    AllFeatures1 = []
    for i in range(len(songs1)):
        print("Getting features 1 %i of %i"%(i, len(songs1)))
        AllFeatures1.append(getCovers1000Features(songs1[i], FeatureParams))

    AllResults = {}
    BatchSize = 8
    NBatches = len(songs2)/BatchSize
    for batch in range(len(songs2)/BatchSize):
        tic = time.time()
        for offset in range(BatchSize):
            j = offset + batch*BatchSize
            print("Doing j = %i"%j)
            Features2 = getCovers1000Features(songs2[j], FeatureParams)
            for i in range(len(songs1)):
                print("Doing Zappa %i of %i Index %i"%(i+1, len(songs1), j))
                Results = compareSongs1000(AllFeatures1[i], Features2, BeatsPerBlock, Kappa, FeatureParams)
                for F in Results:
                    if not F in AllResults:
                        AllResults[F] = np.zeros((len(songs1), len(songs2)))
                    AllResults[F][i, j] = Results[F]
        sio.savemat("ResultsZappa.mat", AllResults)
        print("Batch %i Elapsed Time: %g"%(batch, time.time() - tic))

    Compare the 8 zappa covers to all songs in the covers
    1000 dataset, and save the results to "ResultsZappa.mat"
    :param Kappa: Nearest neighbor cutoff for SNF and
        binary CSMs
    :param BeatsPerBlock: BeatsPerBlock for HPCPs/MFCCs
    
Compare the 8 zappa covers to all songs in the covers
1000 dataset, and save the results to "ResultsZappa.mat"
Compare the 8 zappa covers to all songs in the covers 1000 dataset and save the results to " ResultsZappa . mat "
def doZappaComparisons(Kappa, BeatsPerBlock):
    FeatureParams = {'MFCCBeatsPerBlock':BeatsPerBlock, 'MFCCSamplesPerBlock':200, 'DPixels':50, 'ChromaBeatsPerBlock':BeatsPerBlock, 'ChromasPerBlock':40}
    songs1 = ["Covers1000/Zappa/%i"%i for i in range(1, 9)]
    songs2 = getSongPrefixes() + songs1
    AllFeatures1 = []
    for i in range(len(songs1)):
        print("Getting features 1 %i of %i"%(i, len(songs1)))
        AllFeatures1.append(getCovers1000Features(songs1[i], FeatureParams))
    AllResults = {}
    BatchSize = 8
    NBatches = len(songs2)/BatchSize
    for batch in range(len(songs2)/BatchSize):
        tic = time.time()
        for offset in range(BatchSize):
            j = offset + batch*BatchSize
            print("Doing j = %i"%j)
            Features2 = getCovers1000Features(songs2[j], FeatureParams)
            for i in range(len(songs1)):
                print("Doing Zappa %i of %i Index %i"%(i+1, len(songs1), j))
                Results = compareSongs1000(AllFeatures1[i], Features2, BeatsPerBlock, Kappa, FeatureParams)
                for F in Results:
                    if not F in AllResults:
                        AllResults[F] = np.zeros((len(songs1), len(songs2)))
                    AllResults[F][i, j] = Results[F]
        sio.savemat("ResultsZappa.mat", AllResults)
        print("Batch %i Elapsed Time: %g"%(batch, time.time() - tic))
def doZappaComparisons ( Kappa , BeatsPerBlock ) : FeatureParams = { 'MFCCBeatsPerBlock' : BeatsPerBlock , 'MFCCSamplesPerBlock' : 200 , 'DPixels' : 50 , 'ChromaBeatsPerBlock' : BeatsPerBlock , 'ChromasPerBlock' : 40 } songs1 = [ "Covers1000/Zappa/%i" % i for i in range ( 1 , 9 ) ] songs2 = getSongPrefixes ( ) + songs1 AllFeatures1 = [ ] for i in range ( len ( songs1 ) ) : print ( "Getting features 1 %i of %i" % ( i , len ( songs1 ) ) ) AllFeatures1 . append ( getCovers1000Features ( songs1 [ i ] , FeatureParams ) ) AllResults = { } BatchSize = 8 NBatches = len ( songs2 ) / BatchSize for batch in range ( len ( songs2 ) / BatchSize ) : tic = time . time ( ) for offset in range ( BatchSize ) : j = offset + batch * BatchSize print ( "Doing j = %i" % j ) Features2 = getCovers1000Features ( songs2 [ j ] , FeatureParams ) for i in range ( len ( songs1 ) ) : print ( "Doing Zappa %i of %i Index %i" % ( i + 1 , len ( songs1 ) , j ) ) Results = compareSongs1000 ( AllFeatures1 [ i ] , Features2 , BeatsPerBlock , Kappa , FeatureParams ) for F in Results : if not F in AllResults : AllResults [ F ] = np . zeros ( ( len ( songs1 ) , len ( songs2 ) ) ) AllResults [ F ] [ i , j ] = Results [ F ] sio . savemat ( "ResultsZappa.mat" , AllResults ) print ( "Batch %i Elapsed Time: %g" % ( batch , time . time ( ) - tic ) )
Compare the 8 zappa covers to all songs in the covers
1000 dataset, and save the results to "ResultsZappa.mat"
Compare the 8 zappa covers to all songs in the covers 1000 dataset and save the results to " ResultsZappa . mat "
"""
    Compare the 8 zappa covers to all songs in the covers
    1000 dataset, and save the results to "ResultsZappa.mat"
    :param Kappa: Nearest neighbor cutoff for SNF and
        binary CSMs
    :param BeatsPerBlock: BeatsPerBlock for HPCPs/MFCCs
    """
Kappa
Nearest neighbor cutoff for SNF and
binary CSMs
Nearest neighbor cutoff for SNF and binary CSMs
BeatsPerBlock
BeatsPerBlock for HPCPs/MFCCs
BeatsPerBlock for HPCPs / MFCCs