Apply ruff==0.9.0 formatting (#13486)
* Refactor code for speed and clarity * Auto-format by https://ultralytics.com/actions --------- Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
1 parent
6981c2742a
commit
86fd1ab270
20 files changed
+53
-84
No files matched your search
@@ -69,16 +69,8 @@ def random_perspective(
|
||||
else: # affine
|
||||
im = cv2.warpAffine(im, M[:2], dsize=(width, height), borderValue=(114, 114, 114))
|
||||
|
||||
# Visualize
|
||||
# import matplotlib.pyplot as plt
|
||||
# ax = plt.subplots(1, 2, figsize=(12, 6))[1].ravel()
|
||||
# ax[0].imshow(im[:, :, ::-1]) # base
|
||||
# ax[1].imshow(im2[:, :, ::-1]) # warped
|
||||
|
||||
# Transform label coordinates
|
||||
n = len(targets)
|
||||
new_segments = []
|
||||
if n:
|
||||
if n := len(targets):
|
||||
new = np.zeros((n, 4))
|
||||
segments = resample_segments(segments) # upsample
|
||||
for i, segment in enumerate(segments):
|
||||
|
||||
Reference in new issue
Block a user