Commit 47430173 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'ordered' into 'master'

Preserve the order of json annotations

See merge request !41
parents 39be7a61 95db69d8
Pipeline #18604 passed with stages
in 31 minutes and 47 seconds
......@@ -4,6 +4,7 @@
import json
import logging
import os
import collections
logger = logging.getLogger(__name__)
_idiap_annotations = {
......@@ -130,7 +131,7 @@ def read_annotation_file(file_name, annotation_type):
2., (annotations['leyeo'][1] + annotations['leyei'][1]) / 2.)
elif str(annotation_type) == 'json':
annotations = json.load(f)
annotations = json.load(f, object_pairs_hook=collections.OrderedDict)
else:
raise ValueError(
"The given annotation type '%s' is not known, choose one of ('eyecenter', 'named', 'idiap')" % annotation_type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment