Skip to content

Commit

Permalink
CoreML inference fix list() -> sorted() (ultralytics#6496)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Feb 1, 2022
1 parent d328569 commit 0a552cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a552cb

Please sign in to comment.