Skip to content

Support datasets with images with varied widths and heights #7

Open

Description

@henrypearce4D

Hi the project is very interesting.

Are you able to add support for datasets with images with varied widths and heights?

Error executing job with overrides: ['train.gs_epochs=30000', 'train.no_densify=True', 'gs.dataset.source_path=data/frame000001', 'gs.dataset.model_path=data/output/frame000001', 'init_wC.matches_per_ref=20000', 'init_wC.nns_per_ref=3', 'init_wC.num_refs=180', 'wandb.mode=disabled']
Traceback (most recent call last):
  File "/mnt/c/Users/ice/wslworkspace/EDGS/train.py", line 54, in main
    trainer.init_with_corr(cfg.init_wC)
  File "/mnt/c/Users/ice/wslworkspace/EDGS/source/trainer.py", line 234, in init_with_corr
    camera_set, selected_indices, visualization_dict = init_fn(
  File "/mnt/c/Users/ice/wslworkspace/EDGS/source/corr_init.py", line 630, in init_gaussians_with_corr
    kptsA_np, kptsB_np, kptsB_proj_matrices_idcs, kptsA_color, kptsB_color = extract_keypoints_and_colors(
  File "/mnt/c/Users/ice/wslworkspace/EDGS/source/corr_init.py", line 362, in extract_keypoints_and_colors
    imB_compound_np = np.stack(imB_compound, axis=0)
  File "/home/ice/miniconda3/envs/edgs/lib/python3.10/site-packages/numpy/core/shape_base.py", line 449, in stack
    raise ValueError('all input arrays must have the same shape')
ValueError: all input arrays must have the same shape

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Activity

  1. wstwxl commented on May 14, 2025

    @wstwxl

    Hello, I have the same problem. Have you solved it yet

  2. henrypearce4D commented on May 14, 2025

    @henrypearce4D
    Author

    No I did not revisit to test anything else :(

  3. dimakot55 commented on May 20, 2025

    @dimakot55
    Member

    Thank you guys for your interest in our work. We haven't actually considered this problem when designing the method but we maybe will fix that after the SIGGRAPH ddl. For now on I can suggest you to manually resize all the arrays in imB_compound to the size of imA in function extract_keypoints_and_colors in source/corr_init.py. Probably add this to the line 313. This will slightly decrease the speed and generally not the nicest solution but may work as a quick hack. Let me know if you have problems, I'll try to help you out.

  4. vrano714 commented on Nov 6, 2025

    @vrano714

    Hi, I have been facing the same problem.
    In my case, the following code just worked.
    Resizing to (W_A, H_A) ended in an error (array index out of range), so I used (W, H) instead.

        H_A, W_A, _ = imA.shape
        H, W = certainties_max.shape
    
        # very dirty, but it just worked for me
        tmp = []
        import cv2
        for imB in imB_compound:
            tmp.append(
                cv2.resize(imB, (W, H))
            )
        imB_compound = tmp
    
        # Convert matches to pixel coordinates
        kptsA, kptsB = roma_model.to_pixel_coordinates(
            matches, W_A, H_A, H, W  # W, H
        )

    I'll be happy if there's any better workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions