未验证 提交 b763ca32 编写于 作者: W Wei Shengyu 提交者: GitHub

Merge pull request #771 from cuicheng01/develop_reg

Fix bug of image transforms
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,7 +77,9 @@ DataLoader: ...@@ -77,7 +77,9 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
size: 224 resize_short: 320
- CropImage:
size: 299
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
mean: [0.485, 0.456, 0.406] mean: [0.485, 0.456, 0.406]
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -75,6 +76,8 @@ DataLoader: ...@@ -75,6 +76,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -75,6 +76,8 @@ DataLoader: ...@@ -75,6 +76,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -75,6 +76,8 @@ DataLoader: ...@@ -75,6 +76,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -52,6 +53,7 @@ DataLoader: ...@@ -52,6 +53,7 @@ DataLoader:
size: 224 size: 224
- RandFlipImage: - RandFlipImage:
flip_code: 1 flip_code: 1
- AutoAugment:
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
mean: [0.485, 0.456, 0.406] mean: [0.485, 0.456, 0.406]
...@@ -75,6 +77,8 @@ DataLoader: ...@@ -75,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -75,6 +76,8 @@ DataLoader: ...@@ -75,6 +76,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -75,6 +76,8 @@ DataLoader: ...@@ -75,6 +76,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -75,6 +76,8 @@ DataLoader: ...@@ -75,6 +76,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -75,6 +76,8 @@ DataLoader: ...@@ -75,6 +76,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -75,6 +76,8 @@ DataLoader: ...@@ -75,6 +76,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -24,6 +24,7 @@ Loss: ...@@ -24,6 +24,7 @@ Loss:
Train: Train:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
epsilon: 0.1
Eval: Eval:
- CELoss: - CELoss:
weight: 1.0 weight: 1.0
...@@ -75,6 +76,8 @@ DataLoader: ...@@ -75,6 +76,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -17,7 +17,7 @@ Global: ...@@ -17,7 +17,7 @@ Global:
# model architecture # model architecture
Arch: Arch:
name: "ResNet101_vd" name: "ResNet34_vd"
# loss function config for traing/eval process # loss function config for traing/eval process
Loss: Loss:
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -77,6 +77,8 @@ DataLoader: ...@@ -77,6 +77,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -75,6 +75,8 @@ DataLoader: ...@@ -75,6 +75,8 @@ DataLoader:
cls_label_path: "./dataset/ILSVRC2012/val_list.txt" cls_label_path: "./dataset/ILSVRC2012/val_list.txt"
transform_ops: transform_ops:
- ResizeImage: - ResizeImage:
resize_short: 256
- CropImage:
size: 224 size: 224
- NormalizeImage: - NormalizeImage:
scale: 0.00392157 scale: 0.00392157
......
...@@ -30,13 +30,18 @@ from .common_dataset import CommonDataset ...@@ -30,13 +30,18 @@ from .common_dataset import CommonDataset
class ImageNetDataset(CommonDataset): class ImageNetDataset(CommonDataset):
def _load_anno(self): def _load_anno(self, seed=None):
assert os.path.exists(self._cls_path) assert os.path.exists(self._cls_path)
assert os.path.exists(self._img_root) assert os.path.exists(self._img_root)
self.images = [] self.images = []
self.labels = [] self.labels = []
with open(self._cls_path) as fd: with open(self._cls_path) as fd:
lines = fd.readlines() lines = fd.readlines()
if seed is not None:
np.random.RandomState(seed).shuffle(lines)
else:
np.random.shuffle(lines)
for l in lines: for l in lines:
l = l.strip().split(" ") l = l.strip().split(" ")
self.images.append(os.path.join(self._img_root, l[0])) self.images.append(os.path.join(self._img_root, l[0]))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册