Python refactorings and simplifications (#7549)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Hassaan Farooq <103611273+hassaanfarooq01@users.noreply.github.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
0da13831cf
commit
f6309b8e70
40 changed files with 127 additions and 189 deletions
|
|
@ -15,7 +15,6 @@ from ultralytics.utils.instance import Instances
|
|||
from ultralytics.utils.metrics import bbox_ioa
|
||||
from ultralytics.utils.ops import segment2box, xyxyxyxy2xywhr
|
||||
from ultralytics.utils.torch_utils import TORCHVISION_0_10, TORCHVISION_0_11, TORCHVISION_0_13
|
||||
|
||||
from .utils import polygons2masks, polygons2masks_overlap
|
||||
|
||||
DEFAULT_MEAN = (0.0, 0.0, 0.0)
|
||||
|
|
@ -1028,7 +1027,7 @@ def classify_transforms(
|
|||
|
||||
if isinstance(size, (tuple, list)):
|
||||
assert len(size) == 2
|
||||
scale_size = tuple([math.floor(x / crop_fraction) for x in size])
|
||||
scale_size = tuple(math.floor(x / crop_fraction) for x in size)
|
||||
else:
|
||||
scale_size = math.floor(size / crop_fraction)
|
||||
scale_size = (scale_size, scale_size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue