Monocular-Depth-Estimation-Toolbox icon indicating copy to clipboard operation
Monocular-Depth-Estimation-Toolbox copied to clipboard

fine tune on custom dataset

Open Boraly opened this issue 3 years ago • 3 comments

Hello!

I would like to fine-tune the depthformer_swinl_22k_27 model on my custom dataset. I tried to follow the instruction but still have some issues. The main problems I have are:

  1. How should a custom config for fine-tuning look like? I tried to copy an existing one and just change the dataset to my custom one, but that doesn't function properly.
  2. How should the folder with the custom dataset be named? I was seeing different answers to this in some already solved issues and the instruction (either data/custom or data/custom_dataset)

I could share the custom files I used for my approach and the error message I got, if you want.

Thank you in advance, Boraly

Boraly avatar Sep 17 '22 17:09 Boraly

Hello Boraly,

I don't see a straightforward way to do this. You may want to change the __base__ variable in the configuration . Edit base/datasets/custom.py accordingly. Change the train_pipeline and test_pipeline in base/datasets/custom.py to the class name of your dataset (also remember to register it using @DATASETS.register_module()). Change the arguments in the data variable in base/datasets/custom.py .

If everything is done properly, the code should work. Hope you can figure out what you are missing soon.

Chun-wei-Ho avatar Sep 18 '22 10:09 Chun-wei-Ho

Okay, I got much further now. But got a KeyError. I didn't change the functions that are causing the error. Do you have an idea what the problem might be?

image

Boraly avatar Sep 18 '22 12:09 Boraly

@Chun-wei-Ho Thanks a lot for your support. I think all the notifications of adopting a custom dataset contain in your answer.

@Boraly That's an error about incorrectly loading the GT maps. It seems the dataset did not successfully read your GT data. Please check the codes and ensure that you set the correct path.

I provide my codes in my new paper repo, in which I conduct a more elegant installation of this toolbox and also include utilizing a custom dataset. See the dataset, this class inherits the custom_data and you can compare with yours.

zhyever avatar Sep 18 '22 13:09 zhyever

Close it for now. Feel free to re-open for further discussion.

zhyever avatar Nov 29 '22 08:11 zhyever