Exemplo n.º 1
0
 def load_annotation(self, drivename, fname, dtype='object'):
     fname = fname.split('.')[0] + '.json'
     try:
         with open(join(self.OUTPUT_ANN_DIR, drivename, fname),
                   "r") as read_file:
             print("file: ", read_file)
             try:
                 frame = json.load(read_file)
                 if dtype == 'object':
                     return Frame.parse_json(frame)
                 else:
                     return frame
             except json.JSONDecodeError:
                 return ""
     except:
         return ""
Exemplo n.º 2
0
 def load_annotation(
     self,
     drivename,
     fname,
     settingsControls,
     dtype='object',
     ):
     fname = settingsControls['AnnotatorId'] + '.' + fname.split('.'
             )[0] + '.json'
     try:
         with open(join(self.OUTPUT_ANN_DIR, drivename, fname), 'r'
                   ) as read_file:
             #print ('file: ', read_file)
             try:
                 frame = json.load(read_file)
                 if dtype == 'object':
                     return Frame.parse_json(frame)
                 else:
                     return frame
             except json.JSONDecodeError:
                 return ''
     except:
         return ''