Commit 27bc75b1 authored by mibaumgartner's avatar mibaumgartner
Browse files

rename utils to ops

parent 4655684b
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
defaults: defaults:
- augmentation: base_more - augmentation: base_more
module: "RetinaUNetC010" module: RetinaUNetV001
predictor: "BoxPredictorSelective" predictor: BoxPredictorSelective
plan: D3V001_3d plan: D3V001_3d
planners: planners:
......
...@@ -16,6 +16,6 @@ from nndet.core.boxes.matcher import MatcherType, Matcher, IoUMatcher, ATSSMatch ...@@ -16,6 +16,6 @@ from nndet.core.boxes.matcher import MatcherType, Matcher, IoUMatcher, ATSSMatch
from nndet.core.boxes.nms import nms, batched_nms from nndet.core.boxes.nms import nms, batched_nms
from nndet.core.boxes.sampler import AbstractSampler, NegativeSampler, HardNegativeSampler, \ from nndet.core.boxes.sampler import AbstractSampler, NegativeSampler, HardNegativeSampler, \
BalancedHardNegativeSampler, HardNegativeSamplerFgAll, HardNegativeSamplerBatched BalancedHardNegativeSampler, HardNegativeSamplerFgAll, HardNegativeSamplerBatched
from nndet.core.boxes.utils import box_area, box_iou, remove_small_boxes, box_center, permute_boxes, \ from nndet.core.boxes.ops import box_area, box_iou, remove_small_boxes, box_center, permute_boxes, \
expand_to_boxes, box_size, generalized_box_iou, box_center_dist, center_in_boxes expand_to_boxes, box_size, generalized_box_iou, box_center_dist, center_in_boxes
from nndet.core.boxes.utils_np import box_iou_np, box_size_np, box_area_np from nndet.core.boxes.ops_np import box_iou_np, box_size_np, box_area_np
...@@ -5,7 +5,7 @@ import torch ...@@ -5,7 +5,7 @@ import torch
from torch import Tensor from torch import Tensor
from loguru import logger from loguru import logger
from nndet.core.boxes.utils import box_iou, box_center_dist, center_in_boxes from nndet.core.boxes.ops import box_iou, box_center_dist, center_in_boxes
INF = 100 # not really inv but here it is sufficient INF = 100 # not really inv but here it is sufficient
......
...@@ -20,7 +20,7 @@ from torch.cuda.amp import autocast ...@@ -20,7 +20,7 @@ from torch.cuda.amp import autocast
from torchvision.ops.boxes import nms as nms_2d from torchvision.ops.boxes import nms as nms_2d
from nndet._C import nms as nms_gpu from nndet._C import nms as nms_gpu
from nndet.core.boxes.utils import box_iou from nndet.core.boxes.ops import box_iou
def nms_cpu(boxes, scores, thresh): def nms_cpu(boxes, scores, thresh):
......
...@@ -21,7 +21,7 @@ from numpy import ndarray ...@@ -21,7 +21,7 @@ from numpy import ndarray
def box_area_np(boxes: ndarray) -> ndarray: def box_area_np(boxes: ndarray) -> ndarray:
""" """
See Also: See Also:
:func:`nndet.core.boxes.utils.box_area` :func:`nndet.core.boxes.ops.box_area`
""" """
if boxes.shape[-1] == 4: if boxes.shape[-1] == 4:
return box_area_2d_np(boxes) return box_area_2d_np(boxes)
...@@ -32,7 +32,7 @@ def box_area_np(boxes: ndarray) -> ndarray: ...@@ -32,7 +32,7 @@ def box_area_np(boxes: ndarray) -> ndarray:
def box_area_3d_np(boxes: np.ndarray) -> np.ndarray: def box_area_3d_np(boxes: np.ndarray) -> np.ndarray:
""" """
See Also: See Also:
`nndet.core.boxes.utils.box_area_3d` `nndet.core.boxes.ops.box_area_3d`
""" """
return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1]) * (boxes[:, 5] - boxes[:, 4]) return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1]) * (boxes[:, 5] - boxes[:, 4])
...@@ -40,7 +40,7 @@ def box_area_3d_np(boxes: np.ndarray) -> np.ndarray: ...@@ -40,7 +40,7 @@ def box_area_3d_np(boxes: np.ndarray) -> np.ndarray:
def box_area_2d_np(boxes: np.ndarray) -> np.ndarray: def box_area_2d_np(boxes: np.ndarray) -> np.ndarray:
""" """
See Also: See Also:
`nndet.core.boxes.utils.box_area_2d` `nndet.core.boxes.ops.box_area_2d`
""" """
return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1]) return (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1])
......
...@@ -19,7 +19,7 @@ from typing import Sequence, Tuple, Union, Optional ...@@ -19,7 +19,7 @@ from typing import Sequence, Tuple, Union, Optional
import numpy as np import numpy as np
from loguru import logger from loguru import logger
from nndet.core.boxes.utils import permute_boxes, expand_to_boxes from nndet.core.boxes.ops import permute_boxes, expand_to_boxes
from nndet.preprocessing.resampling import resample_data_or_seg, get_do_separate_z, get_lowres_axis from nndet.preprocessing.resampling import resample_data_or_seg, get_do_separate_z, get_lowres_axis
......
...@@ -27,7 +27,7 @@ from nndet.io.datamodule import DATALOADER_REGISTRY ...@@ -27,7 +27,7 @@ from nndet.io.datamodule import DATALOADER_REGISTRY
from nndet.io.load import load_pickle from nndet.io.load import load_pickle
from nndet.inference.patching import save_get_crop from nndet.inference.patching import save_get_crop
from nndet.utils.info import maybe_verbose_iterable from nndet.utils.info import maybe_verbose_iterable
from nndet.core.boxes.utils_np import box_size_np from nndet.core.boxes.ops_np import box_size_np
class FixedSlimDataLoaderBase(SlimDataLoaderBase): class FixedSlimDataLoaderBase(SlimDataLoaderBase):
......
...@@ -5,7 +5,7 @@ import torch ...@@ -5,7 +5,7 @@ import torch
__all__ = ["SmoothL1Loss", "smooth_l1_loss"] __all__ = ["SmoothL1Loss", "smooth_l1_loss"]
from nndet.core.boxes.utils import generalized_box_iou from nndet.core.boxes.ops import generalized_box_iou
from nndet.losses.base import reduction_helper from nndet.losses.base import reduction_helper
......
...@@ -37,7 +37,7 @@ from nndet.core.boxes.matcher import IoUMatcher ...@@ -37,7 +37,7 @@ from nndet.core.boxes.matcher import IoUMatcher
from nndet.core.boxes.sampler import HardNegativeSamplerBatched from nndet.core.boxes.sampler import HardNegativeSamplerBatched
from nndet.core.boxes.coder import CoderType, BoxCoderND from nndet.core.boxes.coder import CoderType, BoxCoderND
from nndet.core.boxes.anchors import get_anchor_generator from nndet.core.boxes.anchors import get_anchor_generator
from nndet.core.boxes.utils import box_iou from nndet.core.boxes.ops import box_iou
from nndet.ptmodule.base_module import LightningBaseModuleSWA, LightningBaseModule from nndet.ptmodule.base_module import LightningBaseModuleSWA, LightningBaseModule
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment