Commit 32b9a9e8 authored by Yuxin Wu's avatar Yuxin Wu

use lighting aug in resnet

parent 44de964a
...@@ -163,9 +163,14 @@ def get_data(train_or_test): ...@@ -163,9 +163,14 @@ def get_data(train_or_test):
Resize(), Resize(),
imgaug.RandomOrderAug( imgaug.RandomOrderAug(
[imgaug.Brightness(30, clip=False), [imgaug.Brightness(30, clip=False),
imgaug.Gamma(),
imgaug.Contrast((0.8, 1.2), clip=False), imgaug.Contrast((0.8, 1.2), clip=False),
imgaug.Saturation(0.4)]), imgaug.Saturation(0.4),
imgaug.Lighting(0.1,
eigval=[0.2175, 0.0188, 0.0045],
eigvec=[[ -0.5675, 0.7192, 0.4009],
[ -0.5808, -0.0045, -0.8140],
[ -0.5836, -0.6948, 0.4203]]
)]),
imgaug.Clip(), imgaug.Clip(),
imgaug.Flip(horiz=True), imgaug.Flip(horiz=True),
imgaug.MapImage(lambda x: (x * (1.0 / 255) - image_mean) / image_std), imgaug.MapImage(lambda x: (x * (1.0 / 255) - image_mean) / image_std),
......
...@@ -7,7 +7,7 @@ import numpy as np ...@@ -7,7 +7,7 @@ import numpy as np
import cv2 import cv2
__all__ = ['Brightness', 'Contrast', 'MeanVarianceNormalize', 'GaussianBlur', __all__ = ['Brightness', 'Contrast', 'MeanVarianceNormalize', 'GaussianBlur',
'Gamma', 'Clip', 'Saturation'] 'Gamma', 'Clip', 'Saturation', 'Lighting']
class Brightness(ImageAugmentor): class Brightness(ImageAugmentor):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment