Apply ruff==0.9.0 formatting (#18624)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
c196a82bfa
commit
34b339d033
12 changed files with 17 additions and 30 deletions
|
|
@ -60,8 +60,7 @@ def exif_size(img: Image.Image):
|
|||
s = img.size # (width, height)
|
||||
if img.format == "JPEG": # only support JPEG images
|
||||
try:
|
||||
exif = img.getexif()
|
||||
if exif:
|
||||
if exif := img.getexif():
|
||||
rotation = exif.get(274, None) # the EXIF key for the orientation tag is 274
|
||||
if rotation in {6, 8}: # rotation 270 or 90
|
||||
s = s[1], s[0]
|
||||
|
|
@ -125,8 +124,7 @@ def verify_image_label(args):
|
|||
segments = [np.array(x[1:], dtype=np.float32).reshape(-1, 2) for x in lb] # (cls, xy1...)
|
||||
lb = np.concatenate((classes.reshape(-1, 1), segments2boxes(segments)), 1) # (cls, xywh)
|
||||
lb = np.array(lb, dtype=np.float32)
|
||||
nl = len(lb)
|
||||
if nl:
|
||||
if nl := len(lb):
|
||||
if keypoint:
|
||||
assert lb.shape[1] == (5 + nkpt * ndim), f"labels require {(5 + nkpt * ndim)} columns each"
|
||||
points = lb[:, 5:].reshape(-1, ndim)[:, :2]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue