def main():
    # Creando lista de direcciones posibles
    lista = util.crear_lista()
    # Totalizando
    dic_cantidades = {}
    frec = None
    for clase in lista:
        if not frec == clase[:2]:
            frec = clase[:2]
            dic_cantidades[frec] = 0
        paths = glob.glob('join/' + clase + '/*.png')
        dic_cantidades[frec] += len(paths)

    import matplotlib.pyplot as plt
    import numpy as np
    x = np.arange(0, 8, 1)
    y = np.arange(0, 8, 1)
    array = np.zeros((8, 8))
    for f in range(1, 63):
        # Posicion rererente al zigzag
        (posX, posY) = get_indice(f)
        array[posX, posY] = dic_cantidades[convert(f)]
    plt.imshow(array)
    plt.colorbar(orientation='vertical')
    plt.show()
示例#2
0
def main():
    # Creando lista de direcciones posibles
    lista = util.crear_lista()
    # Totalizando    
    dic_cantidades = {}
    for clase in lista:
        paths = glob.glob('join/' + clase + '/*.png')
        dic_cantidades[clase] = len(paths)
    
    import matplotlib.pyplot as plt
    import numpy as np
    x = np.arange(16, 50, 1)
    y = np.arange(30, 130, 1)
    X, Y = np.meshgrid(x, y)
    ellipses = []
    for c in range(64):
        lista_temp = []
        for d in range(130):
            try:
                lista_temp.append(dic_cantidades[str(c)+'_'+str(d)])
            except:
                lista_temp.append(0)
        ellipses.append(lista_temp)
    plt.imshow(ellipses)
    plt.colorbar(orientation='horizontal')
    plt.xlabel('Embedding strength', size=18)
    plt.ylabel('Coefficient', size=18)
    plt.show()
示例#3
0
def main():
    # Creando lista de direcciones posibles
    lista = util.crear_lista()
    # Totalizando
    dic_cantidades = {}
    frec = None
    for clase in lista:
        if not frec == clase[:2]:
            frec = clase[:2]
            dic_cantidades[frec] = 0
        paths = glob.glob('join/' + clase + '/*.png')
        dic_cantidades[frec] += len(paths)

    import matplotlib.pyplot as plt
    import numpy as np
    x = [dic_cantidades['16'], dic_cantidades['19']]
    suma = 0
    for d in dic_cantidades.keys():
        if not ((d == '16') or (d == '19')):
            suma += dic_cantidades[d]

    x.append(suma)
    dic_cantidades.values()
    labels = ['16', '19', 'others']
    plt.pie(x, labels=labels, autopct='%1.1f%%')
    plt.show()
def main():
    # Creando lista de direcciones posibles
    lista = util.crear_lista()
    # Totalizando
    dic_cantidades = {}
    dic_cantidades['16'] = 5700
    dic_cantidades['17'] = 500
    dic_cantidades['18'] = 460
    dic_cantidades['19'] = 42240
    dic_cantidades['20'] = 450
    dic_cantidades['21'] = 10
    dic_cantidades['22'] = 620
    dic_cantidades['23'] = 5
    dic_cantidades['24'] = 220
    dic_cantidades['25'] = 5
    dic_cantidades['26'] = 560
    dic_cantidades['27'] = 2
    dic_cantidades['28'] = 450
    dic_cantidades['29'] = 230
    dic_cantidades['30'] = 84
    dic_cantidades['31'] = 80
    dic_cantidades['32'] = 89
    dic_cantidades['33'] = 3
    dic_cantidades['34'] = 650
    dic_cantidades['35'] = 2
    dic_cantidades['36'] = 3
    dic_cantidades['37'] = 2
    dic_cantidades['38'] = 30
    dic_cantidades['39'] = 1
    dic_cantidades['40'] = 23
    dic_cantidades['41'] = 3
    dic_cantidades['42'] = 2
    dic_cantidades['43'] = 1248
    dic_cantidades['44'] = 2
    dic_cantidades['45'] = 1
    dic_cantidades['46'] = 5
    dic_cantidades['47'] = 3
    dic_cantidades['48'] = 434

    import matplotlib.pyplot as plt
    import numpy as np
    x = np.arange(0, 8, 1)
    y = np.arange(0, 8, 1)
    array = np.zeros((8, 8))
    for f in range(16, 49):
        # Posicion rererente al zigzag
        (posX, posY) = get_indice(f)
        array[posX, posY] = dic_cantidades[convert(f)]
    plt.imshow(array)
    plt.colorbar(orientation='vertical')
    plt.show()
示例#5
0
def main():
    # Creando lista de direcciones posibles
    lista = util.crear_lista()
    # Totalizando
    dic_cantidades = {}
    frec = None
    for clase in lista:
        if not frec == clase[:2]:
            frec = clase[:2]
            dic_cantidades[frec] = 0
        paths = glob.glob('join/' + clase + '/*.png')
        dic_cantidades[frec] += len(paths)

    import matplotlib.pyplot as plt
    import numpy as np
    for i, key in enumerate(dic_cantidades):
        plt.bar(i, dic_cantidades[key], orientation='vertical')
    plt.xticks(np.arange(len(dic_cantidades)), dic_cantidades.keys())
    plt.show()
示例#6
0
def main():
    # Creando lista de direcciones posibles
    lista = util.crear_lista()
    # Creando carpeta result si no existe
    try:
        os.stat('join/')
    except:
        os.mkdir('join/')
    # Creando subcarpetas en result correspondientes a las variantes
    for path in lista:
        try:
            os.stat('join/' + path + '/')
        except:
            os.mkdir('join/' + path + '/')

    original_folders = [
        '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13',
        '14', '15', '16', '17', '18', '19', '20'
    ]

    for folder in original_folders:
        print("Procesando caperta: " + folder)
        for clase in lista:
            path = 'original/' + folder + '/' + clase + '/'
            try:
                os.stat(path)
            except:
                os.mkdir(path)
            paths = glob.glob(path + '*.png')
            for num, path in enumerate(paths):
                try:
                    Image.open(path).save('join/' + clase + '/' + folder +
                                          '.' + str(num) + '.png')
                except:
                    pass

    dic_cantidades = {}
    for clase in lista:
        paths = glob.glob('join/' + clase + '/*.png')
        dic_cantidades[clase] = len(paths)

    print(dic_cantidades)