Created
August 12, 2016 06:48
-
-
Save kartikgupta0909/fd1b81d1c8416d454256bbcf0a212f7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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