Commit d4b61ba9 authored by anivegesana's avatar anivegesana
Browse files

Punctuation

parent 085ca13e
...@@ -67,7 +67,7 @@ class Parser(parser.Parser): ...@@ -67,7 +67,7 @@ class Parser(parser.Parser):
max_level: `int` number of maximum level of the output feature pyramid. max_level: `int` number of maximum level of the output feature pyramid.
masks: a `Tensor`, `List` or `numpy.ndarray` for anchor masks. masks: a `Tensor`, `List` or `numpy.ndarray` for anchor masks.
max_process_size: an `int` for maximum image width and height. max_process_size: an `int` for maximum image width and height.
min_process_size: an `int` for minimum image width and height , min_process_size: an `int` for minimum image width and height.
max_num_instances: an `int` number of maximum number of instances in an max_num_instances: an `int` number of maximum number of instances in an
image. image.
random_flip: a `bool` if True, augment training with random horizontal random_flip: a `bool` if True, augment training with random horizontal
......
...@@ -3,7 +3,7 @@ import tensorflow as tf ...@@ -3,7 +3,7 @@ import tensorflow as tf
def rm_nan_inf(x, val=0.0): def rm_nan_inf(x, val=0.0):
"""Remove nan and infinity """Remove nan and infinity.
Args: Args:
x: any `Tensor` of any type. x: any `Tensor` of any type.
......
...@@ -379,9 +379,9 @@ def segment_nms(boxes, classes, confidence, k, iou_thresh): ...@@ -379,9 +379,9 @@ def segment_nms(boxes, classes, confidence, k, iou_thresh):
too similar, the closer to 1.0 the less that gets through. too similar, the closer to 1.0 the less that gets through.
Return: Return:
boxes: filtered `Tensor` of shape [batch size, k, 4] boxes: filtered `Tensor` of shape [batch size, k, 4].
classes: filtered `Tensor` of shape [batch size, k, num_classes] t classes: filtered `Tensor` of shape [batch size, k, num_classes].
confidence: filtered `Tensor` of shape [batch size, k] confidence: filtered `Tensor` of shape [batch size, k].
""" """
mrange = tf.range(k) mrange = tf.range(k)
mask_x = tf.tile( mask_x = tf.tile(
...@@ -433,9 +433,9 @@ def nms(boxes, ...@@ -433,9 +433,9 @@ def nms(boxes,
before NMS. before NMS.
Return: Return:
boxes: filtered `Tensor` of shape [batch size, k, 4] boxes: filtered `Tensor` of shape [batch size, k, 4].
classes: filtered `Tensor` of shape [batch size, k, num_classes] classes: filtered `Tensor` of shape [batch size, k, num_classes].
confidence: filtered `Tensor` of shape [batch size, k] confidence: filtered `Tensor` of shape [batch size, k].
""" """
# sort the boxes # sort the boxes
......
...@@ -194,11 +194,11 @@ def get_best_anchor(y_true, anchors, width=1, height=1): ...@@ -194,11 +194,11 @@ def get_best_anchor(y_true, anchors, width=1, height=1):
"""Gets the correct anchor that is assoiciated with each box using IOU. """Gets the correct anchor that is assoiciated with each box using IOU.
Args: Args:
y_true: tf.Tensor[] for the list of bounding boxes in the yolo format y_true: `tf.Tensor[]` for the list of bounding boxes in the yolo format.
anchors: list or tensor for the anchor boxes to be used in prediction anchors: list or tensor for the anchor boxes to be used in prediction
found via Kmeans found via Kmeans.
width: int for the image width width: int for the image width.
height: int for the image height height: int for the image height.
Returns: Returns:
tf.Tensor: y_true with the anchor associated with each ground truth tf.Tensor: y_true with the anchor associated with each ground truth
...@@ -263,7 +263,7 @@ def build_grided_gt(y_true, mask, size, dtype, use_tie_breaker): ...@@ -263,7 +263,7 @@ def build_grided_gt(y_true, mask, size, dtype, use_tie_breaker):
Args: Args:
y_true: tf.Tensor[] ground truth y_true: tf.Tensor[] ground truth
[box coords[0:4], classes_onehot[0:-1], best_fit_anchor_box] [box coords[0:4], classes_onehot[0:-1], best_fit_anchor_box].
mask: list of the anchor boxes choresponding to the output, mask: list of the anchor boxes choresponding to the output,
ex. [1, 2, 3] tells this layer to predict only the first 3 ex. [1, 2, 3] tells this layer to predict only the first 3
anchors in the total. anchors in the total.
...@@ -273,7 +273,7 @@ def build_grided_gt(y_true, mask, size, dtype, use_tie_breaker): ...@@ -273,7 +273,7 @@ def build_grided_gt(y_true, mask, size, dtype, use_tie_breaker):
use_tie_breaker: boolean value for wether or not to use the tie_breaker. use_tie_breaker: boolean value for wether or not to use the tie_breaker.
Returns: Returns:
tf.Tensor[] of shape [size, size, #of_anchors, 4, 1, num_classes] tf.Tensor[] of shape [size, size, #of_anchors, 4, 1, num_classes].
""" """
# unpack required components from the input ground truth # unpack required components from the input ground truth
boxes = tf.cast(y_true['bbox'], dtype) boxes = tf.cast(y_true['bbox'], dtype)
...@@ -391,18 +391,18 @@ def build_batch_grided_gt(y_true, mask, size, dtype, use_tie_breaker): ...@@ -391,18 +391,18 @@ def build_batch_grided_gt(y_true, mask, size, dtype, use_tie_breaker):
Args: Args:
y_true: tf.Tensor[] ground truth y_true: tf.Tensor[] ground truth
[batch, box coords[0:4], classes_onehot[0:-1], best_fit_anchor_box] [batch, box coords[0:4], classes_onehot[0:-1], best_fit_anchor_box].
mask: list of the anchor boxes choresponding to the output, mask: list of the anchor boxes choresponding to the output,
ex. [1, 2, 3] tells this layer to predict only the first 3 anchors ex. [1, 2, 3] tells this layer to predict only the first 3 anchors
in the total. in the total.
size: the dimensions of this output, for regular, it progresses from size: the dimensions of this output, for regular, it progresses from
13, to 26, to 52 13, to 26, to 52.
dtype: expected output datatype dtype: expected output datatype.
use_tie_breaker: boolean value for wether or not to use the tie use_tie_breaker: boolean value for whether or not to use the tie
breaker breaker.
Returns: Returns:
tf.Tensor[] of shape [batch, size, size, #of_anchors, 4, 1, num_classes] tf.Tensor[] of shape [batch, size, size, #of_anchors, 4, 1, num_classes].
""" """
# unpack required components from the input ground truth # unpack required components from the input ground truth
boxes = tf.cast(y_true['bbox'], dtype) boxes = tf.cast(y_true['bbox'], dtype)
...@@ -521,4 +521,3 @@ def build_batch_grided_gt(y_true, mask, size, dtype, use_tie_breaker): ...@@ -521,4 +521,3 @@ def build_batch_grided_gt(y_true, mask, size, dtype, use_tie_breaker):
update = update.stack() update = update.stack()
full = tf.tensor_scatter_nd_update(full, update_index, update) full = tf.tensor_scatter_nd_update(full, update_index, update)
return full return full
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