Exemple #1
0
def getResults(path):
    res = {}
    for (dirpath,dirnames,filenames) in os.walk(path):
        for n in filenames:
            if "statsavg" in n:
                name = '.'.join(dirpath.split('/')[-3:])
                res[name] = fi.getStats(dirpath+'/'+n)
    
    return res
Exemple #2
0
def getResults(path):
    res = {}
    for (dirpath, dirnames, filenames) in os.walk(path):
        for n in filenames:
            if "statsavg" in n:
                name = '.'.join(dirpath.split('/')[-3:])
                res[name] = fi.getStats(dirpath + '/' + n)

    return res
Exemple #3
0
def crawlPreds(path):
    res = {}
    stats = {}
    for (dirpath,dirnames,filenames) in os.walk(path):
        if dirpath.endswith("predicted"):
            tmp = {}
            for n in filenames:
                if any(n.endswith(y) for y in conf.onsetsufix):
                    name = '.'.join(dirpath.split('/')[-3:])
                    tmp[os.path.splitext(n)[0]] = fi.getonsets(dirpath+'/'+n)
                    
            if tmp:
                stats[name] = fi.getStats('/'.join(dirpath.split('/')[:-1]+["stats/statsavg.txt"]))
                res[name]=tmp
    
    return res,stats
Exemple #4
0
def crawlPreds(path):
    res = {}
    stats = {}
    for (dirpath, dirnames, filenames) in os.walk(path):
        if dirpath.endswith("predicted"):
            tmp = {}
            for n in filenames:
                if any(n.endswith(y) for y in conf.onsetsufix):
                    name = '.'.join(dirpath.split('/')[-3:])
                    tmp[os.path.splitext(n)[0]] = fi.getonsets(dirpath + '/' +
                                                               n)

            if tmp:
                stats[name] = fi.getStats(
                    '/'.join(dirpath.split('/')[:-1] + ["stats/statsavg.txt"]))
                res[name] = tmp

    return res, stats