File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
official/vision/beta/tasks Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 2828from official .vision .beta .dataloaders import tf_example_label_map_decoder
2929from official .vision .beta .evaluation import coco_evaluator
3030from official .vision .beta .evaluation import coco_utils
31- from official .vision .beta .evaluation import wod_detection_evaluator
3231from official .vision .beta .losses import maskrcnn_losses
3332from official .vision .beta .modeling import factory
3433
@@ -301,6 +300,18 @@ def build_metrics(self, training: bool = True):
301300 if self ._task_config .use_coco_metrics :
302301 self ._build_coco_metrics ()
303302 if self ._task_config .use_wod_metrics :
303+ # To use Waymo open dataset metrics, please install one of the pip
304+ # package `waymo-open-dataset-tf-*` from
305+ # https://github.com/waymo-research/waymo-open-dataset/blob/master/docs/quick_start.md#use-pre-compiled-pippip3-packages-for-linux
306+ # Note that the package is built with specific tensorflow version and
307+ # will produce error if it does not match the tf version that is
308+ # currently used.
309+ try :
310+ from official .vision .beta .evaluation import wod_detection_evaluator # pylint: disable=g-import-not-at-top
311+ except ModuleNotFoundError :
312+ logging .error ('waymo-open-dataset should be installed to enable Waymo'
313+ ' evaluator.' )
314+ raise
304315 self .wod_metric = wod_detection_evaluator .WOD2dDetectionEvaluator ()
305316
306317 return metrics
You can’t perform that action at this time.
0 commit comments