diff --git a/models/common.py b/models/common.py index 557163310e74..29d02e741e17 100644 --- a/models/common.py +++ b/models/common.py @@ -427,7 +427,7 @@ def forward(self, im, augment=False, visualize=False, val=False): conf, cls = y['confidence'].max(1), y['confidence'].argmax(1).astype(np.float) y = np.concatenate((box, conf.reshape(-1, 1), cls.reshape(-1, 1)), 1) else: - y = y[list(y)[-1]] # last output + y = y[sorted(y)[-1]] # last output else: # TensorFlow (SavedModel, GraphDef, Lite, Edge TPU) im = im.permute(0, 2, 3, 1).cpu().numpy() # torch BCHW to numpy BHWC shape(1,320,192,3) if self.saved_model: # SavedModel