CoreML inference fix `list()` -> `sorted()` (#6496)

pull/6498/head
Glenn Jocher 2022-02-01 22:34:15 +01:00 committed by GitHub
parent 5e4ff195b2
commit 77977e0791
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -427,7 +427,7 @@ class DetectMultiBackend(nn.Module):
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