toolkit
toolkit copied to clipboard
TypeError about Analysis vot2020
when I analysis the result following the official guidelines
vot analysis --workspace <workspace-path> <tracker-name> --output json
it meets a TypeError "TypeError: Object of type 'Grid' is not JSON serializable"
Can you help me to solve the problem? Thank you!
Can you be more specific and post a track trace and some details about your system and the version of the toolkit that you have installed.
I think it may be an encoding problem by json.dumps
and have solved it by adding
class DateEnconding(json.JSONEncoder):
def default(self, o):
if isinstance(o, datetime.date):
return o.strftime('%Y/%m/%d')
in vot/document/__init__.py
and replace
if serializer == "json":
with storage.write("results.json") as handle:
json.dump(doc, handle, indent=2)
with
if serializer == "json":
with storage.write("results.json") as handle:
json.dump(doc, handle, indent=2, cls=DateEnconding)
I used Toolkit version: 0.4.2, python 3.6, pytorch 1.3, cuda10+cudnn7 and the tracker is the official oceanplus
Hm, yes, that may be a problem, I have not used JSON output for a long time now, apparently, a date structure was thrown in somewhere. Thanks!
I have been working on analysis code a few days ago, but the commits are currently in dev branch. I will merge them once they are tested a bit more.