Skip to content

Commit 40b196c

Browse files
committed
Merge with master
2 parents 78c6d5d + eda9536 commit 40b196c

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

examples/mineral-extract-sites-detection/config_trne.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
# 1-Produce tile geometries based on the AoI extent and zoom level
1+
# Produce tile geometries based on the AoI extent and zoom level
22
prepare_data.py:
33
srs: EPSG:2056
44
datasets:
55
shapefile: ./data/labels/tlm-hr-trn-topo.shp # GT labels
66
# FP_shapefile: ./data/FP/FP_list.gpkg # FP labels
77
# empty_tiles_aoi: ./data/AoI/AoI_2020.shp # AOI in which additional empty tiles can be selected. Only one 'empty_tiles' option can be selected
8+
# empty_tiles_year: multi-year # If "empty_tiles_aoi" selected then provide a year. Choice: (1) numeric (i.e. 2020), (2) multi-year (random year selection within years [1945-2023])
89
# empty_tiles_shp: .data/EPT/<SHPFILE> # Provided shpfile of selected empty tiles. Only one 'empty_tiles' option can be selected
910
output_folder: ./output/output_trne
1011
zoom_level: 16
1112

12-
# 2-Fetch of tiles and split into 3 datasets: train, test, validation
13+
# Fetch of tiles and split into 3 datasets: train, test, validation
1314
generate_tilesets.py:
1415
debug_mode:
15-
enable: True # sample of tiles
16+
enable: False # sample of tiles
1617
nb_tiles_max: 1000
1718
working_directory: output
1819
datasets:
1920
aoi_tiles: output_trne/tiles.geojson
2021
ground_truth_labels: output_trne/labels.geojson
21-
# FP_labels: output_trne/FP.geojson
22+
# FP_labels: output_trne/FP.geojson
2223
image_source:
2324
# #############
2425
# type: FOLDER
@@ -32,7 +33,7 @@ generate_tilesets.py:
3233
# srs: "EPSG:2056"
3334
# ############
3435
type: XYZ # supported values: 1. MIL = Map Image Layer 2. WMS 3. XYZ 4. FOLDER
35-
year: multi-year # supported values: 1. multi-year (tiles of different year), 2. <year> (i.e. 2020)
36+
year: 2020 # supported values: 1. multi-year (tiles of different year), 2. <year> (i.e. 2020)
3637
location: https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.swissimage-product/default/{year}/3857/{z}/{x}/{y}.jpeg
3738
# ############
3839
empty_tiles: # add empty tiles to datasets
@@ -54,7 +55,7 @@ generate_tilesets.py:
5455
name: Unknown
5556
url:
5657

57-
# 3-Train the model with the detectron2 algorithm
58+
# Train the model with the detectron2 algorithm
5859
train_model.py:
5960
working_directory: ./output/output_trne
6061
log_subfolder: logs
@@ -67,7 +68,7 @@ train_model.py:
6768
model_weights:
6869
model_zoo_checkpoint_url: COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_1x.yaml
6970

70-
# 4-Object detection with the optimised trained model
71+
# Object detection with the optimised trained model
7172
make_detections.py:
7273
working_directory: ./output/output_trne
7374
log_subfolder: logs
@@ -86,7 +87,7 @@ make_detections.py:
8687
score_lower_threshold: 0.05
8788
remove_det_overlap: True
8889

89-
# 5-Evaluate the quality of the detections for the different datasets by calculating metrics
90+
# Evaluate the quality of the detections for the different datasets by calculating metrics
9091
assess_detections.py:
9192
working_directory: ./output/output_trne
9293
datasets:

scripts/generate_tilesets.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,11 @@ def main(cfg_file_path):
497497

498498
logger.info("(using the MIL connector)")
499499

500+
assert_year(IM_SOURCE_TYPE, YEAR, aoi_tiles_gdf)
501+
if YEAR:
502+
YEAR = None
503+
504+
500505
assert_year(IM_SOURCE_TYPE, YEAR, aoi_tiles_gdf)
501506
if YEAR:
502507
YEAR = None
@@ -518,6 +523,10 @@ def main(cfg_file_path):
518523

519524
logger.info("(using the WMS connector)")
520525

526+
assert_year(IM_SOURCE_TYPE, YEAR, aoi_tiles_gdf)
527+
if YEAR:
528+
YEAR = None
529+
521530
assert_year(IM_SOURCE_TYPE, YEAR, aoi_tiles_gdf)
522531
if YEAR:
523532
YEAR = None

0 commit comments

Comments
 (0)