Skip to content

Commit f793253

Browse files
authored
Merge pull request leoxiaobin#138 from GongXinyuu/patch-1
conduct flip operation with pytorch
2 parents 51638bf + 3dfad1e commit f793253

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/core/function.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,7 @@ def validate(config, val_loader, val_dataset, model, criterion, output_dir,
124124
output = outputs
125125

126126
if config.TEST.FLIP_TEST:
127-
# this part is ugly, because pytorch has not supported negative index
128-
# input_flipped = model(input[:, :, :, ::-1])
129-
input_flipped = np.flip(input.cpu().numpy(), 3).copy()
130-
input_flipped = torch.from_numpy(input_flipped).cuda()
127+
input_flipped = input.flip(3)
131128
outputs_flipped = model(input_flipped)
132129

133130
if isinstance(outputs_flipped, list):

0 commit comments

Comments
 (0)