提交 17677759 编写于 作者: K Kaipeng Deng 提交者: GitHub

enable yolov3 set input size with image_shape in yml (#3141)

上级 db3f7ed5
......@@ -69,6 +69,7 @@ YoloTrainFeed:
YoloEvalFeed:
batch_size: 8
image_shape: [3, 608, 608]
dataset:
dataset_dir: dataset/coco
annotation: annotations/instances_val2017.json
......@@ -76,5 +77,6 @@ YoloEvalFeed:
YoloTestFeed:
batch_size: 1
image_shape: [3, 608, 608]
dataset:
annotation: dataset/coco/annotations/instances_val2017.json
......@@ -71,6 +71,7 @@ YoloTrainFeed:
YoloEvalFeed:
batch_size: 8
image_shape: [3, 608, 608]
dataset:
dataset_dir: dataset/voc
annotation: VOCdevkit/VOC_all/ImageSets/Main/val.txt
......@@ -79,5 +80,6 @@ YoloEvalFeed:
YoloTestFeed:
batch_size: 1
image_shape: [3, 608, 608]
dataset:
use_default_label: true
......@@ -70,6 +70,7 @@ YoloTrainFeed:
YoloEvalFeed:
batch_size: 8
image_shape: [3, 608, 608]
dataset:
dataset_dir: dataset/coco
annotation: annotations/instances_val2017.json
......@@ -77,5 +78,6 @@ YoloEvalFeed:
YoloTestFeed:
batch_size: 1
image_shape: [3, 608, 608]
dataset:
annotation: dataset/coco/annotations/instances_val2017.json
......@@ -72,6 +72,7 @@ YoloTrainFeed:
YoloEvalFeed:
batch_size: 8
image_shape: [3, 608, 608]
dataset:
dataset_dir: dataset/voc
annotation: VOCdevkit/VOC_all/ImageSets/Main/val.txt
......@@ -80,5 +81,6 @@ YoloEvalFeed:
YoloTestFeed:
batch_size: 1
image_shape: [3, 608, 608]
dataset:
use_default_label: true
......@@ -72,6 +72,7 @@ YoloTrainFeed:
YoloEvalFeed:
batch_size: 8
image_shape: [3, 608, 608]
dataset:
dataset_dir: dataset/coco
annotation: annotations/instances_val2017.json
......@@ -79,5 +80,6 @@ YoloEvalFeed:
YoloTestFeed:
batch_size: 1
image_shape: [3, 608, 608]
dataset:
annotation: dataset/coco/annotations/instances_val2017.json
......@@ -74,6 +74,7 @@ YoloTrainFeed:
YoloEvalFeed:
batch_size: 8
image_shape: [3, 608, 608]
dataset:
dataset_dir: dataset/voc
annotation: VOCdevkit/VOC_all/ImageSets/Main/val.txt
......@@ -82,5 +83,6 @@ YoloEvalFeed:
YoloTestFeed:
batch_size: 1
image_shape: [3, 608, 608]
dataset:
use_default_label: true
......@@ -942,6 +942,13 @@ class YoloEvalFeed(DataFeed):
self.mode = 'VAL'
self.bufsize = 128
# support image shape config, resize image with image_shape
for i, trans in enumerate(sample_transforms):
if isinstance(trans, ResizeImage):
sample_transforms[i] = ResizeImage(
target_size=self.image_shape[-1],
interp=trans.interp)
@register
class YoloTestFeed(DataFeed):
......@@ -988,4 +995,11 @@ class YoloTestFeed(DataFeed):
use_process=use_process)
self.mode = 'TEST'
self.bufsize = 128
# support image shape config, resize image with image_shape
for i, trans in enumerate(sample_transforms):
if isinstance(trans, ResizeImage):
sample_transforms[i] = ResizeImage(
target_size=self.image_shape[-1],
interp=trans.interp)
# yapf: enable
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册