Image segmentation of a kaggle dataset

Hello,
in your tutorial for image segmentation: Fine-Tune a Semantic Segmentation Model with a Custom Dataset you create a dataset or choose from the hub to use with the segformer model. But if I wanted to use a kaggle dataset how should I proceed? For example how can I use this drone dataset: Aerial Semantic Segmentation Drone Dataset | Kaggle?

Hi! You can load download and extract the data archive locally and then load it as follows:

import datasets
import glob

IMAGES = glob.glob("path/to/archive/dataset/semantic_drone_dataset/original_images/*.jpg")
SEG_MAPS = glob.glob("path/to/archive/dataset/semantic_drone_dataset/label_images_semantic/*.png") 
dataset = datasets.Dataset.from_dict({"image": IMAGES, "label": SEG_MAPS}, features=datasets.Features({"image": datasets.Image(), "label": datasets.Image()}))
2 Likes

@gianlab I have started a series on object extraction (through instance sgementation) using detectron. You can watch out my blog for the next articles where I will be publishing how to train detectron2 to identify custom objects. You can read the articles here. I am using mask2former and detectron2.