matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.74k stars 11.71k forks source link

Does data augmentation works for VGG Segmentations ? (model.train, augmentation=augmentation) #1229

Open nayzen opened 5 years ago

nayzen commented 5 years ago

Hi everyone! Firstly, thank you for this repo, it is amazing. I have 134 classes (for about 2800 photos --- 21 photos / classe). I used VGG image annotator tool to do my annotations (2800 segmentations...) segment

I have quite good results bu I would like to augment my database using the augmentation parameter below (in model.train) if the segmentations will be augmented too ?

augmentation

My segmentations are coordinates in a .JSON file and I would like to do like the Imgaug example below:

example_segmaps

Except if the augmentation parameter already does what I want.. Waiting for your help.. Thanks !

bilgan commented 5 years ago

Yes, it does what you want.

eyildiz-ugoe commented 5 years ago

I try to do the same, but I get:

Traceback (most recent call last):
  File "script.py", line 539, in <module>
    train(model)
  File "script.py", line 248, in train
    layers='heads', augmentation=augmentation)
NameError: name 'augmentation' is not defined

Does anyone know why it doesn't work?

nayzen commented 5 years ago

@eyildiz-ugoe You need to define "augmentation" before. Like in this example :

augmentation

Regards, Antoine

nikhil-occipitaltech commented 5 years ago

@nayzen Hey man, your solution works. But how exactly, is something I am struggling to grasp. Augmentating the images is not that big of a deal but how excatly the related json with the the contour points is getting modified?

nayzen commented 5 years ago

Hey @nikhil-occipitaltech , I don't really know how the contour points is getting modified and I'm interested in finding out as well. But it seems that the imgaug library does automatically this task.

nikhil-occipitaltech commented 5 years ago

@nayzen I am trusting it to be correct.