Skip to content

Commit

Permalink
🎨 Move Models to Top-Level Import (#574)
Browse files Browse the repository at this point in the history
- Move the following models to top-level import
  - HoVerNet
  - HoVerNetPlus
  - IDaRS
  - MapDe
  - MicroNet
  - NuClick
  - SCCNN

-------------------------------------------------------
Co-authored-by: Shan Raza <13048456+shaneahmed@users.noreply.github.com>
Co-authored-by: Adam Shephard <39619155+adamshephard@users.noreply.github.com>
  • Loading branch information
shaneahmed authored Mar 24, 2023
1 parent 2122f97 commit 09bd197
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/models/test_arch_idars.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import torch

from tiatoolbox.models.architecture.idars import IDaRS
from tiatoolbox.models import IDaRS


def test_functional():
Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_arch_mapde.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import torch

from tiatoolbox import utils
from tiatoolbox.models import MapDe
from tiatoolbox.models.architecture import fetch_pretrained_weights
from tiatoolbox.models.architecture.mapde import MapDe
from tiatoolbox.wsicore.wsireader import WSIReader


Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_arch_micronet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import torch

from tiatoolbox import utils
from tiatoolbox.models import MicroNet
from tiatoolbox.models.architecture import fetch_pretrained_weights
from tiatoolbox.models.architecture.micronet import MicroNet
from tiatoolbox.models.engine.semantic_segmentor import SemanticSegmentor
from tiatoolbox.utils import env_detection as toolbox_env
from tiatoolbox.wsicore.wsireader import WSIReader
Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_arch_nuclick.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import pytest
import torch

from tiatoolbox.models import NuClick
from tiatoolbox.models.architecture import fetch_pretrained_weights
from tiatoolbox.models.architecture.nuclick import NuClick
from tiatoolbox.utils.misc import imread

ON_GPU = False
Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_arch_sccnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import torch

from tiatoolbox import utils
from tiatoolbox.models import SCCNN
from tiatoolbox.models.architecture import fetch_pretrained_weights
from tiatoolbox.models.architecture.sccnn import SCCNN
from tiatoolbox.wsicore.wsireader import WSIReader


Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_hovernet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import torch
import torch.nn as nn

from tiatoolbox.models import HoVerNet
from tiatoolbox.models.architecture import fetch_pretrained_weights
from tiatoolbox.models.architecture.hovernet import (
DenseBlock,
HoVerNet,
ResidualBlock,
TFSamepaddingLayer,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_hovernetplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import torch

from tiatoolbox.models import HoVerNetPlus
from tiatoolbox.models.architecture import fetch_pretrained_weights
from tiatoolbox.models.architecture.hovernetplus import HoVerNetPlus
from tiatoolbox.utils.misc import imread
from tiatoolbox.utils.transforms import imresize

Expand Down
16 changes: 16 additions & 0 deletions tiatoolbox/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,19 @@
SemanticSegmentor,
WSIStreamDataset,
)

from .architecture.hovernet import HoVerNet
from .architecture.hovernetplus import HoVerNetPlus
from .architecture.idars import IDaRS
from .architecture.mapde import MapDe
from .architecture.micronet import MicroNet
from .architecture.nuclick import NuClick
from .architecture.sccnn import SCCNN

HoVerNet = HoVerNet
HoVerNetPlus = HoVerNetPlus
IDaRS = IDaRS
MapDe = MapDe
MicroNet = MicroNet
NuClick = NuClick
SCCNN = SCCNN

0 comments on commit 09bd197

Please sign in to comment.