Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Fix typos #11

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions lib/cmake/Cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# This cmake file is called from Dependencies.cmake. You do not need to
# manually invoke it.

# Known NVIDIA GPU achitectures Caffe2 can be compiled for.
# Default is set to cuda 9. If we detect the cuda architectores to be less than
# Known NVIDIA GPU architectures Caffe2 can be compiled for.
# Default is set to cuda 9. If we detect the cuda architectures to be less than
# 9, we will lower it to the corresponding known archs.
set(Caffe2_known_gpu_archs "30 35 50 52 60 61 70") # for CUDA 9.x
set(Caffe2_known_gpu_archs8 "20 21(20) 30 35 50 52 60 61") # for CUDA 8.x
Expand Down Expand Up @@ -197,7 +197,7 @@ else()
message(FATAL_ERROR "Cannot find libnvrtc.so. Please file an issue on https://github.com/caffe2/caffe2 with your build output.")
endif()

# disable some nvcc diagnostic that apears in boost, glog, glags, opencv, etc.
# disable some nvcc diagnostic that appears in boost, glog, glags, opencv, etc.
foreach(diag cc_clobber_ignored integer_sign_change useless_using_declaration set_but_not_used)
list(APPEND CUDA_NVCC_FLAGS -Xcudafe --diag_suppress=${diag})
endforeach()
Expand Down
10 changes: 5 additions & 5 deletions lib/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
__C.TEST.KPS_AUG.SCALE_SIZE_DEP = False
__C.TEST.KPS_AUG.AREA_TH = 180**2

# Eeach aspect ratio is realtive to image width
# Each aspect ratio is relative to image width
__C.TEST.KPS_AUG.ASPECT_RATIOS = ()

# Horizontal flip at each aspect ratio
Expand Down Expand Up @@ -663,7 +663,7 @@
# ---------------------------------------------------------------------------- #
__C.RPN = AttrDict()

# [Infered value; do not set directly in a config]
# [Inferred value; do not set directly in a config]
# Indicates that the model contains an RPN subnetwork
__C.RPN.RPN_ON = False

Expand Down Expand Up @@ -836,7 +836,7 @@
# the minibatch is discarded)
__C.KRCNN.MIN_KEYPOINT_COUNT_FOR_VALID_MINIBATCH = 20

# When infering the keypoint locations from the heatmap, don't scale the heatmap
# When inferring the keypoint locations from the heatmap, don't scale the heatmap
# below this minimum size
__C.KRCNN.INFERENCE_MIN_SIZE = 0

