Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Commit

Permalink
fix typos (#434)
Browse files Browse the repository at this point in the history
* fix typos

* fix indentation
  • Loading branch information
tkng authored Sep 18, 2019
1 parent 314355b commit 754be11
Show file tree
Hide file tree
Showing 18 changed files with 100 additions and 100 deletions.
4 changes: 2 additions & 2 deletions lmnet/docs/source/pre_processor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pre_processor module
.. currentmodule:: pre_processor

.. automodule:: pre_processor
:members: DivideBy255, LetterBoxes, PerImageLinerQuantize, PerImageStandardization, Resize, ResizeWithGtBoxes, ResizeWithMask, per_image_linear_quantize, per_image_standardization, resize, resize_keep_ratio_with_gt_boxes, resize_with_gt_boxes, square
:members: DivideBy255, LetterBoxes, PerImageLinearQuantize, PerImageStandardization, Resize, ResizeWithGtBoxes, ResizeWithMask, per_image_linear_quantize, per_image_standardization, resize, resize_keep_ratio_with_gt_boxes, resize_with_gt_boxes, square
:undoc-members:
:show-inheritance:
:member-order: bysource
Expand All @@ -19,7 +19,7 @@ pre_processor module

DivideBy255
LetterBoxes
PerImageLinerQuantize
PerImageLinearQuantize
PerImageStandardization
Resize
ResizeWithGtBoxes
Expand Down
10 changes: 5 additions & 5 deletions lmnet/lmnet/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def activation(x): return tf.nn.leaky_relu(x, alpha=0.1, name="leaky_relu")
activation=None, use_bias=False, data_format=channel_data_format,
kernel_initializer=tf.contrib.layers.variance_scaling_initializer(),) # he initializer

# TODO(wakisaka): Should be the same as darknet batrch norm.
# TODO(wakisaka): Should be the same as darknet batch norm.
# https://github.com/tensorflow/tensorflow/blob/r1.1/tensorflow/contrib/layers/python/layers/layers.py
# https://github.com/pjreddie/darknet/blob/8215a8864d4ad07e058acafd75b2c6ff6600b9e8/src/batchnorm_layer.c#L135
batch_normed = batch_norm("bn", conv, is_training=is_training, decay=0.99, scale=True, center=True,
Expand Down Expand Up @@ -154,7 +154,7 @@ def conv_bn_act(
is_training (tf.constant): Flag if training or not for batch norm.
activation (callable): Activation function.
batch_norm_decay (float): Batch norm decay rate.
data_format (string): Fromat for inputs data. NHWC or NCHW.
data_format (string): Format for inputs data. NHWC or NCHW.
enable_detail_summary (bool): Flag for summarize feature maps for each operation on tensorboard.
Returns:
output (tf.Tensor): Output of this block.
Expand Down Expand Up @@ -276,7 +276,7 @@ def densenet_group(
data_format="NHWC",
enable_detail_summary=False,
):
"""Group of Densent blocks.
"""Group of Densenet blocks.
paper: https://arxiv.org/abs/1608.06993
In the original paper, this method is called `Dense block` which consists of some 1x1 and 3x3 conv blocks
Expand All @@ -286,7 +286,7 @@ def densenet_group(
Args:
name (str): Block name, as scope name.
inputs (tf.Tensor): Inputs.
num_blocks (int): Number of dense blocks which consits of 1x1 and 3x3 cov.
num_blocks (int): Number of dense blocks which consist of 1x1 and 3x3 conv.
growth_rate (int): How many filters (out channel) to add each layer.
bottleneck_rate (int): The factor to be calculated bottle-neck 1x1 conv output channel.
`bottleneck_channel = growth_rate * bottleneck_rate`.
Expand All @@ -296,7 +296,7 @@ def densenet_group(
activation (callable): Activation function.
batch_norm_decay (float): Batch norm decay rate.
enable_detail_summary (bool): Flag for summarize feature maps for each operation on tensorboard.
data_format (string): Fromat for inputs data. NHWC or NCHW.
data_format (string): Format for inputs data. NHWC or NCHW.
Returns:
tf.Tensor: Output of current block.
"""
Expand Down
4 changes: 2 additions & 2 deletions lmnet/lmnet/datasets/dataset_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _apply_augmentations(dataset, image, label):
else:
label = sample['label']

# FIXME(tokunaga): dataset should not have thier own data format
# FIXME(tokunaga): dataset should not have their own data format
if dataset.data_format == "NCHW":
image = np.transpose(image, [2, 0, 1])

Expand Down Expand Up @@ -177,7 +177,7 @@ def __init__(self, dataset, seed, shuffle=True):
self.data_ids = []

def _gen_ids(self, size):
"""Generate ids which's length is `size`."""
"""Generate ids which length is `size`."""
for _ in range(0, size):
# when data_ids is empty, fill and shuffle.
if len(self.data_ids) == 0:
Expand Down
2 changes: 1 addition & 1 deletion lmnet/lmnet/datasets/open_images_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def classes(self):
@property
@functools.lru_cache(maxsize=None)
def _target_labels(self):
"""Map of {csv raw label name: Be mapped taregt label name}. """
"""Map of {csv raw label name: Be mapped target label name}. """

target_labels = dict(self._make_target_labels())
return target_labels
Expand Down
2 changes: 1 addition & 1 deletion lmnet/lmnet/networks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(
):

if data_format not in ["NCHW", "NHWC"]:
raise RuntimeError("data format {} shodul be in ['NCHW', 'NHWC]'.".format(data_format))
raise RuntimeError("data format {} should be in ['NCHW', 'NHWC]'.".format(data_format))

self.is_debug = is_debug
self.optimizer_class = optimizer_class
Expand Down
2 changes: 1 addition & 1 deletion lmnet/lmnet/networks/classification/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _heatmaps(self, target_feature_map):

results = []

# shpae: [batch_size, height, width, num_classes]
# shape: [batch_size, height, width, num_classes]
heatmap = tf.image.resize_images(
target_feature_map, [self.image_size[0], self.image_size[1]],
method=tf.image.ResizeMethod.BICUBIC,
Expand Down
18 changes: 9 additions & 9 deletions lmnet/lmnet/networks/object_detection/yolo_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,10 @@ def _gt_boxes_to_cell(self, gt_boxes_list):
Return:
cell_gt_boxes: Tensor [batch_size, cell_size, cell_size, 4(center_x, center_y, w, h)].
copy from non dummy gt boxes coodinate to corresponding cell.
object_maskes: Tensor [batch_size, cell_size, cell_size, 1]. the cell that has gt boxes is 1, none is 0.
object_masks: Tensor [batch_size, cell_size, cell_size, 1]. the cell that has gt boxes is 1, none is 0.
"""
cell_gt_boxes = []
object_maskes = []
object_masks = []
for batch_index in range(self.batch_size):
i = tf.constant(0)
gt_boxes = gt_boxes_list[batch_index, :, :]
Expand All @@ -689,12 +689,12 @@ def _gt_boxes_to_cell(self, gt_boxes_list):
)

cell_gt_boxes.append(result_cell_gt_box)
object_maskes.append(result_object_mask)
object_masks.append(result_object_mask)

cell_gt_boxes = tf.stack(cell_gt_boxes)
object_maskes = tf.stack(object_maskes)
object_masks = tf.stack(object_masks)

return cell_gt_boxes, object_maskes
return cell_gt_boxes, object_masks

def __call__(self, predict_classes, predict_confidence, predict_boxes, gt_boxes):
"""Loss function.
Expand Down Expand Up @@ -830,7 +830,7 @@ def summary_boxes(tag, images, boxes, image_size, max_outputs=3):


def format_XYWH_to_CXCYWH(boxes, axis=1):
"""Format form (x, y, w, h) to (center_x, center_y, w, h) along specific dimention.
"""Format form (x, y, w, h) to (center_x, center_y, w, h) along specific dimension.
Args:
boxes :a Tensor include boxes. [:, 4(x, y, w, h)]
Expand All @@ -846,7 +846,7 @@ def format_XYWH_to_CXCYWH(boxes, axis=1):


def format_CXCYWH_to_XYWH(boxes, axis=1):
"""Format form (center_x, center_y, w, h) to (x, y, w, h) along specific dimention.
"""Format form (center_x, center_y, w, h) to (x, y, w, h) along specific dimension.
Args:
boxes: A tensor include boxes. [:, 4(x, y, w, h)]
Expand All @@ -862,7 +862,7 @@ def format_CXCYWH_to_XYWH(boxes, axis=1):


def format_CXCYWH_to_YX(inputs, axis=1):
"""Format from (x, y, w, h) to (y1, x1, y2, x2) boxes along specific dimention.
"""Format from (x, y, w, h) to (y1, x1, y2, x2) boxes along specific dimension.
Args:
inputs: a Tensor include boxes.
Expand All @@ -880,7 +880,7 @@ def format_CXCYWH_to_YX(inputs, axis=1):


def format_XYWH_to_YX(inputs, axis=1):
"""Format from (x, y, w, h) to (y1, x1, y2, x2) boxes along specific dimention.
"""Format from (x, y, w, h) to (y1, x1, y2, x2) boxes along specific dimension.
Args:
inputs: a Tensor include boxes.
Expand Down
Loading

0 comments on commit 754be11

Please sign in to comment.