eric-yyjau/pytorch-superpoint

Custom Dataset

Closed this issue · 1 comments

How do I prepare the custom dataset for training this model?

Hi @Zumbalamambo ,

Good question. Basically you need to do step 2), 3) to train your model.
Step 2) help you export the pseudo ground truth.

Good new is that both steps use the same data loader.
I'll suggest you to modify from Kitti_inh.py (https://github.com/eric-yyjau/pytorch-superpoint/blob/master/datasets/Kitti_inh.py), which is inherited from Coco.py.

You need to prepare several things: (let's use kitti dataset as an example)

  1. the dataset it self
  2. the train/val split txt files

Then start to edit the dataloader:

def crawl_folders(self, sequence_length):

Edit to fit your dataset, so that you can get image paths (
image_paths = [str(p) for p in image_paths]
), scene_name and name (
sample_fix["scene_name"] = str(sample["scene_name"])
) can help you save the exported labels.

KITTI dataloader is over-complicated as it is used for other applications as well. You can ignore things unrelated to images and folders.

====== After step (2) ======
Assume you get the labels exported. You can specify the path for labels, then do step (3) to train the model!

Hope this helps.