Remove unnecessary assignments (#15582)

pull/15600/head
Laughing 3 months ago committed by GitHub
parent 38bb58ae12
commit be9fe124e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/data/augment.py

@ -539,7 +539,6 @@ class Mosaic(BaseMixTransform):
assert 0 <= p <= 1.0, f"The probability should be in range [0, 1], but got {p}."
assert n in {4, 9}, "grid must be equal to 4 or 9."
super().__init__(dataset=dataset, p=p)
self.dataset = dataset
self.imgsz = imgsz
self.border = (-imgsz // 2, -imgsz // 2) # width, height
self.n = n
@ -1692,7 +1691,6 @@ class CopyPaste:
instances.convert_bbox(format="xyxy")
instances.denormalize(w, h)
if self.p and len(instances.segments):
n = len(instances)
_, w, _ = im.shape # height, width, channels
im_new = np.zeros(im.shape, np.uint8)

Loading…
Cancel
Save