mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
fix base dataset (#1926)
This commit is contained in:
parent
13b108dbc8
commit
3d98c25052
@ -3,7 +3,7 @@ import copy
|
|||||||
import os.path as osp
|
import os.path as osp
|
||||||
from typing import Callable, Dict, List, Optional, Sequence, Union
|
from typing import Callable, Dict, List, Optional, Sequence, Union
|
||||||
|
|
||||||
import mmcv
|
import mmengine
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from mmengine.dataset import BaseDataset, Compose
|
from mmengine.dataset import BaseDataset, Compose
|
||||||
|
|
||||||
@ -103,7 +103,8 @@ class BaseSegDataset(BaseDataset):
|
|||||||
self.ignore_index = ignore_index
|
self.ignore_index = ignore_index
|
||||||
self.reduce_zero_label = reduce_zero_label
|
self.reduce_zero_label = reduce_zero_label
|
||||||
self.file_client_args = file_client_args
|
self.file_client_args = file_client_args
|
||||||
self.file_client = mmcv.FileClient.infer_client(self.file_client_args)
|
self.file_client = mmengine.FileClient.infer_client(
|
||||||
|
self.file_client_args)
|
||||||
|
|
||||||
self.data_root = data_root
|
self.data_root = data_root
|
||||||
self.data_prefix = copy.copy(data_prefix)
|
self.data_prefix = copy.copy(data_prefix)
|
||||||
@ -236,7 +237,7 @@ class BaseSegDataset(BaseDataset):
|
|||||||
img_dir = self.data_prefix.get('img_path', None)
|
img_dir = self.data_prefix.get('img_path', None)
|
||||||
ann_dir = self.data_prefix.get('seg_map_path', None)
|
ann_dir = self.data_prefix.get('seg_map_path', None)
|
||||||
if osp.isfile(self.ann_file):
|
if osp.isfile(self.ann_file):
|
||||||
lines = mmcv.list_from_file(
|
lines = mmengine.list_from_file(
|
||||||
self.ann_file, file_client_args=self.file_client_args)
|
self.ann_file, file_client_args=self.file_client_args)
|
||||||
for line in lines:
|
for line in lines:
|
||||||
img_name = line.strip()
|
img_name = line.strip()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user