MCPcopy Create free account
hub / github.com/PaddlePaddle/PaddleOCR / _numpy_to_python

Function _numpy_to_python

deploy/ios_demo/scripts/ocr_reference_run.py:57–68  ·  view source on GitHub ↗
(obj: Any)

Source from the content-addressed store, hash-verified

55
56
57def _numpy_to_python(obj: Any) -> Any:
58 if obj is None:
59 return None
60 if hasattr(obj, "tolist"):
61 return obj.tolist()
62 if isinstance(obj, (list, tuple)):
63 return [_numpy_to_python(x) for x in obj]
64 if isinstance(obj, dict):
65 return {k: _numpy_to_python(v) for k, v in obj.items()}
66 elif isinstance(obj, (str, int, float, bool)):
67 return obj
68 return str(obj)
69
70
71def _extract_items(result_obj: Any) -> List[Dict[str, Any]]:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected