Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move otx.mpa.modules.ov -> otx.core.ov #1929

Merged
merged 9 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Module for the MMOVBackbone class."""

from typing import Dict, List
from typing import Dict, List, Union

from mmcls.models.builder import BACKBONES

from otx.mpa.modules.ov.graph.parsers.cls.cls_base_parser import cls_base_parser
from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.graph.parsers.cls import cls_base_parser
from otx.core.ov.models.mmov_model import MMOVModel


@BACKBONES.register_module()
Expand All @@ -18,7 +18,7 @@ class MMOVBackbone(MMOVModel):
"""

@staticmethod
def parser(graph, **kwargs) -> Dict[str, List[str]]:
def parser(graph, **kwargs) -> Dict[str, Union[List[str], Dict[str, List[str]]]]:
"""Parses the input and output of the model.

Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from mmcls.models.builder import HEADS
from mmcls.models.heads import ClsHead

from otx.mpa.modules.ov.graph.parsers.cls.cls_base_parser import cls_base_parser
from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.graph.parsers.cls import cls_base_parser
from otx.core.ov.models.mmov_model import MMOVModel


@HEADS.register_module()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# SPDX-License-Identifier: Apache-2.0
#

from typing import Dict, List
from typing import Dict, List, Union

from mmcls.models.builder import NECKS

from otx.mpa.modules.ov.graph.parsers.cls.cls_base_parser import cls_base_parser
from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.graph.parsers.cls import cls_base_parser
from otx.core.ov.models.mmov_model import MMOVModel


@NECKS.register_module()
Expand All @@ -19,7 +19,7 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

@staticmethod
def parser(graph, **kwargs) -> Dict[str, List[str]]:
def parser(graph, **kwargs) -> Dict[str, Union[List[str], Dict[str, List[str]]]]:
"""Parser function returns base_parser for given graph."""
output = cls_base_parser(graph, "neck")
if output is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from mmdet.models.builder import BACKBONES

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel


@BACKBONES.register_module()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mmdet.models.builder import HEADS
from mmdet.models.dense_heads.rpn_head import RPNHead

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel
from otx.mpa.utils.logger import get_logger

logger = get_logger()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from mmdet.models.builder import HEADS
from mmdet.models.dense_heads.ssd_head import SSDHead

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel

# TODO: Need to fix pylint issues
# pylint: disable=redefined-argument-from-local, too-many-instance-attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mmdet.models.builder import HEADS
from mmdet.models.dense_heads.yolo_head import YOLOV3Head

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel

# TODO: Need to fix pylint issues
# pylint: disable=too-many-instance-attributes, keyword-arg-before-vararg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from mmdet.models.necks.fpn import FPN
from torch import nn

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel

# TODO: Need to fix pylint issues
# pylint: disable=keyword-arg-before-vararg, too-many-locals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from mmdet.models.builder import NECKS
from torch import nn

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel

# pylint: disable=too-many-arguments, too-many-locals

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from mmdet.models.builder import NECKS
from mmdet.models.necks.yolo_neck import YOLOV3Neck

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.mpa.modules.ov.models.parser_mixin import ParserMixin
from otx.core.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.parser_mixin import ParserMixin # type: ignore[attr-defined]


@NECKS.register_module()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mmdet.models.builder import HEADS
from mmdet.models.roi_heads.bbox_heads.bbox_head import BBoxHead

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel

# TODO: Need to fix pylint issues
# pylint: disable=too-many-instance-attributes, too-many-arguments, keyword-arg-before-vararg, dangerous-default-value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from mmdet.models.builder import HEADS
from mmdet.models.roi_heads.mask_heads.fcn_mask_head import FCNMaskHead

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel

# TODO: Need to fix pylint issues
# pylint: disable=too-many-instance-attributes, too-many-arguments, keyword-arg-before-vararg, dangerous-default-value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from mmseg.models.builder import BACKBONES

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel

# pylint: disable=unused-argument

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import openvino.runtime as ov
from mmseg.models.decode_heads.decode_head import BaseDecodeHead

from otx.mpa.modules.ov.models.mmov_model import MMOVModel
from otx.core.ov.models.mmov_model import MMOVModel

# pylint: disable=too-many-instance-attributes, keyword-arg-before-vararg

Expand Down
4 changes: 4 additions & 0 deletions otx/core/ov/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Module for otx.core.ov."""
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
cih9088 marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions otx/core/ov/graph/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Module for otx.core.ov.graph."""
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT

# TODO: Need to remove comment with ignore mypy and fix mypy issues
from .graph import Graph # type: ignore[attr-defined]

__all__ = ["Graph"]
Loading