parameters: ()
docstring: docstring for test_geojson
docstring_summary: docstring for test_geojson
docstring_tokens: docstring for test_geojson
function: def test_geojson():
      """docstring for test_geojson"""
      label_map_file_list = os.listdir(setting.PREDICT_LABEL_MAP_DIR)
      for mat_file in label_map_file_list:
          image_id = '_'.join(mat_file.split('.')[0].split('_')[1:])
          predict_geojson_file = os.path.join(setting.PREDICT_PIXEL_GEO_JSON_DIR, '{}_predict.geojson'.format(image_id))
          image_name = os.path.join(setting.PIC_3BAND_DIR, '3band_{}.tif'.format(image_id))
          img = sk.imread(image_name, True)
          label_map = np.zeros(img.shape, dtype=np.uint8)
          label_map = img_util.create_label_map_from_polygons(gT.importgeojson(predict_geojson_file),
                  label_map)
          label_img = img_util.create_label_img(img, label_map)
          save_file = os.path.join(setting.TMP_DIR, '{}_predict.png'.format(image_id))
          sk.imsave(save_file, label_img)
          truth_geojson_file = os.path.join(setting.PIXEL_GEO_JSON_DIR, '{}_Pixel.geojson'.format(image_id))
          print('{}'.format(truth_geojson_file))
          label_map = np.zeros(img.shape, dtype=np.uint8)
          print('label_map shape{}'.format(label_map.shape))
          label_map = img_util.create_label_map_from_polygons(gT.importgeojson(truth_geojson_file), label_map)
          label_img = img_util.create_label_img(img, label_map)
          save_file = os.path.join(setting.TMP_DIR, '{}_Pixel.png'.format(image_id))
          sk.imsave(save_file, label_img)
function_tokens: def test_geojson ( ) : label_map_file_list = os . listdir ( setting . PREDICT_LABEL_MAP_DIR ) for mat_file in label_map_file_list : image_id = '_' . join ( mat_file . split ( '.' ) [ 0 ] . split ( '_' ) [ 1 : ] ) predict_geojson_file = os . path . join ( setting . PREDICT_PIXEL_GEO_JSON_DIR , '{}_predict.geojson' . format ( image_id ) ) image_name = os . path . join ( setting . PIC_3BAND_DIR , '3band_{}.tif' . format ( image_id ) ) img = sk . imread ( image_name , True ) label_map = np . zeros ( img . shape , dtype = np . uint8 ) label_map = img_util . create_label_map_from_polygons ( gT . importgeojson ( predict_geojson_file ) , label_map ) label_img = img_util . create_label_img ( img , label_map ) save_file = os . path . join ( setting . TMP_DIR , '{}_predict.png' . format ( image_id ) ) sk . imsave ( save_file , label_img ) truth_geojson_file = os . path . join ( setting . PIXEL_GEO_JSON_DIR , '{}_Pixel.geojson' . format ( image_id ) ) print ( '{}' . format ( truth_geojson_file ) ) label_map = np . zeros ( img . shape , dtype = np . uint8 ) print ( 'label_map shape{}' . format ( label_map . shape ) ) label_map = img_util . create_label_map_from_polygons ( gT . importgeojson ( truth_geojson_file ) , label_map ) label_img = img_util . create_label_img ( img , label_map ) save_file = os . path . join ( setting . TMP_DIR , '{}_Pixel.png' . format ( image_id ) ) sk . imsave ( save_file , label_img )