fix: convert numpy array to list to avoid AttributeError on append #4731
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复 PaddlePaddle/PaddleOCR#17068
问题现象
问题原因
layout_det_res["boxes"]在前序流程中被包装成了ndarray,但后续逻辑仍然按列表调用layout_det_res["boxes"].append(...),导致报错。解决方案
在调用
append之前,将layout_det_res["boxes"]从ndarray显式还原为list,保证后续 append 调用正常执行。