ONNX compatibility updates
This commit is contained in:
parent
16bc3b72c3
commit
d1951c1868
|
@ -317,6 +317,7 @@ class Darknet(nn.Module):
|
|||
|
||||
ONNX_export = False
|
||||
if ONNX_export:
|
||||
# Produce a single-layer *.onnx model (upsample ops not working in PyTorch 1.0 export yet)
|
||||
output = output[0].squeeze().transpose(0, 1) # first layer reshaped to 85 x 507
|
||||
output[5:] = torch.nn.functional.softmax(torch.sigmoid(output[5:]) * output[4:5], dim=0) # SSD-like conf
|
||||
return output[5:], output[:4] # ONNX scores, boxes
|
||||
|
|
Loading…
Reference in New Issue