MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / __init__

Method __init__

PATH/core/solvers/utils/seg_tester_dev.py:74–101  ·  view source on GitHub ↗

Args: dataset_name (str): name of the dataset to be evaluated. distributed (bool): if True, will collect results from all ranks for evaluation. Otherwise, will evaluate the results in the current process. output_dir (str): an output direct

(
        self,
        dataset_name,
        config,
        distributed=True,
        output_dir=None,
    )

Source from the content-addressed store, hash-verified

72 """
73
74 def __init__(
75 self,
76 dataset_name,
77 config,
78 distributed=True,
79 output_dir=None,
80 ):
81 """
82 Args:
83 dataset_name (str): name of the dataset to be evaluated.
84 distributed (bool): if True, will collect results from all ranks for evaluation.
85 Otherwise, will evaluate the results in the current process.
86 output_dir (str): an output directory to dump results.
87 num_classes, ignore_label: deprecated argument
88 """
89 self._logger = logging.getLogger(__name__)
90
91 self._dataset_name = dataset_name
92 self._distributed = distributed
93 self._output_dir = output_dir
94
95 self._cpu_device = torch.device("cpu")
96
97 self._class_names = config.dataset.kwargs.cfg.label_list[1:]
98 self._num_classes = len(self._class_names)
99 assert self._num_classes == config.dataset.kwargs.cfg.num_classes, f"{self._num_classes} != {config.dataset.kwargs.cfg.num_classes}"
100 self._contiguous_id_to_dataset_id = {i: k for i, k in enumerate(self._class_names)} # Dict that maps contiguous training ids to COCO category ids
101 self._ignore_label = config.dataset.kwargs.cfg.ignore_value
102
103 def reset(self):
104 self._conf_matrix = np.zeros((self._num_classes + 1, self._num_classes + 1), dtype=np.int64)

Callers

nothing calls this directly

Calls 1

deviceMethod · 0.45

Tested by

no test coverage detected