Exemplo n.º 1
0
def create_and_visualize(param):
    print(f"{dt()} :: Create And Visualize Initialize")
    datasets = loader.create_loader(param)

    for nb_comb in range(1, 6):
        print(f"{dt()} :: --Create Combine Number : {nb_comb}")
        dc = dict()
        for key, files in datasets.items():
            files = sorted(files)
            param.key = key
            class_collect = list()

            for file in files:
                output = create_configuration(param, file, nb_comb)
                class_collect.append(output)
            dc[key] = class_collect

        print(f"{dt()} :: --Combine Number : {nb_comb} Save Initialize")
        cc.save_datasets(param, dc, nb_comb)
        print(f"{dt()} :: --Done")

        if nb_comb == 1:
            print(f"{dt()} :: Visualize Initialize")
            visdat = loader.viz_loader(param)
            print(f"{dt()} :: --Visualize Dataset Path Load")
            visualizer.chosen_viz(param, visdat)
            print(f"{dt()} :: --Done")
Exemplo n.º 2
0
def vector_to_img(param):
    print(f"{dt()} :: Create Initialize")
    datasets = loader.create_loader(param)
    nb_comb = 1
    pn_collect = list()
    cn_collect = list()
    data_collect = list()

    dc = dict()
    for key, files in datasets.items():
        files = sorted(files)
        param.key = key

        for file in files:
            # class_collect.append(output)
            if param.model_name == 'create':
                pressure, acc, gyro, peo_nb, class_nb = vti_configuration(
                    param, file, nb_comb)
                cc.save_vti(pressure, 'pressure', peo_nb, class_nb, param)
                cc.save_dataset_with_vti(acc, 'acc', peo_nb, class_nb, param)
                cc.save_dataset_with_vti(gyro, 'gyro', peo_nb, class_nb, param)
            else:
                pressure, acc, gyro, peo_nb, class_nb = vti_configuration(
                    param, file, nb_comb)

            pn_collect.append(int(peo_nb))
            cn_collect.append(int(class_nb))
            dataset = [pressure, acc, gyro]
            data_collect.append(dataset)

    preprocessing.vti_preprocess(param, pn_collect, cn_collect, data_collect)
Exemplo n.º 3
0
def cropping(param):
    print(f"{dt()} :: Cropping Network Initialize")
    datasets = loader.create_loader(param)
    data_list = preprocessing.normalize_all_of_length(param, datasets)
    for i, data in enumerate(data_list):
        data[:, -2] = data[:, -2] - 1
        data_list[i] = data[data[:, -2].argsort()]

    param.nb_modal = 3
    train, test, nb_class, nb_people = preprocessing.chosen_method(param=param, comb=1, datasets=data_list)
    nb_repeat = len(train)
    for repeat in range(nb_repeat):
        model = model_compactor.model_setting(param, train[repeat], test[repeat], [nb_class, nb_people])
    print('Done?')
Exemplo n.º 4
0
def create(param):
    print(f"{dt()} :: Create Initialize")
    datasets = loader.create_loader(param)

    for nb_comb in range(1, 6):
        print(f"{dt()} :: Combine Number : {nb_comb}")
        dc = dict()
        for key, files in datasets.items():
            files = sorted(files)
            param.key = key
            class_collect = list()

            for file in files:
                output = create_configuration(param, file, nb_comb)
                class_collect.append(output)
            dc[key] = class_collect
        print(f"{dt()} :: --Combine Number : {nb_comb} Save Initialize")
        cc.save_datasets(param, dc, nb_comb)
        print(f"{dt()} :: --Done")
Exemplo n.º 5
0
def create_v2(param):
    print(f"{dt()} :: Create Initialize")
    datasets = loader.create_loader(param)

    for nb_comb in range(1, 6):
        print(f"{dt()} :: Combine Number : {nb_comb}")
        dc = dict()
        for key, files in datasets.items():
            files = sorted(files)
            param.key = key
            class_collect = list()

            for file in files:
                if file.split('/')[-1] == '13_04.csv' or file.split('/')[-1] == '14_05.csv' and \
                        (param.datatype == 'disease' or param.datatype == 'disease_add'):
                    continue
                print(file)
                output = create_configuration_v2(param, file, nb_comb)
                class_collect.append(output)
            dc[key] = class_collect
        print(f"{dt()} :: --Combine Number : {nb_comb} Save Initialize")
        cc.save_datasets(param, dc, nb_comb)
        print(f"{dt()} :: --Done")