yucornetto/MGMatting

How to implement the Realworld augmentations?

Closed this issue · 6 comments

In your paper, you mention that "we also apply re-JEPGing, gaussian blur, and gaussian noises to the input image to make the model better adapt to real-world noises which are rarely seen in the synthetic dataset.". I wonder how to implement them.
In my opinion:
"re-JEPGing": read the image and use "cv2.imencode('.jpg', img)" operation?
"gaussian blur": use "cv2.GaussianBlur(img, kernel_size, sigma)" operation, how to set the kerner_size and sigma values?
"gaussian noises": use "np.random.normal(mean, sigma, (h, w))" operation?

Could you share some details about the realworld augmentations?

Hi, we just updated the code-base with real-world augmentations, you can refer to data_generator.py for more details. Bascially we use the library imgaug to simulate real-world noises.

thanks!

@yucornetto The augmentation values provided are quite harsh. They significantly degrade the image at times and change the foreground tones noticeably, which is a problem as they are applied on the composted image and fg needs to be predicted. These can cause the model performance to degrade. Can you confirm if these are the correct values?

eg) before and after
Screenshot 2021-06-24 at 6 33 20 PM

@yucornetto The augmentation values provided are quite harsh. They significantly degrade the image at times and change the foreground tones noticeably, which is a problem as they are applied on the composted image and fg needs to be predicted. These can cause the model performance to degrade. Can you confirm if these are the correct values?

eg) before and after
Screenshot 2021-06-24 at 6 33 20 PM

They are random when generating real-world augmentation, so they can be weak or strong. You can try run multiple times to see if it looks okay.

Yes, have done that and frequently they are severe.

Yes, have done that and frequently they are severe.

Our settings were developed on DIM dataset, where there might not be many noises since it is totally synthetic. Feel free to adjust any aug parameter based on your data :)