diff --git a/fluid/object_detection/image_util.py b/fluid/object_detection/image_util.py index 781932293e57c715d15f9b26ceec345b6b81cd26..e538449aa9f9ce15e7730de293a98fe753403a87 100644 --- a/fluid/object_detection/image_util.py +++ b/fluid/object_detection/image_util.py @@ -216,7 +216,7 @@ def distort_image(img, settings): def expand_image(img, bbox_labels, img_width, img_height, settings): prob = random.uniform(0, 1) - if prob < settings._hue_prob: + if prob < settings._expand_prob: expand_ratio = random.uniform(1, settings._expand_max_ratio) if expand_ratio - 1 >= 0.01: height = int(img_height * expand_ratio) diff --git a/fluid/object_detection/train.py b/fluid/object_detection/train.py index e1a4d75569153266d483b8013f89572fc2ccc274..a6c8e9e273cb2e08fc789acfdf9f92cb4e70f341 100644 --- a/fluid/object_detection/train.py +++ b/fluid/object_detection/train.py @@ -50,11 +50,12 @@ def train(args, box, box_var) nmsed_out = fluid.layers.detection_output( locs, confs, box, box_var, nms_threshold=0.45) + loss = fluid.layers.reduce_sum(loss) pd.write_output(loss) pd.write_output(nmsed_out) loss, nmsed_out = pd() - loss = fluid.layers.reduce_sum(loss) + loss = fluid.layers.mean(loss) else: locs, confs, box, box_var = mobile_net(image, image_shape) nmsed_out = fluid.layers.detection_output(