Commit cddca55f authored by Yuxin Wu's avatar Yuxin Wu

fix imports

parent 32b9a9e8
...@@ -16,7 +16,7 @@ from tensorpack.tfutils.symbolic_functions import * ...@@ -16,7 +16,7 @@ from tensorpack.tfutils.symbolic_functions import *
from tensorpack.tfutils.summary import * from tensorpack.tfutils.summary import *
""" """
Training code of ResNet on ImageNet. Work In Progress. Training code of Pre-Activation version of ResNet on ImageNet. Work In Progress.
Top1 error is now about 0.5% higher than fb.resnet.torch. Top1 error is now about 0.5% higher than fb.resnet.torch.
""" """
...@@ -136,11 +136,9 @@ def get_data(train_or_test): ...@@ -136,11 +136,9 @@ def get_data(train_or_test):
image_std = np.array([0.229, 0.224, 0.225], dtype='float32') image_std = np.array([0.229, 0.224, 0.225], dtype='float32')
if isTrain: if isTrain:
class Resize(imgaug.ImageAugmentor): def resize_func(img):
def __init__(self): # crop 8%~100% of the original image
self._init(locals()) # See `Going Deeper with Convolutions` by Google.
def _augment(self, img, _):
# fbaug
h, w = img.shape[:2] h, w = img.shape[:2]
area = h * w area = h * w
for _ in range(10): for _ in range(10):
...@@ -160,7 +158,7 @@ def get_data(train_or_test): ...@@ -160,7 +158,7 @@ def get_data(train_or_test):
return out return out
augmentors = [ augmentors = [
Resize(), imgaug.MapImage(resize_func),
imgaug.RandomOrderAug( imgaug.RandomOrderAug(
[imgaug.Brightness(30, clip=False), [imgaug.Brightness(30, clip=False),
imgaug.Contrast((0.8, 1.2), clip=False), imgaug.Contrast((0.8, 1.2), clip=False),
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# Author: Yuxin Wu <ppwwyyxxc@gmail.com> # Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import tensorflow as tf import tensorflow as tf
import re
__all__ = ['get_current_tower_context', 'TowerContext'] __all__ = ['get_current_tower_context', 'TowerContext']
......
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