Skip to content

Commit

Permalink
Support ppocr_mobile_det model of op11 (#272)
Browse files Browse the repository at this point in the history
* fixed ppocr_det op11 has huge diff

* fixed some bugs

* fixed nearest bugs

* fixed nearest bugs
  • Loading branch information
wjj19950828 authored Jul 5, 2021
1 parent f8db7b7 commit 7893509
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions paddle2onnx/op_mapper/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,12 +1027,21 @@ def opset_11(cls, graph, node, **kw):
in_shape, out_shape = cls.compute_output_shape_by_size(graph,
node)
inputs += [empty_node, out_shape]
graph.make_node(
'Resize',
inputs=inputs,
outputs=node.output('Out'),
mode=resize_type,
coordinate_transformation_mode=coordinate_transformation_mode)
if resize_type == 'nearest' and coordinate_transformation_mode == 'asymmetric':
graph.make_node(
'Resize',
inputs=inputs,
outputs=node.output('Out'),
mode=resize_type,
coordinate_transformation_mode=coordinate_transformation_mode,
nearest_mode='floor')
else:
graph.make_node(
'Resize',
inputs=inputs,
outputs=node.output('Out'),
mode=resize_type,
coordinate_transformation_mode=coordinate_transformation_mode)

@classmethod
def compute_output_shape(cls, graph, node, opset_version=10):
Expand Down

0 comments on commit 7893509

Please sign in to comment.