Commit f0cc83d0 authored by Vishnu Banna's avatar Vishnu Banna
Browse files

model

parent 91fafd7b
...@@ -237,7 +237,7 @@ class Parser(parser.Parser): ...@@ -237,7 +237,7 @@ class Parser(parser.Parser):
affine=affine, affine=affine,
shuffle_boxes=False, shuffle_boxes=False,
area_thresh=self._area_thresh, area_thresh=self._area_thresh,
augment=True, filter_and_clip_boxes=True,
seed=self._seed) seed=self._seed)
classes = tf.gather(classes, inds) classes = tf.gather(classes, inds)
info = infos[-1] info = infos[-1]
...@@ -286,7 +286,8 @@ class Parser(parser.Parser): ...@@ -286,7 +286,8 @@ class Parser(parser.Parser):
# Clip and clean boxes. # Clip and clean boxes.
image = image / 255.0 image = image / 255.0
boxes, inds = preprocessing_ops.transform_and_clip_boxes( boxes, inds = preprocessing_ops.transform_and_clip_boxes(
boxes, infos, shuffle_boxes=False, area_thresh=0.0, augment=True) boxes, infos, shuffle_boxes=False, area_thresh=0.0,
filter_and_clip_boxes=False)
classes = tf.gather(classes, inds) classes = tf.gather(classes, inds)
info = infos[-1] info = infos[-1]
......
...@@ -179,7 +179,7 @@ class Mosaic: ...@@ -179,7 +179,7 @@ class Mosaic:
infos, infos,
area_thresh=self._area_thresh, area_thresh=self._area_thresh,
shuffle_boxes=False, shuffle_boxes=False,
augment=True, filter_and_clip_boxes=True,
seed=self._seed) seed=self._seed)
classes, is_crowd, area = self._select_ind(inds, classes, is_crowd, area) # pylint:disable=unbalanced-tuple-unpacking classes, is_crowd, area = self._select_ind(inds, classes, is_crowd, area) # pylint:disable=unbalanced-tuple-unpacking
return image, boxes, classes, is_crowd, area, crop_points return image, boxes, classes, is_crowd, area, crop_points
......
...@@ -839,7 +839,7 @@ def transform_and_clip_boxes(boxes, ...@@ -839,7 +839,7 @@ def transform_and_clip_boxes(boxes,
shuffle_boxes=False, shuffle_boxes=False,
area_thresh=0.1, area_thresh=0.1,
seed=None, seed=None,
augment=True): filter_and_clip_boxes=True):
"""Clips and cleans the boxes. """Clips and cleans the boxes.
Args: Args:
...@@ -870,12 +870,8 @@ def transform_and_clip_boxes(boxes, ...@@ -870,12 +870,8 @@ def transform_and_clip_boxes(boxes,
# Make sure all boxes are valid to start, clip to [0, 1] and get only the # Make sure all boxes are valid to start, clip to [0, 1] and get only the
# valid boxes. # valid boxes.
# if output_size is None:
# output_size = tf.cast([640, 640], tf.float32)
# else:
# output_size = tf.cast(output_size, tf.float32)
output_size = None output_size = None
if augment: if filter_and_clip_boxes:
boxes = tf.math.maximum(tf.math.minimum(boxes, 1.0), 0.0) boxes = tf.math.maximum(tf.math.minimum(boxes, 1.0), 0.0)
cond = get_valid_boxes(boxes) cond = get_valid_boxes(boxes)
...@@ -924,7 +920,7 @@ def transform_and_clip_boxes(boxes, ...@@ -924,7 +920,7 @@ def transform_and_clip_boxes(boxes,
boxes *= tf.cast(tf.expand_dims(cond, axis=-1), boxes.dtype) boxes *= tf.cast(tf.expand_dims(cond, axis=-1), boxes.dtype)
# Threshold the existing boxes. # Threshold the existing boxes.
if augment: if filter_and_clip_boxes:
if output_size is not None: if output_size is not None:
boxes_ = bbox_ops.denormalize_boxes(boxes, output_size) boxes_ = bbox_ops.denormalize_boxes(boxes, output_size)
box_history_ = bbox_ops.denormalize_boxes(box_history, output_size) box_history_ = bbox_ops.denormalize_boxes(box_history, output_size)
......
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