Skip to content

Commit

Permalink
update docs; assert non-empty dataset
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: fairinternal/detectron2#316

Differential Revision: D18197894

Pulled By: ppwwyyxx

fbshipit-source-id: 9ef0daa6ebb23581bf845ca25126e73b2f28d5c8
  • Loading branch information
ppwwyyxx authored and facebook-github-bot committed Oct 29, 2019
1 parent 714a891 commit fb80ec5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion MODEL_ZOO.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Unless otherwise noted, the following settings are used for all runs:
[Detectron1-Comparisons](configs/Detectron1-Comparisons/) for accuracy comparison,
and [benchmarks](https://detectron2.readthedocs.io/notes/benchmarks.html)
for speed comparison.
* Inference speed is measured by `tools/train_net.py --eval-only`, with batch size 1 in detectron2 directly.
* Inference speed is measured by `tools/train_net.py --eval-only`, or [inference_on_dataset()](https://detectron2.readthedocs.io/modules/evaluation.html#detectron2.evaluation.inference_on_dataset),
with batch size 1 in detectron2 directly.
The actual deployment should in general be faster than the given inference
speed due to more optimizations.
* Training speed is averaged across the entire training.
Expand Down
2 changes: 2 additions & 0 deletions detectron2/data/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ def get_detection_dataset_dicts(
"""
assert len(dataset_names)
dataset_dicts = [DatasetCatalog.get(dataset_name) for dataset_name in dataset_names]
for dataset_name, dicts in zip(dataset_names, dataset_dicts):
assert len(dicts), "Dataset '{}' is empty!".format(dataset_name)

if proposal_files is not None:
assert len(dataset_names) == len(proposal_files)
Expand Down
4 changes: 3 additions & 1 deletion detectron2/evaluation/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def inference_on_dataset(model, data_loader, evaluator):
wrap the given model and override its behavior of `.eval()` and `.train()`.
data_loader: an iterable object with a length.
The elements it generates will be the inputs to the model.
evaluator (DatasetEvaluator): the evaluator to run
evaluator (DatasetEvaluator): the evaluator to run. Use
:class:`DatasetEvaluators([])` if you only want to benchmark, but
don't want to do any evaluation.
Returns:
The return value of `evaluator.evaluate()`
Expand Down

0 comments on commit fb80ec5

Please sign in to comment.