Skip to content

Commit 6e4f853

Browse files
Convert numpy types to python when serializing...
1 parent 4e34e5a commit 6e4f853

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

diplomat/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
A tool providing multi-animal tracking capabilities on top of other Deep learning based tracking software.
33
"""
44

5-
__version__ = "0.3.2"
5+
__version__ = "0.3.3"
66
# Can be used by functions to determine if diplomat was invoked through it's CLI interface.
77
CLI_RUN = False
88

diplomat/predictors/sfpe/file_io.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ def default(self, o: Any) -> Any:
4444
if(isinstance(o, Path)):
4545
return str(o)
4646

47+
if(isinstance(o, np.generic)):
48+
return o.tolist()
49+
4750
to_json = getattr(o, "__tojson__", None)
4851
if(to_json is None):
52+
print(o)
4953
return super().default(o)
5054
d = to_json()
5155

0 commit comments

Comments
 (0)