Skip to content

Commit

Permalink
specify language in markdown code blocks
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #3872

Differential Revision: D33502656

Pulled By: zhanghang1989

fbshipit-source-id: 53ee62f48ecf99fc2663ea96325f32cdea2f7dba
  • Loading branch information
yoosful authored and facebook-github-bot committed Jan 12, 2022
1 parent b195905 commit 5170414
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ We provided several base configs for standard model architectures.
Many builtin tools in detectron2 accept command line config overwrite:
Key-value pairs provided in the command line will overwrite the existing values in the config file.
For example, [demo.py](../../demo/demo.py) can be used with
```
```sh
./demo.py --config-file config.yaml [--other-options] \
--opts MODEL.WEIGHTS /path/to/weights INPUT.MIN_SIZE_TEST 1000
```
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can also implement your own `DatasetEvaluator` that performs some other jobs
using the inputs/outputs pairs.
For example, to count how many instances are detected on the validation set:

```
```python
class Counter(DatasetEvaluator):
def reset(self):
self.count = 0
Expand All @@ -28,7 +28,7 @@ class Counter(DatasetEvaluator):
## Use evaluators

To evaluate using the methods of evaluators manually:
```
```python
def get_all_inputs_outputs():
for data in data_loader:
yield data, model(data)
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/lazyconfigs.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ cfg = L(Trainer)(
)
```
creates a dictionary like this:
```
```python
cfg = {
"_target_": "my_app.Trainer",
"optimizer": {
Expand Down Expand Up @@ -122,7 +122,7 @@ Despite of this, our model zoo configs still follow some simple conventions for
`cfg.model` defines a model object, `cfg.dataloader.{train,test}` defines dataloader objects,
and `cfg.train` contains training options in key-value form.
In addition to `print()`, a better way to view the structure of a config is like this:
```
```python
from detectron2.model_zoo import get_config
from detectron2.config import LazyConfig
print(LazyConfig.to_py(get_config("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.py")))
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ It includes default behavior including model loading, preprocessing,
and operates on single image rather than batches. See its documentation for usage.

You can also run inference directly like this:
```
```python
model.eval()
with torch.no_grad():
outputs = model(inputs)
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/training.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To customize a `DefaultTrainer`:

During training, detectron2 models and trainer put metrics to a centralized [EventStorage](../modules/utils.html#detectron2.utils.events.EventStorage).
You can use the following code to access it and log metrics to it:
```
```python
from detectron2.utils.events import get_event_storage

# inside the model:
Expand Down

0 comments on commit 5170414

Please sign in to comment.