diff --git a/src/mednet/libs/classification/engine/evaluator.py b/src/mednet/libs/classification/engine/evaluator.py index 598fb3b8f20759ec2e6d917acbb27661f9b93ce7..acbf79b3fcdd9db808a6ee28e6ded77c42d887fb 100644 --- a/src/mednet/libs/classification/engine/evaluator.py +++ b/src/mednet/libs/classification/engine/evaluator.py @@ -20,7 +20,7 @@ from matplotlib import pyplot as plt from ..models.typing import BinaryPrediction -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) def eer_threshold(predictions: Iterable[BinaryPrediction]) -> float: diff --git a/src/mednet/libs/classification/engine/predictor.py b/src/mednet/libs/classification/engine/predictor.py index d0298a3ee95652cc90ffeb2db846d51c8b46fedd..752070f67801413719b038137dd76599f74acc5d 100644 --- a/src/mednet/libs/classification/engine/predictor.py +++ b/src/mednet/libs/classification/engine/predictor.py @@ -16,7 +16,7 @@ from ..models.typing import ( MultiClassPredictionSplit, ) -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class _JSONMetadataCollector(lightning.pytorch.callbacks.BasePredictionWriter): diff --git a/src/mednet/libs/classification/engine/saliency/completeness.py b/src/mednet/libs/classification/engine/saliency/completeness.py index c7f3be68e0865b64b5c1c340d4c6a023d851775d..2eac54295f0bdbdb1151dd290db1bbce2ddb9661 100644 --- a/src/mednet/libs/classification/engine/saliency/completeness.py +++ b/src/mednet/libs/classification/engine/saliency/completeness.py @@ -21,7 +21,7 @@ from pytorch_grad_cam.utils.model_targets import ClassifierOutputTarget from ...models.typing import SaliencyMapAlgorithm -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class SigmoidClassifierOutputTarget(torch.nn.Module): diff --git a/src/mednet/libs/classification/engine/saliency/generator.py b/src/mednet/libs/classification/engine/saliency/generator.py index 2b9badf19390c4e564041dec0a28570ad853da8e..5fc43415a4cb6188c8770def0f3b8cc6e538152b 100644 --- a/src/mednet/libs/classification/engine/saliency/generator.py +++ b/src/mednet/libs/classification/engine/saliency/generator.py @@ -15,7 +15,7 @@ from mednet.libs.common.engine.device import DeviceManager from ...models.typing import SaliencyMapAlgorithm -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) def _create_saliency_map_callable( diff --git a/src/mednet/libs/classification/engine/saliency/interpretability.py b/src/mednet/libs/classification/engine/saliency/interpretability.py index da96650ec1912d8ef19daa5c574b0f791b16d77b..7348361c0689f29cafd40164bd3d195497139f99 100644 --- a/src/mednet/libs/classification/engine/saliency/interpretability.py +++ b/src/mednet/libs/classification/engine/saliency/interpretability.py @@ -16,7 +16,7 @@ from tqdm import tqdm from ...config.data.tbx11k.datamodule import BoundingBox, BoundingBoxes -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) SaliencyMap: typing.TypeAlias = ( typing.Sequence[typing.Sequence[float]] | numpy.typing.NDArray[numpy.double] diff --git a/src/mednet/libs/classification/engine/saliency/viewer.py b/src/mednet/libs/classification/engine/saliency/viewer.py index 063ce7379c7a777d2cd28d8f28f4d7b1f118ccb2..112820a021f44ce239725fcb3f61b37f4e96030c 100644 --- a/src/mednet/libs/classification/engine/saliency/viewer.py +++ b/src/mednet/libs/classification/engine/saliency/viewer.py @@ -17,7 +17,7 @@ from tqdm import tqdm from ...config.data.tbx11k.datamodule import BoundingBox, BoundingBoxes -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) def _overlay_saliency_map( diff --git a/src/mednet/libs/classification/models/alexnet.py b/src/mednet/libs/classification/models/alexnet.py index 7e20c5943a25a2852f7c38e892af04f91262f977..4d88888189ed431ce497d3e3014e86ccdf980f8a 100644 --- a/src/mednet/libs/classification/models/alexnet.py +++ b/src/mednet/libs/classification/models/alexnet.py @@ -13,7 +13,7 @@ import torchvision.models as models from mednet.libs.common.data.typing import TransformSequence from mednet.libs.common.models.model import Model -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class Alexnet(Model): diff --git a/src/mednet/libs/classification/models/densenet.py b/src/mednet/libs/classification/models/densenet.py index 5f41f1aebfbc8fb4b2315996a33dd39f4301d3c6..82f8d99f901485a416733cc6675f616b4ac3a52a 100644 --- a/src/mednet/libs/classification/models/densenet.py +++ b/src/mednet/libs/classification/models/densenet.py @@ -13,7 +13,7 @@ import torchvision.models as models from mednet.libs.common.data.typing import TransformSequence from mednet.libs.common.models.model import Model -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class Densenet(Model): diff --git a/src/mednet/libs/classification/models/loss_weights.py b/src/mednet/libs/classification/models/loss_weights.py index 5f646e322fcdf4ac60303ff41bf35e0037e2074f..e9de53754e71f1c4773c062acc35827e8a80baf8 100644 --- a/src/mednet/libs/classification/models/loss_weights.py +++ b/src/mednet/libs/classification/models/loss_weights.py @@ -8,7 +8,7 @@ import torch import torch.utils.data from mednet.libs.common.data.typing import DataLoader -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) def _get_label_weights( diff --git a/src/mednet/libs/classification/models/pasa.py b/src/mednet/libs/classification/models/pasa.py index 37415a7690a128728d5cd280a47ebef194114330..0b5c24da02b73f1328651612e216cb731b90bbf7 100644 --- a/src/mednet/libs/classification/models/pasa.py +++ b/src/mednet/libs/classification/models/pasa.py @@ -13,7 +13,7 @@ import torch.utils.data from mednet.libs.common.data.typing import TransformSequence from mednet.libs.common.models.model import Model -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class Pasa(Model): diff --git a/src/mednet/libs/common/data/augmentations.py b/src/mednet/libs/common/data/augmentations.py index cd186191291f2d6c8b4a89c21afb310499c81739..fcf8887d06b23bdf7f4f187651e9041b43d5b38e 100644 --- a/src/mednet/libs/common/data/augmentations.py +++ b/src/mednet/libs/common/data/augmentations.py @@ -22,7 +22,7 @@ import numpy.typing import torch from scipy.ndimage import gaussian_filter, map_coordinates -logger = logging.getLogger("mednet.libs.classification.common") +logger = logging.getLogger(__name__) def _elastic_deformation_on_image( diff --git a/src/mednet/libs/common/data/datamodule.py b/src/mednet/libs/common/data/datamodule.py index 4439b9901101170018ad93750ac0fe704b097f63..f0ed67b54431a9be5675b8aa3493752eb1dd1a6c 100644 --- a/src/mednet/libs/common/data/datamodule.py +++ b/src/mednet/libs/common/data/datamodule.py @@ -28,7 +28,7 @@ from .typing import ( TransformSequence, ) -logger = logging.getLogger("mednet.libs.classification.common") +logger = logging.getLogger(__name__) def _sample_size_bytes(s: Sample) -> int: diff --git a/src/mednet/libs/common/data/split.py b/src/mednet/libs/common/data/split.py index 14d0ac084533d0e79d327e23ec66d4a4b863db8c..aace283f97d7618300c5b6d6d041b8a369a906ea 100644 --- a/src/mednet/libs/common/data/split.py +++ b/src/mednet/libs/common/data/split.py @@ -13,7 +13,7 @@ import typing import torch from mednet.libs.common.data.typing import DatabaseSplit, RawDataLoader -logger = logging.getLogger("mednet.libs.classification.common") +logger = logging.getLogger(__name__) class JSONDatabaseSplit(DatabaseSplit): diff --git a/src/mednet/libs/common/engine/callbacks.py b/src/mednet/libs/common/engine/callbacks.py index 652f7fee5e2c949fb1361a247450ff783ade849a..3d108a8d2c372478d7792de8d65a4b21e2ce3428 100644 --- a/src/mednet/libs/common/engine/callbacks.py +++ b/src/mednet/libs/common/engine/callbacks.py @@ -13,7 +13,7 @@ import torch from ..utils.resources import ResourceMonitor, aggregate -logger = logging.getLogger("mednet.libs.classification.common") +logger = logging.getLogger(__name__) class LoggingCallback(lightning.pytorch.Callback): diff --git a/src/mednet/libs/common/engine/device.py b/src/mednet/libs/common/engine/device.py index efbbbd771b7d04b0b647e2ec36413037a4f2fe4d..4375cbb3f03318d2507f0e33a7dac0ef2b626fef 100644 --- a/src/mednet/libs/common/engine/device.py +++ b/src/mednet/libs/common/engine/device.py @@ -9,7 +9,7 @@ import typing import torch import torch.backends -logger = logging.getLogger("mednet.libs.classification.common") +logger = logging.getLogger(__name__) SupportedPytorchDevice: typing.TypeAlias = typing.Literal[ diff --git a/src/mednet/libs/common/engine/trainer.py b/src/mednet/libs/common/engine/trainer.py index 7d0e8b38cd0455e7d92830db0eb97ea3f983ae5c..5d3f2a0de703aa97faa055b2c269d1e3b816eba1 100644 --- a/src/mednet/libs/common/engine/trainer.py +++ b/src/mednet/libs/common/engine/trainer.py @@ -15,7 +15,7 @@ from ..utils.resources import ResourceMonitor from .callbacks import LoggingCallback from .device import DeviceManager -logger = logging.getLogger("mednet.libs.classification.common") +logger = logging.getLogger(__name__) def run( diff --git a/src/mednet/libs/common/models/loss_weights.py b/src/mednet/libs/common/models/loss_weights.py index 596c9e7b75babb85e5d15a714a1e3d1de70aa3db..74f7ef38a50ff4896e7f027a1b3865c7f279433c 100644 --- a/src/mednet/libs/common/models/loss_weights.py +++ b/src/mednet/libs/common/models/loss_weights.py @@ -9,7 +9,7 @@ from collections import Counter import torch import torch.utils.data -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) def compute_binary_weights(targets): diff --git a/src/mednet/libs/common/models/model.py b/src/mednet/libs/common/models/model.py index fb4c6e18a8ebdfa5d6a016ff44839844f8e4484c..4dc98b1da5e049bf541f751256428c912e8b8a32 100644 --- a/src/mednet/libs/common/models/model.py +++ b/src/mednet/libs/common/models/model.py @@ -16,7 +16,7 @@ from mednet.libs.common.data.typing import TransformSequence from .loss_weights import get_positive_weights from .typing import Checkpoint -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class Model(pl.LightningModule): diff --git a/src/mednet/libs/common/models/normalizer.py b/src/mednet/libs/common/models/normalizer.py index cc15adecdeb1176e0d89d35c0b3f0abb16e961e0..47ea5caf5a4c4ec59da5d44230730870400dd930 100644 --- a/src/mednet/libs/common/models/normalizer.py +++ b/src/mednet/libs/common/models/normalizer.py @@ -11,7 +11,7 @@ import torch.utils.data import torchvision.transforms import tqdm -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) def make_z_normalizer( diff --git a/src/mednet/libs/common/scripts/utils.py b/src/mednet/libs/common/scripts/utils.py index e9e8c087f1b34bf381095e5dd00e58cb519cfb61..35c4778793f280a31192939c47cec41225270bef 100644 --- a/src/mednet/libs/common/scripts/utils.py +++ b/src/mednet/libs/common/scripts/utils.py @@ -15,7 +15,7 @@ import lightning.pytorch.callbacks import torch.nn from mednet.libs.common.engine.device import SupportedPytorchDevice -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) JSONable: typing.TypeAlias = ( typing.Mapping[str, "JSONable"] diff --git a/src/mednet/libs/common/utils/checkpointer.py b/src/mednet/libs/common/utils/checkpointer.py index a063dbe038f2a0f79969dad50fca90ad641ac9ef..19450a13c81d45d7ce58a61e7c05deae48db6413 100644 --- a/src/mednet/libs/common/utils/checkpointer.py +++ b/src/mednet/libs/common/utils/checkpointer.py @@ -7,7 +7,7 @@ import pathlib import re import typing -logger = logging.getLogger("mednet.libs.classification.common") +logger = logging.getLogger(__name__) CHECKPOINT_ALIASES = { diff --git a/src/mednet/libs/common/utils/resources.py b/src/mednet/libs/common/utils/resources.py index ca99d2f71c94c485056eaaae84d2a0a023e90f3c..aaa1b6f09e71392a2e4fa1dc3942686c24d11748 100644 --- a/src/mednet/libs/common/utils/resources.py +++ b/src/mednet/libs/common/utils/resources.py @@ -19,7 +19,7 @@ import numpy import psutil from mednet.libs.common.engine.device import SupportedPytorchDevice -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) _nvidia_smi = shutil.which("nvidia-smi") """Location of the nvidia-smi program, if one exists.""" diff --git a/src/mednet/libs/segmentation/engine/predictor.py b/src/mednet/libs/segmentation/engine/predictor.py index 0e5c290f1ed28e975dc6a3bd702353039ba0ae34..ecac93592137f5bf4e560e2f36d969c5b368bd58 100644 --- a/src/mednet/libs/segmentation/engine/predictor.py +++ b/src/mednet/libs/segmentation/engine/predictor.py @@ -13,7 +13,7 @@ import torch.utils.data import tqdm from mednet.libs.common.engine.device import DeviceManager -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class _HDF5Writer(lightning.pytorch.callbacks.BasePredictionWriter): diff --git a/src/mednet/libs/segmentation/models/driu.py b/src/mednet/libs/segmentation/models/driu.py index 6dbdef7880bbdf6c937a96c19739ec36af8817d4..eac0afc03965519ac1af65127ac5565f31151e2a 100644 --- a/src/mednet/libs/segmentation/models/driu.py +++ b/src/mednet/libs/segmentation/models/driu.py @@ -15,7 +15,7 @@ from .backbones.vgg import vgg16_for_segmentation from .losses import SoftJaccardBCELogitsLoss from .make_layers import UpsampleCropBlock, conv_with_kaiming_uniform -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class ConcatFuseBlock(torch.nn.Module): diff --git a/src/mednet/libs/segmentation/models/driu_bn.py b/src/mednet/libs/segmentation/models/driu_bn.py index 07ddc62508f79d0717edca85171404ff980dcd56..7804ed06747d22cd947f4a1ba46d657d9e36c64d 100644 --- a/src/mednet/libs/segmentation/models/driu_bn.py +++ b/src/mednet/libs/segmentation/models/driu_bn.py @@ -15,7 +15,7 @@ from .backbones.vgg import vgg16_for_segmentation from .losses import SoftJaccardBCELogitsLoss from .make_layers import UpsampleCropBlock, conv_with_kaiming_uniform -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class ConcatFuseBlock(torch.nn.Module): diff --git a/src/mednet/libs/segmentation/models/driu_od.py b/src/mednet/libs/segmentation/models/driu_od.py index 1e1802af8f973ac9792a5bb7ab99114629dd929f..be7416c7f34e89a6c826f4b87f0dbafe5c4e1a99 100644 --- a/src/mednet/libs/segmentation/models/driu_od.py +++ b/src/mednet/libs/segmentation/models/driu_od.py @@ -16,7 +16,7 @@ from .driu import ConcatFuseBlock from .losses import SoftJaccardBCELogitsLoss from .make_layers import UpsampleCropBlock -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class DRIUODHead(torch.nn.Module): diff --git a/src/mednet/libs/segmentation/models/driu_pix.py b/src/mednet/libs/segmentation/models/driu_pix.py index 29942643e4c6e9f44d2121534ec15d6bca707c43..23218a577a34367b090a51dbd7340366f67dbe5c 100644 --- a/src/mednet/libs/segmentation/models/driu_pix.py +++ b/src/mednet/libs/segmentation/models/driu_pix.py @@ -16,7 +16,7 @@ from .driu import ConcatFuseBlock from .losses import SoftJaccardBCELogitsLoss from .make_layers import UpsampleCropBlock -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class DRIUPIXHead(torch.nn.Module): diff --git a/src/mednet/libs/segmentation/models/hed.py b/src/mednet/libs/segmentation/models/hed.py index e3bcd094814ff4981ddead877ae079322b3546d4..8771f55813aab08ccbe853d151f6f28c26ba816b 100644 --- a/src/mednet/libs/segmentation/models/hed.py +++ b/src/mednet/libs/segmentation/models/hed.py @@ -14,7 +14,7 @@ from .backbones.vgg import vgg16_for_segmentation from .losses import MultiSoftJaccardBCELogitsLoss from .make_layers import UpsampleCropBlock, conv_with_kaiming_uniform -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class ConcatFuseBlock(torch.nn.Module): diff --git a/src/mednet/libs/segmentation/models/m2unet.py b/src/mednet/libs/segmentation/models/m2unet.py index d934881ce9082694effad5ed4e0c4a431d51e654..60f97967ef96b25c87afee5570cc81a8d7cab90c 100644 --- a/src/mednet/libs/segmentation/models/m2unet.py +++ b/src/mednet/libs/segmentation/models/m2unet.py @@ -14,7 +14,7 @@ from torchvision.models.mobilenetv2 import InvertedResidual from .backbones.mobilenetv2 import mobilenet_v2_for_segmentation -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class DecoderBlock(torch.nn.Module): diff --git a/src/mednet/libs/segmentation/models/unet.py b/src/mednet/libs/segmentation/models/unet.py index 04317572c856704091c5b5022a843049c69e53fe..7a3ee9bbccde07ef897e1cf03ad3e4efeb44cf17 100644 --- a/src/mednet/libs/segmentation/models/unet.py +++ b/src/mednet/libs/segmentation/models/unet.py @@ -14,7 +14,7 @@ from .backbones.vgg import vgg16_for_segmentation from .losses import SoftJaccardBCELogitsLoss from .make_layers import UnetBlock, conv_with_kaiming_uniform -logger = logging.getLogger("mednet") +logger = logging.getLogger(__name__) class UNetHead(torch.nn.Module):