From c3f7389afa7b2f4f0e1495b21ba2efc41d7c96b6 Mon Sep 17 00:00:00 2001 From: Dlt <71595451+MrDlt@users.noreply.github.com> Date: Fri, 29 Dec 2023 23:35:11 +0800 Subject: [PATCH] Update transforms.py Thanks for the author of this article: https://blog.csdn.net/m0_63077499/article/details/128804226 --- vision/transforms/transforms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vision/transforms/transforms.py b/vision/transforms/transforms.py index c53b38e..1d6ed8b 100644 --- a/vision/transforms/transforms.py +++ b/vision/transforms/transforms.py @@ -259,7 +259,7 @@ class RandomSampleCrop(object): """ def __init__(self): - self.sample_options = ( + self.sample_options = np.array([ # using entire original input image None, # sample a patch s.t. MIN jaccard w/ obj in .1,.3,.4,.7,.9 @@ -269,7 +269,7 @@ def __init__(self): (0.9, None), # randomly sample a patch (None, None), - ) + ], dtype=object) def __call__(self, image, boxes=None, labels=None): height, width, _ = image.shape @@ -364,7 +364,7 @@ class RandomSampleCrop_v2(object): """ def __init__(self): - self.sample_options = ( + self.sample_options = np.array([ # using entire original input image None, # sample a patch s.t. MIN jaccard w/ obj in .1,.3,.4,.7,.9 @@ -374,7 +374,7 @@ def __init__(self): (1, None), (1, None), (1, None), - ) + ], dtype=object) def __call__(self, image, boxes=None, labels=None): height, width, _ = image.shape