Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kartikgupta0909/fd1b81d1c8416d454256bbcf0a212f7f to your computer and use it in GitHub Desktop.
Save kartikgupta0909/fd1b81d1c8416d454256bbcf0a212f7f to your computer and use it in GitHub Desktop.
def create_groundtruth_dict(name, datadict):
groundtruth = {
"type": "unknown", # TODO: See if that needs to be modified.
"version": 1.0,
"className": db.dataset._slugify(unicode(name)),
"groundTruth": {},
}
for r, cls in datadict.items():
if isinstance(r, unicode):
r = r.encode("UTF-8")
groundtruth["groundTruth"][r] = cls.encode("UTF-8")
return groundtruth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment