Skip to content

Commit

Permalink
Merge pull request #383 from kwcckw/dev
Browse files Browse the repository at this point in the history
Fixed bug in PaperFactory.
  • Loading branch information
kwcckw authored Oct 16, 2023
2 parents 1e619b7 + b1c7094 commit ec1104e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion augraphy/base/paperfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,18 @@ def __call__(self, image, layer=None, mask=None, keypoints=None, bounding_boxes=
brighten_max = 1 + brighten_ratio
brightness = Brightness(brightness_range=(brighten_min, brighten_max), min_brightness=1)
texture = brightness(texture)
return texture

# check for additional output of mask, keypoints and bounding boxes
outputs_extra = []
if mask is not None or keypoints is not None or bounding_boxes is not None:
outputs_extra = [mask, keypoints, bounding_boxes]

# returns additional mask, keypoints and bounding boxes if there is additional input
if outputs_extra:
# returns in the format of [image, mask, keypoints, bounding_boxes]
return [texture] + outputs_extra
else:
return texture

def check_paper_edges(self, texture):
"""Crop image section with better texture.
Expand Down

0 comments on commit ec1104e

Please sign in to comment.