Skip to content

Commit 7f8f29d

Browse files
puhukfacebook-github-bot
authored andcommitted
Update benchmarks.md (PR about issue #3528)
Summary: PR about issue #3528 Pull Request resolved: #3529 Differential Revision: D31200753 Pulled By: ppwwyyxx fbshipit-source-id: 84954c59c72ebb0c493c4aa6cbff60befd13e6b2
1 parent ecc0856 commit 7f8f29d

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

detectron2/config/defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@
557557
# changing these and they exist only to reproduce Detectron v1 training if
558558
# desired.
559559
_C.SOLVER.BIAS_LR_FACTOR = 1.0
560-
_C.SOLVER.WEIGHT_DECAY_BIAS = None # None means following WEIGHT_DECAY
560+
_C.SOLVER.WEIGHT_DECAY_BIAS = None # None means following WEIGHT_DECAY
561561

562562
# Gradient clipping
563563
_C.SOLVER.CLIP_GRADIENTS = CN({"ENABLED": False})

detectron2/data/samplers/distributed_sampler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def _get_local_indices(total_size, world_size, rank):
268268
shard_sizes = [shard_size + int(r < left) for r in range(world_size)]
269269

270270
begin = sum(shard_sizes[:rank])
271-
end = min(sum(shard_sizes[:rank + 1]), total_size)
271+
end = min(sum(shard_sizes[: rank + 1]), total_size)
272272
return range(begin, end)
273273

274274
def __iter__(self):

detectron2/utils/visualizer.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ def __init__(self, mask_or_polygons, height, width):
8686

8787
if isinstance(m, np.ndarray): # assumed to be a binary mask
8888
assert m.shape[1] != 2, m.shape
89-
assert m.shape == (height, width), f"mask shape: {m.shape}, target dims: {height}, {width}"
89+
assert m.shape == (
90+
height,
91+
width,
92+
), f"mask shape: {m.shape}, target dims: {height}, {width}"
9093
self._mask = m.astype("uint8")
9194
return
9295

@@ -609,7 +612,7 @@ def overlay_instances(
609612
masks=None,
610613
keypoints=None,
611614
assigned_colors=None,
612-
alpha=0.5
615+
alpha=0.5,
613616
):
614617
"""
615618
Args:
@@ -852,7 +855,7 @@ def draw_text(
852855
font_size=None,
853856
color="g",
854857
horizontal_alignment="center",
855-
rotation=0
858+
rotation=0,
856859
):
857860
"""
858861
Args:

docs/notes/benchmarks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ with some other popular open source Mask R-CNN implementations.
1212
TensorFlow 1.15.0rc2, Keras 2.2.5, MxNet 1.6.0b20190820.
1313
* Model: an end-to-end R-50-FPN Mask-RCNN model, using the same hyperparameter as the
1414
[Detectron baseline config](https://github.com/facebookresearch/Detectron/blob/master/configs/12_2017_baselines/e2e_mask_rcnn_R-50-FPN_1x.yaml)
15-
(it does no have scale augmentation).
15+
(it does not have scale augmentation).
1616
* Metrics: We use the average throughput in iterations 100-500 to skip GPU warmup time.
1717
Note that for R-CNN-style models, the throughput of a model typically changes during training, because
1818
it depends on the predictions of the model. Therefore this metric is not directly comparable with
@@ -82,7 +82,7 @@ Details for each implementation:
8282
```
8383

8484
* __maskrcnn-benchmark__: use commit `0ce8f6f` with `sed -i 's/torch.uint8/torch.bool/g' **/*.py; sed -i 's/AT_CHECK/TORCH_CHECK/g' **/*.cu`
85-
to make it compatible with PyTorch 1.5. Then, run training with
85+
to make it compatible with PyTorch 1.5. Then, run training with
8686
```
8787
python -m torch.distributed.launch --nproc_per_node=8 tools/train_net.py --config-file configs/e2e_mask_rcnn_R_50_FPN_1x.yaml
8888
```

tests/data/test_sampler.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
from detectron2.data.common import DatasetFromList, ToIterableDataset
1212
from detectron2.data.samplers import (
1313
GroupedBatchSampler,
14+
InferenceSampler,
1415
RepeatFactorTrainingSampler,
1516
TrainingSampler,
16-
InferenceSampler,
1717
)
1818
from detectron2.utils.env import seed_all_rng
1919

@@ -102,9 +102,7 @@ def test_local_indices(self):
102102
[range(11), range(11, 22), range(22, 32), range(32, 42)],
103103
]
104104

105-
for size, world_size, expected_result in zip(
106-
sizes, world_sizes, expected_results
107-
):
105+
for size, world_size, expected_result in zip(sizes, world_sizes, expected_results):
108106
with self.subTest(f"size={size}, world_size={world_size}"):
109107
local_indices = [
110108
InferenceSampler._get_local_indices(size, world_size, r)

0 commit comments

Comments
 (0)