From 2975302b5fddb5720578bae8044feabefdde1cb0 Mon Sep 17 00:00:00 2001 From: Nikita Arzamazov Date: Thu, 10 Mar 2022 14:23:45 +0300 Subject: [PATCH] bugfix when no augs --- train/src/sly_imgaugs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/train/src/sly_imgaugs.py b/train/src/sly_imgaugs.py index 3d1290b..4cff9ad 100644 --- a/train/src/sly_imgaugs.py +++ b/train/src/sly_imgaugs.py @@ -6,10 +6,14 @@ class SlyImgAugs(object): def __init__(self, config_path): self.config_path = config_path - self.config = sly.json.load_json_file(self.config_path) - self.augs = sly.imgaug_utils.build_pipeline(self.config["pipeline"], random_order=self.config["random_order"]) + if self.config_path is not None: + config = sly.json.load_json_file(self.config_path) + self.augs = sly.imgaug_utils.build_pipeline(config["pipeline"], random_order=config["random_order"]) + def _apply_augs(self, results): + if self.config_path is None: + return img = results["img"] mask = results["gt_semantic_seg"] res_img, res_mask = sly.imgaug_utils.apply_to_image_and_mask(self.augs, img, mask)