Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can I get pose.mat? #11

Open
chdzhen opened this issue Sep 19, 2024 · 4 comments
Open

how can I get pose.mat? #11

chdzhen opened this issue Sep 19, 2024 · 4 comments

Comments

@chdzhen
Copy link

chdzhen commented Sep 19, 2024

'''
def create_dataloader_callback(sidelength, batch_size, query_sparsity):
train_dataset = RealEstate10k(img_root="data_download/realestate/train",
pose_root="poses/realestate/train.mat",
num_ctxt_views=opt.views, num_query_views=1, query_sparsity=192,
lpips=opt.lpips, augment=(not opt.no_data_aug))

    .....
    val_dataset = RealEstate10k(img_root="data_download/realestate/test",
                                  pose_root="poses/realestate/test.mat",
                                  num_ctxt_views=opt.views, num_query_views=1, augment=False)

'''
pose_root="poses/realestate/train.mat",
pose_root="poses/realestate/test.mat",

@yilundu
Copy link
Owner

yilundu commented Sep 19, 2024

@chdzhen
Copy link
Author

chdzhen commented Sep 19, 2024

thanks!
can you share the generate *.mat script?

@yilundu
Copy link
Owner

yilundu commented Sep 19, 2024

Yes it should be below:

import glob
from tqdm import tqdm
import numpy as np
from scipy.io import savemat


if __name__ == "__main__":
    files = glob.glob("train/*.txt")

    full_dict = {}

    for file in tqdm(files):
        # file_dict = {}
        data = np.loadtxt(file, skiprows=1)

        # if len(data.shape) == 1:
        #     continue

        # name, entry = data[:, 0], data[:, 1:]

        # for n, e in zip(name, entry):
        #     file_dict[n] = e

        base = file.split("/")[-1].split(".")[0]
        full_dict[base] = data

    savemat("train.mat", full_dict, do_compression=True)
    import pdb
    pdb.set_trace()
    print(files)

@chdzhen
Copy link
Author

chdzhen commented Oct 23, 2024

why HW set to 256, 455?

in realestate10k_dataio.py

class RealEstate10K():
    def init():
    ***
      data = np.load(dummy_img_path)
      key = list(data.keys())[0]
      im = data[key]
      print(im.shape)
      H, W = im.shape[:2]
      H, W = 256, 455
      self.H, self.W = H, W
      self.augment = augment

      self.square_crop = square_crop

      xscale = W / min(H, W)
      yscale = H / min(H, W)

      dim = min(H, W)

      self.xscale = xscale
      self.yscale = yscale

      # For now the images are already square cropped
      self.H = 256
      self.W = 455
    ***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants