Thank you for enjoying the article.

For Multi-class classification

Update the myMaskRCNNConfig with the number of classes based on your custom dataset

# number of classes (we would normally add +1 for the background)
# kangaroo + BG

NUM_CLASSES = 1+1

Update the code for load_dataset() to include the different classes in your dataset

# Add classes. We have only one class to add.
self.add_class(“dataset”, 1, “kangaroo”)

Update the code for load_mask() to include the different classes in your dataset

class_ids.append(self.class_names.index(‘kangaroo’))

put the images for different classes in the different folders for train, test and validation datasets

Hope this helps

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store