CoreML inference fix `list()` -> `sorted()` (#6496)
Browse files- models/common.py +1 -1
models/common.py
CHANGED
@@ -427,7 +427,7 @@ class DetectMultiBackend(nn.Module):
|
|
427 |
conf, cls = y['confidence'].max(1), y['confidence'].argmax(1).astype(np.float)
|
428 |
y = np.concatenate((box, conf.reshape(-1, 1), cls.reshape(-1, 1)), 1)
|
429 |
else:
|
430 |
-
y = y[
|
431 |
else: # TensorFlow (SavedModel, GraphDef, Lite, Edge TPU)
|
432 |
im = im.permute(0, 2, 3, 1).cpu().numpy() # torch BCHW to numpy BHWC shape(1,320,192,3)
|
433 |
if self.saved_model: # SavedModel
|
|
|
427 |
conf, cls = y['confidence'].max(1), y['confidence'].argmax(1).astype(np.float)
|
428 |
y = np.concatenate((box, conf.reshape(-1, 1), cls.reshape(-1, 1)), 1)
|
429 |
else:
|
430 |
+
y = y[sorted(y)[-1]] # last output
|
431 |
else: # TensorFlow (SavedModel, GraphDef, Lite, Edge TPU)
|
432 |
im = im.permute(0, 2, 3, 1).cpu().numpy() # torch BCHW to numpy BHWC shape(1,320,192,3)
|
433 |
if self.saved_model: # SavedModel
|