Expand Down Expand Up @@ -972,7 +972,7 @@
# If an option is removed from the code and you don't want to break existing
# yaml configs, you can add the full config key as a string to the set below.
# ---------------------------------------------------------------------------- #
_DEPCRECATED_KEYS = set(
_DEPRECATED_KEYS = set(
(
'FINAL_MSG',
'MODEL.DILATION',
Expand Down Expand Up @@ -1118,7 +1118,7 @@ def _merge_a_into_b(a, b, stack=None):


def _key_is_deprecated(full_key):
if full_key in _DEPCRECATED_KEYS:
if full_key in _DEPRECATED_KEYS:
logger.warn(
'Deprecated config key (ignoring): {}'.format(full_key)
)
Expand Down
2 changes: 1 addition & 1 deletion lib/core/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def im_detect_keypoints_aspect_ratio(
):
"""Detects keypoints at the given width-relative aspect ratio."""

# Perform keypoint detectionon the transformed image
# Perform keypoint detection on the transformed image
im_ar = image_utils.aspect_ratio_rel(im, aspect_ratio)
boxes_ar = box_utils.aspect_ratio(boxes, aspect_ratio)

Expand Down
2 changes: 1 addition & 1 deletion lib/modeling/FPN.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def add_fpn_onto_conv_body(
):
"""Add the specified conv body to the model and then add FPN levels to it.
"""
# Note: blobs_conv is in revsersed order: [fpn5, fpn4, fpn3, fpn2]
# Note: blobs_conv is in reversed order: [fpn5, fpn4, fpn3, fpn2]
# similarly for dims_conv: [2048, 1024, 512, 256]
# similarly for spatial_scales_fpn: [1/32, 1/16, 1/8, 1/4]

Expand Down
2 changes: 1 addition & 1 deletion lib/modeling/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def AffineChannel(self, blob_in, blob_out, share_with=None, inplace=False):
return self.net.AffineChannel([blob_in, scale, bias], blob_out)

def GenerateProposals(self, blobs_in, blobs_out, anchors, spatial_scale):
"""Op for generating RPN porposals.
"""Op for generating RPN proposals.

blobs_in:
- 'rpn_cls_probs': 4D tensor of shape (N, A, H, W), where N is the
Expand Down
8 changes: 4 additions & 4 deletions lib/modeling/name_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@


_RENAME = {
# Removed "ResNet_" from the name because it wasn't relevent
# Removed "ResNet_" from the name because it wasn't relevant
'mask_rcnn_heads.ResNet_mask_rcnn_fcn_head_v1up4convs':
'mask_rcnn_heads.mask_rcnn_fcn_head_v1up4convs',
# Removed "ResNet_" from the name because it wasn't relevent
# Removed "ResNet_" from the name because it wasn't relevant
'mask_rcnn_heads.ResNet_mask_rcnn_fcn_head_v1up':
'mask_rcnn_heads.mask_rcnn_fcn_head_v1up',
# Removed "ResNet_" from the name because it wasn't relevent
# Removed "ResNet_" from the name because it wasn't relevant
'mask_rcnn_heads.ResNet_mask_rcnn_fcn_head_v0upshare':
'mask_rcnn_heads.mask_rcnn_fcn_head_v0upshare',
# Removed "ResNet_" from the name because it wasn't relevent
# Removed "ResNet_" from the name because it wasn't relevant
'mask_rcnn_heads.ResNet_mask_rcnn_fcn_head_v0up':
'mask_rcnn_heads.mask_rcnn_fcn_head_v0up',
# Removed head_builder module in favor of the more specific fast_rcnn name
Expand Down
4 changes: 2 additions & 2 deletions lib/ops/generate_proposals.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def forward(self, inputs, outputs):

# predicted probability of fg object for each RPN anchor
scores = inputs[0].data
# predicted achors transformations
# predicted anchors transformations
bbox_deltas = inputs[1].data
# input image (height, width, scale), in which scale is the scale factor
# applied to the original dataset image to get the network input image
Expand All @@ -71,7 +71,7 @@ def forward(self, inputs, outputs):
shifts = np.vstack((shift_x.ravel(), shift_y.ravel(),
shift_x.ravel(), shift_y.ravel())).transpose()

# Broacast anchors over shifts to enumerate all anchors at all positions
# Broadcast anchors over shifts to enumerate all anchors at all positions
# in the (H, W) grid:
# - add A anchors of shape (1, A, 4) to
# - K shifts of shape (K, 1, 4) to get
Expand Down
4 changes: 2 additions & 2 deletions lib/roi_data/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
##############################################################################

"""Common utility functions for RPN and RetinaNet minibtach blobs preparation.
"""Common utility functions for RPN and RetinaNet minibatch blobs preparation.
"""

from __future__ import absolute_import
Expand Down Expand Up @@ -76,7 +76,7 @@ def get_field_of_anchors(
shift_y = shift_y.ravel()
shifts = np.vstack((shift_x, shift_y, shift_x, shift_y)).transpose()

# Broacast anchors over shifts to enumerate all anchors at all positions
# Broadcast anchors over shifts to enumerate all anchors at all positions
# in the (H, W) grid:
# - add A cell anchors of shape (1, A, 4) to
# - K shifts of shape (K, 1, 4) to get
Expand Down
4 changes: 2 additions & 2 deletions lib/roi_data/fast_rcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

"""Construct minibatches for Fast R-CNN training. Handles the minibatch blobs
that are specific to Fast R-CNN. Other blobs that are generic to RPN, etc.
are handled by their respecitive roi_data modules.
are handled by their respective roi_data modules.
"""

from __future__ import absolute_import
Expand Down Expand Up @@ -52,7 +52,7 @@ def get_fast_rcnn_blob_names(is_training=True):
# targets per class
blob_names += ['bbox_targets']
# bbox_inside_weights blob: At most 4 targets per roi are active
# this binary vector sepcifies the subset of active targets
# this binary vector specifies the subset of active targets
blob_names += ['bbox_inside_weights']
blob_names += ['bbox_outside_weights']
if is_training and cfg.MODEL.MASK_ON:
Expand Down
2 changes: 1 addition & 1 deletion lib/roi_data/keypoint_rcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""Construct minibatches for Mask R-CNN training when keypoints are enabled.
Handles the minibatch blobs that are specific to training Mask R-CNN for
keypoint detection. Other blobs that are generic to RPN or Fast/er R-CNN are
handled by their respecitive roi_data modules.
handled by their respective roi_data modules.
"""

from __future__ import absolute_import
Expand Down
2 changes: 1 addition & 1 deletion lib/roi_data/mask_rcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

"""Construct minibatches for Mask R-CNN training. Handles the minibatch blobs
that are specific to Mask R-CNN. Other blobs that are generic to RPN or
Fast/er R-CNN are handled by their respecitive roi_data modules.
Fast/er R-CNN are handled by their respective roi_data modules.
"""

from __future__ import absolute_import
Expand Down
4 changes: 2 additions & 2 deletions lib/roi_data/retinanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def add_retinanet_blobs(blobs, im_scales, roidb, image_width, image_height):
loc_stride *= (cfg.MODEL.NUM_CLASSES - 1)
anchor_ind = foa.octave * num_aspect_ratios + foa.aspect
# v[:, 1] is the class label [range 0-80] if we do
# class-specfic bbox otherwise it is 0. In case of class
# class-specific bbox otherwise it is 0. In case of class
# specific, based on the label, the location of current
# anchor is class_label * 4 and then we take into account
# the anchor_ind if the anchors
Expand All @@ -153,7 +153,7 @@ def add_retinanet_blobs(blobs, im_scales, roidb, image_width, image_height):
# and length of this list is N x A where
# N = num_images, A = num_anchors for example, N = 2, A = 9
# Each element of the list has the shape 1 x 1 x H x W where H, W are
# spatial dimension of curret fpn lvl. Let a{i} denote the element
# spatial dimension of current fpn lvl. Let a{i} denote the element
# corresponding to anchor i [9 anchors total] in the list.
# The elements in the list are in order [[a0, ..., a9], [a0, ..., a9]]
# however the network will make predictions like 2 x (9 * 80) x H x W
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/keypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def get_keypoints():
"""Get the COCO keypoints and their left/right flip coorespondence map."""
"""Get the COCO keypoints and their left/right flip correspondence map."""
# Keypoints are not available in the COCO json for the test split, so we
# provide them here.
keypoints = [
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/segms.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def rle_mask_nms(masks, dets, thresh, mode='IOU'):
"""Performs greedy non-maximum suppression based on an overlap measurement
between masks. The type of measurement is determined by `mode` and can be
either 'IOU' (standard intersection over union) or 'IOMA' (intersection over
mininum area).
minimum area).
"""
if len(masks) == 0:
return []
Expand Down
2 changes: 1 addition & 1 deletion tools/pickle_caffe_blobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
##############################################################################

"""Script for converting Caffe (<= 1.0) models into the the simple state dict
format used by Detectron. For example, this script can convert the orignal
format used by Detectron. For example, this script can convert the original
ResNet models released by MSRA.
"""

Expand Down
2 changes: 1 addition & 1 deletion tools/train_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def main():
logger.info(pprint.pformat(cfg))
# Note that while we set the numpy random seed network training will not be
# deterministic in general. There are sources of non-determinism that cannot
# be removed with a reasonble execution-speed tradeoff (such as certain
# be removed with a reasonable execution-speed tradeoff (such as certain
# non-deterministic cudnn functions).
np.random.seed(cfg.RNG_SEED)
# Execute the training run
Expand Down