Skip to content

Commit

Permalink
bugfix when no augs
Browse files Browse the repository at this point in the history
  • Loading branch information
arzamnik committed Mar 10, 2022
1 parent ad51aad commit 2975302
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions train/src/sly_imgaugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2975302

Please sign in to comment.