Augmentor icon indicating copy to clipboard operation
Augmentor copied to clipboard

how to use ground_truth?

Open zhaoxin111 opened this issue 6 years ago • 10 comments

Hi, It is a very nice job !

here I have some confusion about the usage of ground_truth.

I want to augment the image and it's masks(here every image has two different mask ) simultaneously, How can I realize the idea with ground_truth?

show me some example will be excellent

thank you

zhaoxin111 avatar Apr 23 '18 08:04 zhaoxin111

Hi @zhaoxin111, yes this is something I am working on - it's been requested a few times so it seems to be functionality that many people would find useful. So I'll try to make it a priority and get it added soon.

mdbloice avatar Apr 23 '18 08:04 mdbloice

Hello @mdbloice , I am working on a image segmentation task where each image has only one mask. I succeeded augmenting both data and masks by adding p.ground_truth("ground_truth_path") and then p.sample(N), which will automatically produce the augmented images and masks and store them in "output" folder.

However, when I try "Augmentor.Pipeline.keras_generator()". It seems that this function can only return a generator with a one-hot encoded label as image labels instead of a whole mask.

It would be very kind of you to improve this feature in "keras_generator()" also. Thank you!

ChenWentai avatar May 11 '18 14:05 ChenWentai

Is there any way to transform a pair of images (image + ground truth) on the fly without saving them on a disk?

tamkaho avatar May 14 '18 10:05 tamkaho

@tamkaho Hello tamkaho, augmentation applied both on images and ground truth(without saving them to disk) can be achieved by keras.preprocessing.image.ImageDataGenerator(), and then use flow() or flow_from_directory() method. A detail example can be found in keras documents: https://keras.io/preprocessing/image/

I have already implemented this in my own project. But I would like to use Augmentor library to do it , ,because for my own dataset, this augmentation effect is better than the keras built-in library I mentioned above.

ChenWentai avatar May 21 '18 15:05 ChenWentai

Hello, @ChenWentai, I am also want to augment the image and its ground truth annotation simultaneously, but the ground truth is bounding box for me . I wonder whether your mask annotations are in COCO json format. If so, can you share me your processing procedure about augmenting both the image and its ground truth annotation as refer? Thanks in advance!

blateyang avatar Jun 14 '18 05:06 blateyang

@ChenWentai Hi there, In your ground_truth directory, does it contain images and bounding box coordinate (mask) text files? It sounds like you applied transformation to image and also to the location of bounding box (mask) in augmentation. Can you elaborate?

jaelim avatar Sep 07 '18 16:09 jaelim

@blateyang @jaelim Hello, I was using Warwick-QU dataset and my ground truth is the labeling of objects: 0 for background and 1 for objects. So it does not contain any bounding box. Sorry I cannot help in this case!

ChenWentai avatar Sep 08 '18 21:09 ChenWentai

It doesn't matter. I'll try to make bbox ground_truth by myself.

At 2018-09-09 05:09:24, "CHEN Wentai" [email protected] wrote:

@blateyang@jaelim Hello, I was using Warwick-QU dataset and my ground truth is the labeling of objects: 0 for background and 1 for objects. So it does not contain any bounding box. Sorry I cannot help in this case!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

blateyang avatar Sep 09 '18 01:09 blateyang

@ChenWentai @blateyang I found out what mask (an example of this is shown in the repo) is; it is not a bounding-box (as in object detection model) as I incorrectly assumed.

jaelim avatar Sep 17 '18 18:09 jaelim

@ChenWentai my annotation was generated using makesense.ai which is formatted as coco or vgg json format, is that possible to user ground_truth to augment my own dataset?

zendi014 avatar Apr 30 '23 10:04 zendi014