@@ -192,8 +192,11 @@ def __repr__(self):
192
192
193
193
def resize_keypoints (keypoints , original_size , new_size ):
194
194
# type: (Tensor, List[int], List[int])
195
- ratios = [torch .tensor (s , dtype = torch .float32 , device = keypoints .device ) / torch .tensor (s_orig , dtype = torch .float32 , device = keypoints .device )
196
- for s , s_orig in zip (new_size , original_size )]
195
+ ratios = [
196
+ torch .tensor (s , dtype = torch .float32 , device = keypoints .device ) /
197
+ torch .tensor (s_orig , dtype = torch .float32 , device = keypoints .device )
198
+ for s , s_orig in zip (new_size , original_size )
199
+ ]
197
200
ratio_h , ratio_w = ratios
198
201
resized_data = keypoints .clone ()
199
202
if torch ._C ._get_tracing_state ():
@@ -208,8 +211,11 @@ def resize_keypoints(keypoints, original_size, new_size):
208
211
209
212
def resize_boxes (boxes , original_size , new_size ):
210
213
# type: (Tensor, List[int], List[int])
211
- ratios = [torch .tensor (s , dtype = torch .float32 , device = boxes .device ) / torch .tensor (s_orig , dtype = torch .float32 , device = boxes .device )
212
- for s , s_orig in zip (new_size , original_size )]
214
+ ratios = [
215
+ torch .tensor (s , dtype = torch .float32 , device = boxes .device ) /
216
+ torch .tensor (s_orig , dtype = torch .float32 , device = boxes .device )
217
+ for s , s_orig in zip (new_size , original_size )
218
+ ]
213
219
ratio_height , ratio_width = ratios
214
220
xmin , ymin , xmax , ymax = boxes .unbind (1 )
215
221
0 commit comments