Skip to content

Commit

Permalink
Check config template is working
Browse files Browse the repository at this point in the history
  • Loading branch information
cleherny committed Jan 23, 2024
1 parent 471af08 commit 2e21301
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
26 changes: 11 additions & 15 deletions config/config_det.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,19 @@
prepare_data.py:
srs: "EPSG:2056" # Projection of the input file
datasets:
shapefile: ./input/input_det/AoI/[AoI_YEAR_Shapefile]
output_folder: ./output/output_det/[YEAR]
shapefile: ./input/input_det/AoI/swissimage_footprint_SWISSIMAGE_YEAR.shp
output_folder: ./output/output_det/SWISSIMAGE_YEAR
zoom_level: 16 # z, keep between 15 and 18

# 2-Request tiles according to the provided AOI and tiles parameters
generate_tilesets.py:
debug_mode: False
datasets:
aoi_tiles_geojson: ./output/output_det/[YEAR]/tiles.geojson
aoi_tiles_geojson: ./output/output_det/SWISSIMAGE_YEAR/tiles.geojson
orthophotos_web_service:
# type: WMS # supported values: 1. MIL = Map Image Layer 2. WMS
# url: https://wms.geo.admin.ch/service
# layers: ch.swisstopo.swissimage
# srs: "EPSG:2056"
type: XYZ # supported values: 1. MIL = Map Image Layer 2. WMS 3. XYZ
url: https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swissimage-product/default/[YEAR]/3857/{z}/{x}/{y}.jpeg
output_folder: ./output/output_det/[YEAR]
url: https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swissimage-product/default/SWISSIMAGE_YEAR/3857/{z}/{x}/{y}.jpeg
output_folder: ./output/output_det/SWISSIMAGE_YEAR
tile_size: 256 # per side, in pixels
overwrite: True
n_jobs: 10
Expand All @@ -42,7 +38,7 @@ generate_tilesets.py:

# 3-Perform the object detection based on the optimized trained model
make_detections.py:
working_folder: ./output/output_det/[YEAR]
working_folder: ./output/output_det/SWISSIMAGE_YEAR
log_subfolder: logs
sample_tagged_img_subfolder: sample_tagged_images
COCO_files: # relative paths, w/ respect to the working_folder
Expand All @@ -52,20 +48,20 @@ make_detections.py:
pth_file: '../../../input/input_det/logs/model_0002999.pth' # trained model minimizing the validation loss curve,
# monitoring of the training process via tensorboard (tensorboard --logdir </logs>)
# for the provided parameters model_0002999.pth is chosen
image_metadata_json: './output/output_det/[YEAR]/img_metadata.json'
image_metadata_json: './output/output_det/SWISSIMAGE_YEAR/img_metadata.json'
rdp_simplification: # rdp = Ramer-Douglas-Peucker
enabled: True
epsilon: 2.0 # cf. https://rdp.readthedocs.io/en/latest/
score_lower_threshold: 0.3

# 4-Filtering and merging detection polygons to improve results
filter_detections.py:
year: [YEAR]
input: ./output/output_det/[YEAR]/oth_detections_at_0dot3_threshold.gpkg
shapefile: ./input/input_det/AoI/swissimage_footprint_[YEAR].shp
year: SWISSIMAGE_YEAR
detections: ./output/output_det/SWISSIMAGE_YEAR/oth_detections_at_0dot3_threshold.gpkg
shapefile: ./input/input_det/AoI/swissimage_footprint_SWISSIMAGE_YEAR.shp
dem: ./input/input_det/DEM/switzerland_dem_EPSG2056.tif
elevation: 1200.0 # m, altitude threshold
score: 0.95 # detection score (from 0 to 1) provided by detectron2
distance: 10 # m, distance use as a buffer to merge close polygons (likely to belong to the same object) together
area: 5000.0 # m2, area threshold under which polygons are discarded
output: ./output/output_det/[YEAR]/oth_detections_at_0dot3_threshold_year-{year}_score-{score}_area-{area}_elevation-{elevation}_distance-{distance}.geojson
output: ./output/output_det/SWISSIMAGE_YEAR/oth_detections_at_0dot3_threshold_year-{year}_score-{score}_area-{area}_elevation-{elevation}_distance-{distance}.geojson
2 changes: 1 addition & 1 deletion config/config_det.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###################################
####### Inference detection #######
##### Detection by inference #####
# Automatic detection of Quarries and Mineral Extraction Sites (MES) in images

# 1-Produce tiles geometry according to the AoI extent and zoom level
Expand Down

0 comments on commit 2e21301

Please sign in to comment.