File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ def __init__(self,
4040 img_prefix ,
4141 img_scale ,
4242 img_norm_cfg ,
43+ multiscale_mode = 'value' ,
4344 size_divisor = None ,
4445 proposal_file = None ,
4546 num_max_proposals = 1000 ,
@@ -73,6 +74,10 @@ def __init__(self,
7374 # normalization configs
7475 self .img_norm_cfg = img_norm_cfg
7576
77+ # multi-scale mode (only applicable for multi-scale training)
78+ self .multiscale_mode = multiscale_mode
79+ assert multiscale_mode in ['value' , 'range' ]
80+
7681 # max proposals per image
7782 self .num_max_proposals = num_max_proposals
7883 # flip ratio
@@ -196,7 +201,8 @@ def prepare_train_img(self, idx):
196201
197202 # apply transforms
198203 flip = True if np .random .rand () < self .flip_ratio else False
199- img_scale = random_scale (self .img_scales ) # sample a scale
204+ # randomly sample a scale
205+ img_scale = random_scale (self .img_scales , self .multiscale_mode )
200206 img , img_shape , pad_shape , scale_factor = self .img_transform (
201207 img , img_scale , flip , keep_ratio = self .resize_keep_ratio )
202208 img = img .copy ()
You can’t perform that action at this time.
0 commit comments