Skip to content

Commit

Permalink
fix lint, add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
filaPro committed Feb 23, 2022
1 parent d3f463b commit 7f48ba7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) OpenMMLab. All rights reserved.
# adapted from https://github.com/ScanNet/ScanNet/blob/master/BenchmarkScripts/3d_evaluation/evaluate_semantic_instance.py # noqa
import numpy as np
from copy import deepcopy

import numpy as np

from . import util_3d


Expand Down Expand Up @@ -219,7 +220,20 @@ def compute_averages(aps, options, class_labels):

def assign_instances_for_scan(pred_info, gt_ids, options, valid_class_ids,
class_labels, id_to_label):
"""Assign gt and predicted instances for a single scene."""
"""Assign gt and predicted instances for a single scene.
Args:
pred_info (dict): Predicted masks, labels and scores.
gt_ids (np.array): Ground truth instance masks.
options (dict): ScanNet evaluator options. See get_options.
valid_class_ids (tuple[int]): Ids of valid categories.
class_labels (tuple[str]): Class names.
id_to_label (dict[int, str]): Mapping of valid class id to class label.
Returns:
dict: Per class assigned gt to predicted instances.
dict: Per class assigned predicted to gt instances.
"""
# get gt instances
gt_instances = util_3d.get_instances(gt_ids, valid_class_ids, class_labels,
id_to_label)
Expand Down
1 change: 1 addition & 0 deletions mmdet3d/core/evaluation/scannet_utils/util_3d.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) OpenMMLab. All rights reserved.
# adapted from https://github.com/ScanNet/ScanNet/blob/master/BenchmarkScripts/util_3d.py # noqa
import json

import numpy as np


Expand Down
3 changes: 2 additions & 1 deletion mmdet3d/datasets/scannet_dataset.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import tempfile
import warnings
from os import path as osp

import numpy as np

from mmdet3d.core import instance_seg_eval, show_result, show_seg_result
from mmdet3d.core.bbox import DepthInstance3DBoxes
from mmdet.datasets import DATASETS
Expand Down

0 comments on commit 7f48ba7

Please sign in to comment.