Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 2.68 KB

File metadata and controls

41 lines (26 loc) · 2.68 KB

Description

When you crop a high-resolution map image into smaller tiles, you can process each tile independently in parallel, which saves memory and allows faster processing. However, in order to get a complete result of the image, you may need to merge the results from each individual tile to get a map-level prediction.

Commands

The inputs for this module are patch-level spotting results stored in json files, and outputs are map-level results in geojson format. The map-level results generated by the module can be visualized using various tools, such as QGIS (Quantum GIS). You can simply drag the historical map (.jpg) and the output json into QGIS and overlay the json onto map background for visualization.

Note:

  • GeoJSON is a file format used for encoding geographic data in a way that is easy to read and interpret. It allows for the representation of different types of geometries, such as points, lines, and polygons, as well as associated properties or attributes.

  • QGIS is a popular open-source geographic information system that allows users to view, edit, and analyze geographic data. With the GeoJSON output from the module, a user can easily import and display the predicted objects or features on a map within QGIS, allowing for further analysis and visualization.

1) Use run.py

python3 run.py --sample_map_csv_path='/home/maplord/maplist_csv/luna_omo_metadata_56628_20220724.csv'  --expt_name='57k_maps' --module_img_geojson

where

  • --sample_map_csv_path stores the metadata of the input map, a sample file can be found here.
  • --module_img_geojson: turns on the stitching module for this run
  • --expt_name: experiment name for running the pipeline

When using this approach, the input and output folder will be parsed automatically depending on the expt_name

2) Use crop_img.py

If you do not have a metadata csv file, or wish to specify the input and output specifically, you can use stitch_output.py in m3_image_geojson folder.

Sample command:

python3 stitch_output.py --input_dir='folder_contains_patch_level_jsons' --output_geojson='map_level_prediction.geojson' --shift_size=1000 
  • --input_dir: input directory to the patch-level spotting results in json
  • --output_geojson: output path to save the map-level geojson
  • --shift_size: image patch size and shift size, should be the same as the one used in cropping module

The above command saves the geometry y-coordinates as negative values. If you want to save them as positive values, add --eval_only parameter to the above command. But the geojson produced with --eval_only does not align with the map image in QGIS.