From c57a8f03c94819da4dd461f209dae602d1aeac11 Mon Sep 17 00:00:00 2001 From: Stefan Klut Date: Tue, 26 Mar 2024 16:29:56 +0100 Subject: [PATCH] strip the read file contents --- core/setup.py | 2 +- run.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/setup.py b/core/setup.py index 6437ca4..8e43bd2 100644 --- a/core/setup.py +++ b/core/setup.py @@ -53,7 +53,7 @@ def get_git_hash() -> str: if version_path.is_file(): with version_path.open(mode="r") as file: - git_hash = file.read() + git_hash = file.read().strip() else: git_hash = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=Path(__file__).resolve().parent).strip().decode() return git_hash diff --git a/run.py b/run.py index 84f8312..9140334 100644 --- a/run.py +++ b/run.py @@ -148,6 +148,7 @@ def cpu_call(self, data: AugInput) -> tuple[dict, int, int]: height, width, channels = data.image.shape assert channels == 3, f"Must be a RBG image, found {channels} channels" + # In place augmentation transform = self.aug(data) image = torch.as_tensor(data.image, dtype=torch.float32, device=self.cfg.MODEL.DEVICE).permute(2, 0, 1)