Skip to content

Commit 1ff16c8

Browse files
jbittonfacebook-github-bot
authored andcommitted
change augly linter back to black
Differential Revision: D68991965
1 parent d710e92 commit 1ff16c8

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

augly/image/utils/metadata.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,12 @@ def transform_bboxes(
118118
if dst_bboxes is None:
119119
return
120120

121-
assert (
122-
bbox_format is not None
123-
and bbox_format
124-
in [
125-
"pascal_voc",
126-
"pascal_voc_norm",
127-
"coco",
128-
"yolo",
129-
]
130-
), "bbox_format must be specified if bboxes are passed in and must be a supported format"
121+
assert bbox_format is not None and bbox_format in [
122+
"pascal_voc",
123+
"pascal_voc_norm",
124+
"coco",
125+
"yolo",
126+
], "bbox_format must be specified if bboxes are passed in and must be a supported format"
131127

132128
src_w, src_h = image.size
133129
aug_w, aug_h = aug_image.size

augly/video/augmenters/cv2/text.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,16 @@ def __init__(
4949
assert (
5050
text_change_nth is None or text_change_nth > 0
5151
), "`text_change_nth` must be greater than zero"
52-
assert (
53-
fonts is None
54-
or all(
55-
(isinstance(font, (str, ImageFont.ImageFont)) or (font in CV2_FONTS))
56-
and (chars is None or isinstance(chars, str))
57-
for font, chars in fonts
58-
)
52+
assert fonts is None or all(
53+
(isinstance(font, (str, ImageFont.ImageFont)) or (font in CV2_FONTS))
54+
and (chars is None or isinstance(chars, str))
55+
for font, chars in fonts
5956
), "Fonts must be either None or a list of tuples of font (cv2 font, PIL ImageFont, or str path to a .ttf file) & chars file (str path or None)"
60-
assert (
61-
fontscales is None or (fontscales[0] > 0 and fontscales[1] > fontscales[0])
57+
assert fontscales is None or (
58+
fontscales[0] > 0 and fontscales[1] > fontscales[0]
6259
), "Fontscale ranges must be greater than zero and the second value must be greater than the first" # noqa: B950
63-
assert (
64-
thickness is None or (type(thickness) == int and thickness > 0)
60+
assert thickness is None or (
61+
type(thickness) == int and thickness > 0
6562
), "Invalid thickness provided: must be set to None or be an integer greater than zero" # noqa: B950
6663

6764
super().__init__(1, random_movement, topleft, bottomright, **kwargs)

augly/video/helpers/metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def compute_insert_in_background_multiple_segments(
104104
assert n == len(
105105
src_segment_ends
106106
), "Source segment starts and ends lists must have equal length."
107-
assert (
108-
n == len(bkg_insertion_points)
107+
assert n == len(
108+
bkg_insertion_points
109109
), "Source segment starts and background insertion points lists must have equal length."
110110
assert n == len(
111111
src_ids

0 commit comments

Comments
 (0)