Skip to content

Commit

Permalink
Spelling (#47)
Browse files Browse the repository at this point in the history
Summary:
Generated by https://github.com/jsoref/spelling `f`; to maintain your repo, please consider `fchurn`
Pull Request resolved: #47

Differential Revision: D17898740

Pulled By: ppwwyyxx

fbshipit-source-id: 3dea532933e91e0bcabd9e7ab4a2c1abf2d6dd68
  • Loading branch information
jsoref authored and facebook-github-bot committed Oct 13, 2019
1 parent d01c861 commit d250fcc
Show file tree
Hide file tree
Showing 25 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ possible.
## Pull Requests
We actively welcome your pull requests.

1. Fork the repo and create your branch from \muaster`.
1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
Expand Down
2 changes: 1 addition & 1 deletion configs/Misc/scratch_mask_rcnn_R_50_FPN_3x_gn.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_BASE_: "mask_rcnn_R_50_FPN_3x_gn.yaml"
# INPUT:
# It makes sense to divide by STD when training from scratch
# But it seems to make no difference on the results and C2's models did't do this.
# But it seems to make no difference on the results and C2's models didn't do this.
# So we keep things consistent with C2.
# PIXEL_STD: [57.375, 57.12, 58.395]
MODEL:
Expand Down
2 changes: 1 addition & 1 deletion demo/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class AsyncPredictor:
"""
A predictor that runs the model asynchronously, possibly on >1 GPUs.
Because rendering the visualization takes considerably amount of time,
this helps improve thoughput when rendering videos.
this helps improve throughput when rendering videos.
"""

class _StopToken:
Expand Down
2 changes: 1 addition & 1 deletion detectron2/config/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
_C.MODEL.ROI_KEYPOINT_HEAD.POOLER_TYPE = "ROIAlignV2"

# ---------------------------------------------------------------------------- #
# Semantic Segmenation Head
# Semantic Segmentation Head
# ---------------------------------------------------------------------------- #
_C.MODEL.SEM_SEG_HEAD = CN()
_C.MODEL.SEM_SEG_HEAD.NAME = "SemSegFPNHead"
Expand Down
2 changes: 1 addition & 1 deletion detectron2/data/datasets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Common Datasets

The dataset implemented here do not need to load the data into the final format.
It should provide the minimal data strcture needed to use the dataset, so it can be very efficient.
It should provide the minimal data structure needed to use the dataset, so it can be very efficient.

For example, for an image dataset, just provide the file names and labels, but don't read the images.
Let the downstream decide how to read.
2 changes: 1 addition & 1 deletion detectron2/data/datasets/coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def load_sem_seg(gt_root, image_root, gt_ext="png", image_ext="jpg"):
# IDs, hence, we try to convert these paths to int if possible.
def file2id(folder_path, file_path):
# TODO id is not used.
# extract realtive path starting from `folder_path`
# extract relative path starting from `folder_path`
image_id = os.path.normpath(os.path.relpath(file_path, start=folder_path))
# remove file extension
image_id = os.path.splitext(image_id)[0]
Expand Down
2 changes: 1 addition & 1 deletion detectron2/data/detection_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def transform_proposals(dataset_dict, image_shape, transforms, min_box_side_len,
"proposal_boxes" and "objectness_logits".
"""
if "proposal_boxes" in dataset_dict:
# Tranform proposal boxes
# Transform proposal boxes
boxes = transforms.apply_box(
BoxMode.convert(
dataset_dict.pop("proposal_boxes"),
Expand Down
2 changes: 1 addition & 1 deletion detectron2/evaluation/cityscapes_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def evaluate(self):

self._logger.info("Evaluating results under {} ...".format(self._temp_dir))

# set some global states in cityscapes evaluation API, before evaluting
# set some global states in cityscapes evaluation API, before evaluating
cityscapes_eval.args.predictionPath = os.path.abspath(self._temp_dir)
cityscapes_eval.args.predictionWalk = None
cityscapes_eval.args.JSONOutput = False
Expand Down
2 changes: 1 addition & 1 deletion detectron2/evaluation/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def inference_on_dataset(model, data_loader, evaluator):
evaluator (DatasetEvaluator): the evaluator to run
Returns:
The return value of `evaluator.evalute()`
The return value of `evaluator.evaluate()`
"""
num_devices = torch.distributed.get_world_size() if torch.distributed.is_initialized() else 1
logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion detectron2/evaluation/pascal_voc_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PascalVOCDetectionEvaluator(DatasetEvaluator):
def __init__(self, dataset_name):
"""
Args:
dataste_name (str): name of the dataset, e.g., "voc_2007_test"
dataset_name (str): name of the dataset, e.g., "voc_2007_test"
"""
self._dataset_name = dataset_name
meta = MetadataCatalog.get(dataset_name)
Expand Down
2 changes: 1 addition & 1 deletion detectron2/evaluation/sem_seg_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def evaluate(self):

def encode_json_sem_seg(self, sem_seg, image_id):
"""
Convert semenatic segmentation to COCO stuff format with segments encoded as RLEs.
Convert semantic segmentation to COCO stuff format with segments encoded as RLEs.
See http://cocodataset.org/#format-results
"""
json_list = []
Expand Down
2 changes: 1 addition & 1 deletion detectron2/layers/csrc/ROIAlign/ROIAlign_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void pre_calc_for_bilinear_interpolate(
T hy = 1. - ly, hx = 1. - lx;
T w1 = hy * hx, w2 = hy * lx, w3 = ly * hx, w4 = ly * lx;

// save weights and indeces
// save weights and indices
PreCalc<T> pc;
pc.pos1 = y_low * width + x_low;
pc.pos2 = y_low * width + x_high;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void pre_calc_for_bilinear_interpolate(
T hy = 1. - ly, hx = 1. - lx;
T w1 = hy * hx, w2 = hy * lx, w3 = ly * hx, w4 = ly * lx;

// save weights and indeces
// save weights and indices
PreCalc<T> pc;
pc.pos1 = y_low * width + x_low;
pc.pos2 = y_low * width + x_high;
Expand Down Expand Up @@ -250,7 +250,7 @@ void ROIAlignRotatedForward(
// We do average (integral) pooling inside a bin
const T count = std::max(roi_bin_grid_h * roi_bin_grid_w, 1); // e.g. = 4

// we want to precalculate indices and weights shared by all chanels,
// we want to precalculate indices and weights shared by all channels,
// this is the key point of optimization
std::vector<PreCalc<T>> pre_calc(
roi_bin_grid_h * roi_bin_grid_w * pooled_width * pooled_height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ HOST_DEVICE_INLINE T rotated_boxes_intersection(
}

// Convex Hull to order the intersection points in clockwise order and find
// the countour area.
// the contour area.
int num_convex = convex_hull_graham<T>(intersectPts, num, orderedPts, true);
return polygon_area<T>(orderedPts, num_convex);
}
Expand Down
2 changes: 1 addition & 1 deletion detectron2/modeling/proposal_generator/proposal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def add_ground_truth_to_proposals_single_image(gt_boxes, proposals):
Same as `add_ground_truth_to_proposals`, but for only one image.
"""
device = proposals.objectness_logits.device
# Concating gt_boxes with proposals requires them to have the same fields
# Concatenating gt_boxes with proposals requires them to have the same fields
# Assign all ground-truth boxes an objectness logit corresponding to P(object) \approx 1.
gt_logit_value = math.log((1.0 - 1e-10) / (1 - (1.0 - 1e-10)))

Expand Down
2 changes: 1 addition & 1 deletion detectron2/modeling/roi_heads/cascade_rcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _init_box_head(self, cfg):
self.num_cascade_stages = len(cascade_ious)
assert len(cascade_bbox_reg_weights) == self.num_cascade_stages
assert cfg.MODEL.ROI_BOX_HEAD.CLS_AGNOSTIC_BBOX_REG, \
"CascadeROIHeads only support class-agnositc regression now!"
"CascadeROIHeads only support class-agnostic regression now!"
assert cascade_ious[0] == cfg.MODEL.ROI_HEADS.IOU_THRESHOLDS[0]
# fmt: on

Expand Down
2 changes: 1 addition & 1 deletion detectron2/structures/keypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Keypoints:
containing the x,y location and visibility flag of each keypoint. This tensor has shape
(N, K, 3) where N is the number of instances and K is the number of keypoints per instance.
The visiblity flag follows the COCO format and must be one of three integers:
The visibility flag follows the COCO format and must be one of three integers:
* v=0: not labeled (in which case x=y=0)
* v=1: labeled but not visible
* v=2: labeled and visible
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ can load an image from "file_name" if the "image" field is not available.
+ `iscrowd`: 0 or 1. Whether this instance is labeled as COCO's "crowd region".
+ `proposal_boxes` (array): 2D numpy array with shape (K, 4) representing K precomputed proposal boxes for this image.
+ `proposal_objectness_logits` (array): numpy array with shape (K, ), which corresponds to the objectness
logits of proposals in 'propopsal_boxes'.
logits of proposals in 'proposal_boxes'.
+ `proposal_bbox_mode` (int): the format of the precomputed proposal bbox.
It must be a member of
[structures.BoxMode](../modules/structures.html#detectron2.structures.BoxMode).
Expand All @@ -86,7 +86,7 @@ can load an image from "file_name" if the "image" field is not available.

If your dataset is already in the COCO format, you can simply register it by
```python
from detectron2.data.datasts import register_coco_instances
from detectron2.data.datasets import register_coco_instances
register_coco_instances("my_dataset", {}, "json_annotation.json", "path/to/image/dir")
```
which will take care of everything (including metadata) for you.
Expand Down
6 changes: 3 additions & 3 deletions projects/DensePose/densepose/densepose_coco_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def computeIoU(self, imgId, catId):

def computeOks(self, imgId, catId):
p = self.params
# dimention here should be Nxm
# dimension here should be Nxm
gts = self._gts[imgId, catId]
dts = self._dts[imgId, catId]
inds = np.argsort([-d["score"] for d in dts], kind="mergesort")
Expand Down Expand Up @@ -379,7 +379,7 @@ def computeOks(self, imgId, catId):

def computeOgps(self, imgId, catId):
p = self.params
# dimention here should be Nxm
# dimension here should be Nxm
g = self._gts[imgId, catId]
d = self._dts[imgId, catId]
inds = np.argsort([-d_["score"] for d_ in d], kind="mergesort")
Expand Down Expand Up @@ -700,7 +700,7 @@ def accumulate(self, p=None):
def summarize(self):
"""
Compute and display summary metrics for evaluation results.
Note this functin can *only* be applied on the default parameter setting
Note this function can *only* be applied on the default parameter setting
"""

def _summarize(ap=1, iouThr=None, areaRng="all", maxDets=100):
Expand Down
2 changes: 1 addition & 1 deletion projects/DensePose/densepose/roi_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _forward_densepose(self, features, instances):
densepose_head_outputs = self.densepose_head(features_dp)
densepose_outputs, _ = self.densepose_predictor(densepose_head_outputs)
else:
# If no detection occured instances
# If no detection occurred instances
# set densepose_outputs to empty tensors
empty_tensor = torch.zeros(size=(0, 0, 0, 0), device=features_dp.device)
densepose_outputs = tuple([empty_tensor] * 4)
Expand Down
4 changes: 2 additions & 2 deletions projects/DensePose/doc/TOOL_APPLY_NET.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ There are four mandatory arguments:
* `bbox` - bounding boxes of detected persons;
* `dp_segm` - segmentation masks for detected persons;
* `dp_u` - each body part is colored according to the estimated values of the
U coordinate in part parametrization;
U coordinate in part parameterization;
* `dp_v` - each body part is colored according to the estimated values of the
V coordinate in part parametrization;
V coordinate in part parameterization;
* `dp_contour` - plots contours with color-coded U and V coordinates


Expand Down
8 changes: 4 additions & 4 deletions projects/DensePose/doc/TOOL_QUERY_DB.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ There are three mandatory arguments:
* `dp_i` - annotated points colored according to the containing part;
* `dp_pts` - annotated points in green color;
* `dp_segm` - segmentation masks for annotated persons;
* `dp_u` - annotated points colored according to their U coordinate in part parametrization;
* `dp_v` - annotated points colored according to their V coordinate in part parametrization;
* `dp_u` - annotated points colored according to their U coordinate in part parameterization;
* `dp_v` - annotated points colored according to their V coordinate in part parameterization;

One can additionally provide one of the two optional arguments:
- `--max_entries` to limit the maximum number of entries to visualize
Expand Down Expand Up @@ -90,13 +90,13 @@ python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_segm
```
![Bounding Box + Point Visualization](images/vis_bbox_dp_pts.png)

4. Show bounding box and annotated points colored according to their U coordinate in part parametrization:
4. Show bounding box and annotated points colored according to their U coordinate in part parameterization:
```bash
python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_u -v
```
![Bounding Box + Point U Visualization](images/vis_bbox_dp_u.png)

5. Show bounding box and annotated points colored according to their V coordinate in part parametrization:
5. Show bounding box and annotated points colored according to their V coordinate in part parameterization:
```bash
python query_db.py show densepose_coco_2014_train image_id:int=322 bbox,dp_v -v
```
Expand Down
4 changes: 2 additions & 2 deletions projects/TridentNet/tridentnet/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ def add_tridentnet_config(cfg):

# Number of branches for TridentNet.
_C.MODEL.TRIDENT.NUM_BRANCH = 3
# Specfiy the dilations for each branch.
# Specify the dilations for each branch.
_C.MODEL.TRIDENT.BRANCH_DILATIONS = [1, 2, 3]
# Specify the stage for applying trident blocks. Default stage is Res4 according to the
# TridentNet paper.
_C.MODEL.TRIDENT.TRIDENT_STAGE = "res4"
# Specify the test branch index TridentNet Fast inference:
# - use -1 to aggreate results of all branches during inference.
# - use -1 to aggregate results of all branches during inference.
# - otherwise, only using specified branch for fast inference. Recommended setting is
# to use the middle branch.
_C.MODEL.TRIDENT.TEST_BRANCH_IDX = 1
2 changes: 1 addition & 1 deletion projects/TridentNet/tridentnet/trident_backbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(
"""
Args:
num_branch (int): the number of branches in TridentNet.
dilations (tuple): the dilations of multple branches in TridentNet.
dilations (tuple): the dilations of multiple branches in TridentNet.
concat_output (bool): if concatenate outputs of multiple branches in TridentNet.
Use 'True' for the last trident block.
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_nms_rotated.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _create_tensors(self, N):
scores = torch.rand(N)
return boxes, scores

def test_bactched_nms_rotated_0_degree_cpu(self):
def test_batched_nms_rotated_0_degree_cpu(self):
# torch.manual_seed(0)
N = 2000
num_classes = 50
Expand All @@ -66,7 +66,7 @@ def test_bactched_nms_rotated_0_degree_cpu(self):
assert torch.equal(keep, keep_ref), err_msg.format(iou)

@unittest.skipIf(not torch.cuda.is_available(), "CUDA unavailable")
def test_bactched_nms_rotated_0_degree_cuda(self):
def test_batched_nms_rotated_0_degree_cuda(self):
# torch.manual_seed(0)
N = 2000
num_classes = 50
Expand Down

0 comments on commit d250fcc

Please sign in to comment.