kwea123/CasMVSNet_pl

Testing on DTU

NoOneUST opened this issue · 1 comments

I only found the training and validation set of DTU from the readme file https://drive.google.com/file/d/1eDjh-_bxKKnEuz5h-HXS7EDJn59clx6V/view. Now I can train and validate the model, but when I try to run the testing code, there is an error:

FileNotFoundError: [Errno 2] No such file or directory: '/export/data/lwangcg/CasMVSNet_pl/dtu_training/mvs_training/dtu/Rectified/scan4/rect_032_3_r5000.png'

I found that in /dtu/Rectified/, there is no folder with the name scanx. But in /dtu/Eval, Rectified.zip contains such folders, thus I unzip it and move these folders to /dtu/Rectified/. Then these errors disappear, but another problem appears:

depths = batch['depths'], KeyError: 'depths'

I notice that in dtu.py, the returned batch has no attribute 'depths' while testing, but when training it has. I do not know how to make the testing code run now. Could you kindly give me some help?

Since there is no depth metric evaluation, I omitted reading GT depth in testing as it is not used anywhere. If you'd like to compare the depths, you can add reading here

else:
img_filename = os.path.join(self.root_dir,
f'Rectified/{scan}/rect_{vid+1:03d}_{light_idx}_r5000.png')

and here
if self.img_wh is None:
sample['masks'] = self.read_mask(mask_filename)
sample['depths'] = self.read_depth(depth_filename)

(add else below and resize the depth according to self.img_wh)

By default the evaluation only creates depths and merge them into a point cloud, but doesn't contain any metric evaluation.
An example command would be

python eval.py \
--dataset_name dtu \
--split test \
--ckpt_path $CKPT \

You can refer to https://github.com/kwea123/CasMVSNet_pl/tree/master/evaluations and the options in https://github.com/kwea123/CasMVSNet_pl/blob/master/eval.py