diff --git a/vision_stack/layers/NormalizationLayer.py b/vision_stack/layers/NormalizationLayer.py index 7e83c04..0c9b330 100644 --- a/vision_stack/layers/NormalizationLayer.py +++ b/vision_stack/layers/NormalizationLayer.py @@ -33,7 +33,7 @@ def __init__(self) -> None: """ Normalizes the image by calculating the median and the IQR of all the pixels, then subtracting the median form the pixels and dividing by the IQR. """ - super().__init__() + super().__init__("RobustScalingLayer") def process(self, image): median = np.median(image) diff --git a/vision_stack/layers/UnderwaterEnhancementLayer.py b/vision_stack/layers/UnderwaterEnhancementLayer.py index 0cc19c5..060476a 100644 --- a/vision_stack/layers/UnderwaterEnhancementLayer.py +++ b/vision_stack/layers/UnderwaterEnhancementLayer.py @@ -9,6 +9,7 @@ import os import torch +from pathlib import Path from PIL import Image import torch import numpy as np @@ -18,7 +19,7 @@ from .Layer import PreprocessLayer -WEIGHTS_PATH = os.path.join(os.getcwd(), "vision_stack", "weights", 'model_best_2842.pth.tar') +WEIGHTS_PATH = Path(os.path.abspath(__file__)).parent.parent / "weights" / "model_best_2842.pth.tar" class UnderWaterImageEnhancementLayer(PreprocessLayer): def __init__(self) -> None: