Пример #1
0
    parser = argparse.ArgumentParser()
    help_ = "Use color images"
    parser.add_argument("-c", "--color", action='store_true', help=help_)
    help_ = "Shapnet category or class (chair, airplane, etc)"
    parser.add_argument("--category", default='chair', help=help_)
    help_ = "Split file"
    parser.add_argument("-s",
                        "--split_file",
                        default='data/chair_exp.json',
                        help=help_)
    help_ = "Data png files folder"
    parser.add_argument("--data", default=PRED_PATH, help=help_)
    args = parser.parse_args()

    split_file = args.split_file
    js = get_ply(split_file)
    start_time = datetime.datetime.now()
    t = 0
    gt = []
    bl = []
    pc = []
    for key in js.keys():
        # key eg 03001627
        gt_path_main = os.path.join(GT_PATH, key)
        pred_path_main = os.path.join(args.data, key)
        data = js[key]
        test = data['test']
        test_len = len(test)
        for tag in test:
            # tag eg fff29a99be0df71455a52e01ade8eb6a
            gt_path = os.path.join(gt_path_main, tag)
Пример #2
0
                                  category=category,
                                  evaluate=True)
    ptcloud_ae.stop_sources()
    exit(0)

    if args.ptcloud_ae_weights:
        print("Loading point cloud ae weights: ", args.ptcloud_ae_weights)
        ptcloud_ae.use_emd = False
        ptcloud_ae.ae.load_weights(args.ptcloud_ae_weights)
    else:
        print("Trained point cloud ae required to pc2pix")
        exit(0)

    pc2pix = PC2Pix(ptcloud_ae=ptcloud_ae, gw=args.generator, dw=args.discriminator, pc_code_dim=args.pc_code_dim, batch_size=batch_size, category=category)

    js = get_ply(args.split_file)

    datasets = ('test')
    start_time = datetime.datetime.now()
    os.makedirs(PLOTS_PATH, exist_ok=True)
    t = 0
    interpolate = False
    for key in js.keys():
        # key eg 03001627
        data = js[key]
        tags = data['test']
        ply_path_main = os.path.join(args.ply, key)
        tagslen = len(tags)
        n_interpolate = 10
        if not interpolate:
            n_interpolate = 2