tools/data_prepare/patch_data_prepare_val.py [80:120]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    for data_idx in dataset.idx_list: # image idx
        data_idx = int(data_idx)
        calib = dataset.get_calib(data_idx)
        objects = dataset.get_label(data_idx)

        feature_path = os.path.join(feat_dir, '%06d.pickle' % data_idx)
        df = open(feature_path, 'rb')
        datas = pickle.load(df)
        df.close()
        features = datas['features'].data.cpu()
        trans_out = datas['trans']
        c = trans_out[0]
        s = trans_out[1]
        out_h = trans_out[2]
        out_w = trans_out[3]
        trans_output = get_affine_transform(c, s, 0, [out_w, out_h])

        # compute x,y,z for each pixel in depth map
        depth = dataset.get_depth(data_idx)
        image = dataset.get_image(data_idx)
        assert depth.size == image.size
        width, height = depth.size
        depth = np.array(depth).astype(np.float32) / 256
        uvdepth = np.zeros((height, width, 3), dtype=np.float32)
        for v in range(height):
            for u in range(width):
                uvdepth[v, u, 0] = u
                uvdepth[v, u, 1] = v
        uvdepth[:, :, 2] = depth
        uvdepth = uvdepth.reshape(-1, 3)
        xyz = calib.img_to_rect(uvdepth[:, 0], uvdepth[:, 1], uvdepth[:, 2])  # rect coord sys
        xyz = xyz.reshape(height, width, 3)  # record xyz, data type: float32
        uvdepth = uvdepth.reshape(height, width, 3)
        rgb = np.array(image)

        for object in objects:
            if object.cls_type not in whitelist:
                continue

            # get 2d box from ground truth
            box2d = object.box2d
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tools/data_prepare/patch_data_prepare_val.py [387:427]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    for data_idx in dataset.idx_list:  # image idx
        data_idx = int(data_idx)
        calib = dataset.get_calib(data_idx)
        objects = dataset.get_label(data_idx)

        feature_path = os.path.join(feat_dir, '%06d.pickle' % data_idx)
        df = open(feature_path, 'rb')
        datas = pickle.load(df)
        df.close()
        features = datas['features'].data.cpu()
        trans_out = datas['trans']
        c = trans_out[0]
        s = trans_out[1]
        out_h = trans_out[2]
        out_w = trans_out[3]
        trans_output = get_affine_transform(c, s, 0, [out_w, out_h])

        # compute x,y,z for each pixel in depth map
        depth = dataset.get_depth(data_idx)
        image = dataset.get_image(data_idx)
        assert depth.size == image.size
        width, height = depth.size
        depth = np.array(depth).astype(np.float32) / 256
        uvdepth = np.zeros((height, width, 3), dtype=np.float32)
        for v in range(height):
            for u in range(width):
                uvdepth[v, u, 0] = u
                uvdepth[v, u, 1] = v
        uvdepth[:, :, 2] = depth
        uvdepth = uvdepth.reshape(-1, 3)
        xyz = calib.img_to_rect(uvdepth[:, 0], uvdepth[:, 1], uvdepth[:, 2])  # rect coord sys
        xyz = xyz.reshape(height, width, 3)  # record xyz, data type: float32
        uvdepth = uvdepth.reshape(height, width, 3)
        rgb = np.array(image)

        for object in objects:
            if object.cls_type not in whitelist:
                continue

            # get 2d box from ground truth
            box2d = object.box2d
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



