Skip to content

Commit

Permalink
small changes that fix problems after a refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
fbranschke committed Feb 20, 2025
1 parent dc7c951 commit 2fd248b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/datasets/synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,17 @@ def load_synthetic(data_dir, file, factor: int, id_offset):
fy = fov2focal(FOVX, image.height)
cx, cy = 0.5 * image.width, 0.5 * image.height
K = np.array([[fx, 0, cx], [0, fy, cy], [0, 0, 1]], dtype=float)
K[:2, :] /= factor
K[:2, :] /= abs(factor)
Ks_dict[camera_id] = K

camera_ids.append(camera_id)
camtoworlds.append(c2w)
# assume no distortion
params_dict[camera_id] = np.empty(0, dtype=np.float32)
imsize_dict[camera_id] = (image.width // factor, image.height // factor)
imsize_dict[camera_id] = (
image.width // abs(factor),
image.height // abs(factor),
)
mask_dict[camera_id] = None
image_names.append(image_name)
image_paths.append(image_path)
Expand Down Expand Up @@ -128,7 +131,7 @@ def __init__(
image_paths_testdata,
Ks_dict_testdata,
) = load_synthetic(
data_dir, "transforms_train.json", factor, train_camera_id_len
data_dir, "transforms_test.json", factor, train_camera_id_len
)

# join data
Expand Down

0 comments on commit 2fd248b

Please sign in to comment.