parameters: (mat_file)
docstring: docstring for convert_worker
docstring_summary: docstring for convert_worker
docstring_tokens: docstring for convert_worker
function: def convert_worker(mat_file):
      """docstring for convert_worker"""
      try:
          if setting.CONVERT_RES == 1:
  	    image_id = '_'.join(mat_file.split('.')[0].split('_')[1:])
              print('image_id:{}'.format(image_id))
              mat_file = os.path.join(setting.PREDICT_LABEL_MAP_DIR, mat_file)
              mat = sio.loadmat(mat_file)
              #print(mat.keys())
              #exit(0)
              label_map = mat['inst_img']
              building_list = img_util.create_buildinglist_from_label_map(image_id, label_map)
              geojson_file = os.path.join(setting.PREDICT_PIXEL_GEO_JSON_DIR, '{}_predict.geojson'.format(image_id))
          else:
              #print('{}'.format(mat_file))
              image_id = '_'.join(mat_file.split('.')[0].split('_')[:])
              #print('{}'.format(image_id))
              mat_file = os.path.join(setting.LABEL_MAP_DIR_4X, mat_file)
              mat = sio.loadmat(mat_file)
              label_map = mat['GTinst']['Segmentation'][0][0]
              building_list = img_util.create_buildinglist_from_label_map(image_id, label_map)
              geojson_file = os.path.join(setting.PIXEL_GEO_JSON_DIR_4X, '{}_Pixel.geojson'.format(image_id))
          gT.exporttogeojson(geojson_file, building_list)
          return image_id, 'Done'
      except Exception as e:
          logging.warning('Convert Exception[{}] image_id[{}]'.format(e, image_id))
          return image_id, e
function_tokens: def convert_worker ( mat_file ) : try : if setting . CONVERT_RES == 1 : image_id = '_' . join ( mat_file . split ( '.' ) [ 0 ] . split ( '_' ) [ 1 : ] ) print ( 'image_id:{}' . format ( image_id ) ) mat_file = os . path . join ( setting . PREDICT_LABEL_MAP_DIR , mat_file ) mat = sio . loadmat ( mat_file ) #print(mat.keys()) #exit(0) label_map = mat [ 'inst_img' ] building_list = img_util . create_buildinglist_from_label_map ( image_id , label_map ) geojson_file = os . path . join ( setting . PREDICT_PIXEL_GEO_JSON_DIR , '{}_predict.geojson' . format ( image_id ) ) else : #print('{}'.format(mat_file)) image_id = '_' . join ( mat_file . split ( '.' ) [ 0 ] . split ( '_' ) [ : ] ) #print('{}'.format(image_id)) mat_file = os . path . join ( setting . LABEL_MAP_DIR_4X , mat_file ) mat = sio . loadmat ( mat_file ) label_map = mat [ 'GTinst' ] [ 'Segmentation' ] [ 0 ] [ 0 ] building_list = img_util . create_buildinglist_from_label_map ( image_id , label_map ) geojson_file = os . path . join ( setting . PIXEL_GEO_JSON_DIR_4X , '{}_Pixel.geojson' . format ( image_id ) ) gT . exporttogeojson ( geojson_file , building_list ) return image_id , 'Done' except Exception as e : logging . warning ( 'Convert Exception[{}] image_id[{}]' . format ( e , image_id ) ) return image_id , e