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

rename utils to ops

parent 4655684b
......@@ -2,8 +2,8 @@
defaults:
- augmentation: base_more
module: "RetinaUNetC010"
predictor: "BoxPredictorSelective"
module: RetinaUNetV001
predictor: BoxPredictorSelective
plan: D3V001_3d
planners:
......
......@@ -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.sampler import AbstractSampler, NegativeSampler, HardNegativeSampler, \
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
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
from torch import Tensor
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
......
......@@ -20,7 +20,7 @@ from torch.cuda.amp import autocast
from torchvision.ops.boxes import nms as nms_2d
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):
......
......@@ -21,7 +21,7 @@ from numpy import ndarray
def box_area_np(boxes: ndarray) -> ndarray:
"""
See Also:
:func:`nndet.core.boxes.utils.box_area`
:func:`nndet.core.boxes.ops.box_area`
"""
if boxes.shape[-1] == 4:
return box_area_2d_np(boxes)
......@@ -32,7 +32,7 @@ def box_area_np(boxes: ndarray) -> ndarray:
def box_area_3d_np(boxes: np.ndarray) -> np.ndarray:
"""
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])
......@@ -40,7 +40,7 @@ def box_area_3d_np(boxes: np.ndarray) -> np.ndarray:
def box_area_2d_np(boxes: np.ndarray) -> np.ndarray:
"""
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])
......
......@@ -19,7 +19,7 @@ from typing import Sequence, Tuple, Union, Optional
import numpy as np
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
......
......@@ -27,7 +27,7 @@ from nndet.io.datamodule import DATALOADER_REGISTRY
from nndet.io.load import load_pickle
from nndet.inference.patching import save_get_crop
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):
......
......@@ -5,7 +5,7 @@ import torch
__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
......
......@@ -37,7 +37,7 @@ from nndet.core.boxes.matcher import IoUMatcher
from nndet.core.boxes.sampler import HardNegativeSamplerBatched
from nndet.core.boxes.coder import CoderType, BoxCoderND
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
......
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