imgsz warning fix, download function consolidation (#681)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: HaeJin Lee <seareale@gmail.com> Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
This commit is contained in:
parent
0609561549
commit
899abe9f82
26 changed files with 171 additions and 147 deletions
|
|
@ -44,8 +44,20 @@ class Compose:
|
|||
self.transforms = transforms
|
||||
|
||||
def __call__(self, data):
|
||||
mosaic_p = None
|
||||
mosaic_imgsz = None
|
||||
|
||||
for t in self.transforms:
|
||||
data = t(data)
|
||||
if isinstance(t, Mosaic):
|
||||
temp = t(data)
|
||||
mosaic_p = False if temp == data else True
|
||||
mosaic_imgsz = t.imgsz
|
||||
data = temp
|
||||
else:
|
||||
if isinstance(t, RandomPerspective):
|
||||
t.border = [-mosaic_imgsz // 2, -mosaic_imgsz // 2] if mosaic_p else [0, 0]
|
||||
data = t(data)
|
||||
|
||||
return data
|
||||
|
||||
def append(self, transform):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue