SHSDataset.py
def loadSHSChromas(IDs):
    """
    Load all of the 12-dim chroma features
    """
    fin = open("SHSDataset/Chromas/btchromas.cly")
    fin.readline() #First line is 'chroma'
    chromas = {}
    while True:
        ID = fin.readline()
        if not ID:
            break
        ID = int(ID)
        if ID%1000 == 0:
            print("Loaded chromas for %i songs..."%ID)
        if not ID in IDs:
            fin.readline()
            continue
        x = fin.readline().rstrip()
        x = np.array([float(a) for a in x.split(",")])
        x = np.reshape(x, (len(x)/12, 12))
        chromas[ID] = x
    fin.close()
    return chromas

    Load all of the 12-dim chroma features
    
Load all of the 12-dim chroma features
Load all of the 12 - dim chroma features
def loadSHSChromas(IDs):
    fin = open("SHSDataset/Chromas/btchromas.cly")
    fin.readline() 
    chromas = {}
    while True:
        ID = fin.readline()
        if not ID:
            break
        ID = int(ID)
        if ID%1000 == 0:
            print("Loaded chromas for %i songs..."%ID)
        if not ID in IDs:
            fin.readline()
            continue
        x = fin.readline().rstrip()
        x = np.array([float(a) for a in x.split(",")])
        x = np.reshape(x, (len(x)/12, 12))
        chromas[ID] = x
    fin.close()
    return chromas
def loadSHSChromas ( IDs ) : fin = open ( "SHSDataset/Chromas/btchromas.cly" ) fin . readline ( ) chromas = { } while True : ID = fin . readline ( ) if not ID : break ID = int ( ID ) if ID % 1000 == 0 : print ( "Loaded chromas for %i songs..." % ID ) if not ID in IDs : fin . readline ( ) continue x = fin . readline ( ) . rstrip ( ) x = np . array ( [ float ( a ) for a in x . split ( "," ) ] ) x = np . reshape ( x , ( len ( x ) / 12 , 12 ) ) chromas [ ID ] = x fin . close ( ) return chromas
Load all of the 12-dim chroma features
Load all of the 12 - dim chroma features
"""
    Load all of the 12-dim chroma features
    """ #First line is 'chroma'
IDs