Skip to content

Commit

Permalink
[Fix] mmocr.utils.typing -> mmocr.utils.typing_utils (#1538)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaotongxiao authored Nov 17, 2022
1 parent d8c0df4 commit e067dde
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion mmocr/evaluation/evaluator/multi_datasets_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from mmengine.evaluator.metric import _to_cpu

from mmocr.registry import EVALUATOR
from mmocr.utils.typing import ConfigType
from mmocr.utils.typing_utils import ConfigType


@EVALUATOR.register_module()
Expand Down
4 changes: 2 additions & 2 deletions mmocr/models/textdet/detectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from mmengine.model import BaseModel
from torch import Tensor

from mmocr.utils.typing import (DetSampleList, OptConfigType, OptDetSampleList,
OptMultiConfig)
from mmocr.utils.typing_utils import (DetSampleList, OptConfigType,
OptDetSampleList, OptMultiConfig)

ForwardResults = Union[Dict[str, torch.Tensor], DetSampleList,
Tuple[torch.Tensor], torch.Tensor]
Expand Down
2 changes: 1 addition & 1 deletion mmocr/models/textdet/detectors/mmdet_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from mmocr.registry import MODELS
from mmocr.utils.bbox_utils import bbox2poly
from mmocr.utils.typing import DetSampleList
from mmocr.utils.typing_utils import DetSampleList

ForwardResults = Union[Dict[str, torch.Tensor], List[DetDataSample],
Tuple[torch.Tensor], torch.Tensor]
Expand Down
2 changes: 1 addition & 1 deletion mmocr/models/textdet/heads/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from torch import Tensor

from mmocr.registry import MODELS
from mmocr.utils.typing import DetSampleList
from mmocr.utils.typing_utils import DetSampleList


@MODELS.register_module()
Expand Down
2 changes: 1 addition & 1 deletion mmocr/models/textdet/heads/db_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from mmocr.models.textdet.heads import BaseTextDetHead
from mmocr.registry import MODELS
from mmocr.structures import TextDetDataSample
from mmocr.utils.typing import DetSampleList
from mmocr.utils.typing_utils import DetSampleList


@MODELS.register_module()
Expand Down
2 changes: 1 addition & 1 deletion mmocr/models/textdet/module_losses/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from torch import nn

from mmocr.registry import MODELS
from mmocr.utils.typing import DetSampleList
from mmocr.utils.typing_utils import DetSampleList

INPUT_TYPES = Union[torch.Tensor, Sequence[torch.Tensor], Dict]

Expand Down
2 changes: 1 addition & 1 deletion mmocr/models/textdet/module_losses/db_module_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mmocr.registry import MODELS
from mmocr.structures import TextDetDataSample
from mmocr.utils import offset_polygon
from mmocr.utils.typing import ArrayLike
from mmocr.utils.typing_utils import ArrayLike
from .seg_based_module_loss import SegBasedModuleLoss


Expand Down
2 changes: 1 addition & 1 deletion mmocr/models/textdet/module_losses/fce_module_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from mmocr.registry import MODELS
from mmocr.structures import TextDetDataSample
from mmocr.utils.typing import ArrayLike
from mmocr.utils.typing_utils import ArrayLike
from .textsnake_module_loss import TextSnakeModuleLoss


Expand Down
2 changes: 1 addition & 1 deletion mmocr/models/textrecog/backbones/mobilenet_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from torch import Tensor

from mmocr.registry import MODELS
from mmocr.utils.typing import InitConfigType
from mmocr.utils.typing_utils import InitConfigType


@MODELS.register_module()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import torch

from mmocr.registry import MODELS
from mmocr.utils.typing import (ConfigType, InitConfigType, OptConfigType,
OptRecSampleList, RecForwardResults,
RecSampleList)
from mmocr.utils.typing_utils import (ConfigType, InitConfigType,
OptConfigType, OptRecSampleList,
RecForwardResults, RecSampleList)
from .base import BaseRecognizer


Expand Down
10 changes: 5 additions & 5 deletions mmocr/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
sort_vertex, sort_vertex8)
from .setup_env import register_all_modules
from .string_utils import StringStripper
from .typing import (ColorType, ConfigType, DetSampleList, InitConfigType,
KIESampleList, MultiConfig, OptConfigType,
OptDetSampleList, OptInitConfigType, OptKIESampleList,
OptMultiConfig, OptRecSampleList, OptTensor,
RecForwardResults, RecSampleList)
from .typing_utils import (ColorType, ConfigType, DetSampleList,
InitConfigType, KIESampleList, MultiConfig,
OptConfigType, OptDetSampleList, OptInitConfigType,
OptKIESampleList, OptMultiConfig, OptRecSampleList,
OptTensor, RecForwardResults, RecSampleList)

__all__ = [
'collect_env', 'is_3dlist', 'is_type_list', 'is_none_or_type', 'equal_len',
Expand Down
2 changes: 1 addition & 1 deletion mmocr/utils/bbox_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from mmocr.utils.check_argument import is_2dlist, is_type_list
from mmocr.utils.point_utils import point_distance, points_center
from mmocr.utils.typing import ArrayLike
from mmocr.utils.typing_utils import ArrayLike


def rescale_bbox(bbox: np.ndarray,
Expand Down
2 changes: 1 addition & 1 deletion mmocr/utils/mask_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import cv2
import numpy as np

from mmocr.utils.typing import ArrayLike
from mmocr.utils.typing_utils import ArrayLike


def fill_hole(input_mask: ArrayLike) -> np.array:
Expand Down
2 changes: 1 addition & 1 deletion mmocr/utils/point_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np

from mmocr.utils.typing import ArrayLike
from mmocr.utils.typing_utils import ArrayLike


def points_center(points: ArrayLike) -> np.ndarray:
Expand Down
2 changes: 1 addition & 1 deletion mmocr/utils/polygon_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from mmocr.utils import bbox2poly, valid_boundary
from mmocr.utils.check_argument import is_2dlist
from mmocr.utils.typing import ArrayLike
from mmocr.utils.typing_utils import ArrayLike


def rescale_polygon(polygon: ArrayLike,
Expand Down
File renamed without changes.

0 comments on commit e067dde

Please sign in to comment.