Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions official/vision/dataloaders/retinanet_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Data parser and processing for RetinaNet.

Parse image and ground truths in a dataset to training targets and package them
Parse image and ground-truths in a dataset to training targets and package them
into (image, labels) tuple for RetinaNet.
"""

Expand Down Expand Up @@ -62,7 +62,7 @@ def __init__(self,
num_scales: `int` number representing intermediate scales added on each
level. For instances, num_scales=2 adds one additional intermediate
anchor scales [2^0, 2^0.5] on each level.
aspect_ratios: `list` of float numbers representing the aspect raito
aspect_ratios: `list` of float numbers representing the aspect ratio
anchors added on each level. The number indicates the ratio of width to
height. For instances, aspect_ratios=[1.0, 2.0, 0.5] adds three anchors
on each scale level.
Expand Down Expand Up @@ -92,7 +92,7 @@ def __init__(self,
image. The groundtruth data will be padded to `max_num_instances`.
dtype: `str`, data type. One of {`bfloat16`, `float32`, `float16`}.
mode: a ModeKeys. Specifies if this is training, evaluation, prediction or
prediction with groundtruths in the outputs.
prediction with ground-truths in the outputs.
"""
self._mode = mode
self._max_num_instances = max_num_instances
Expand Down Expand Up @@ -196,7 +196,7 @@ def _parse_train_data(self, data):
offset = image_info[3, :]
boxes = preprocess_ops.resize_and_crop_boxes(boxes, image_scale,
image_info[1, :], offset)
# Filters out ground truth boxes that are all zeros.
# Filters out ground-truth boxes that are all zeros.
indices = box_ops.get_non_empty_box_indices(boxes)
boxes = tf.gather(boxes, indices)
classes = tf.gather(classes, indices)
Expand Down Expand Up @@ -267,7 +267,7 @@ def _parse_eval_data(self, data):
offset = image_info[3, :]
boxes = preprocess_ops.resize_and_crop_boxes(boxes, image_scale,
image_info[1, :], offset)
# Filters out ground truth boxes that are all zeros.
# Filters out ground-truth boxes that are all zeros.
indices = box_ops.get_non_empty_box_indices(boxes)
boxes = tf.gather(boxes, indices)
classes = tf.gather(classes, indices)
Expand All @@ -291,7 +291,7 @@ def _parse_eval_data(self, data):
# Casts input image to desired data type.
image = tf.cast(image, dtype=self._dtype)

# Sets up groundtruth data for evaluation.
# Sets up ground-truth data for evaluation.
groundtruths = {
'source_id': data['source_id'],
'height': data['height'],
Expand Down