From 102abd71d36322811efa9833499a93cdf43d9a05 Mon Sep 17 00:00:00 2001 From: WithanagePerera Date: Sun, 9 Nov 2025 22:41:56 -0500 Subject: [PATCH 1/2] Minor path fix to access the weights file. --- vision_stack/layers/UnderwaterEnhancementLayer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: From 341279c6a423bc63d944e30ba5cc3c01beac2226 Mon Sep 17 00:00:00 2001 From: WithanagePerera Date: Sun, 9 Nov 2025 22:43:21 -0500 Subject: [PATCH 2/2] Passed in a layer name during construction, that way my publisher name logic in my other branch (Praveen-VisionStackTests) can create a publisher with the name of this layer. --- vision_stack/layers/NormalizationLayer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)