You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tiles_frac: 0.5# fraction (relative to the number of tiles intersecting labels) of empty tiles to add
28
+
frac_trn: 0.75# fraction of empty tiles to add to the trn dataset, then the remaining tiles will be split in 2 and added to tst and val datasets
29
+
keep_oth_tiles: False # keep tiles in oth dataset not intersecting oth labels
22
30
output_folder: output_trne
23
-
tile_size: 256# per side, in pixels
31
+
tile_size: 256# per side, in pixels
32
+
seed: 42
24
33
overwrite: True
25
34
n_jobs: 10
26
35
COCO_metadata:
@@ -57,7 +66,7 @@ make_detections.py:
57
66
tst: COCO_tst.json
58
67
detectron2_config_file: ../../detectron2_config_dqry.yaml # path relative to the working_folder
59
68
model_weights:
60
-
pth_file: ./logs/model_final.pth # trained model minimising the validation loss curve, monitor the training process via tensorboard (tensorboard --logdir </logs>)
69
+
pth_file: ./logs/model_0000999.pth # trained model minimising the validation loss curve, monitor the training process via tensorboard (tensorboard --logdir </logs>)
logger.error("Choose one option between providing an AoI shapefile ('empty_tiles_aoi') in which empty tiles will be selected and a shapefile with selected empty tiles ('empty_tiles_shp')")
110
+
sys.exit(1)
111
+
if'empty_tiles_aoi'incfg['datasets'].keys():
112
+
EPT_SHPFILE=cfg['datasets']['empty_tiles_aoi']
113
+
EPT='aoi'
114
+
elif'empty_tiles_shp'incfg['datasets'].keys():
115
+
EPT_SHPFILE=cfg['datasets']['empty_tiles_shp']
116
+
EPT='shp'
117
+
else:
118
+
EPT_SHPFILE=None
119
+
EPT=None
53
120
ZOOM_LEVEL=cfg['zoom_level']
54
121
55
122
# Create an output directory in case it doesn't exist
@@ -60,70 +127,124 @@ def add_tile_id(row):
60
127
61
128
# Prepare the tiles
62
129
63
-
## Convert datasets shapefiles into geojson format
64
-
logger.info('Convert labels shapefile into GeoJSON format (EPSG:4326)...')
130
+
# Convert datasets shapefiles into geojson format
131
+
logger.info("Convert labels shapefile into GeoJSON format (EPSG:4326)...")
65
132
labels=gpd.read_file(SHPFILE)
66
133
labels_4326=labels.to_crs(epsg=4326)
67
134
labels_4326['CATEGORY'] ='quarry'
68
135
labels_4326['SUPERCATEGORY'] ='land usage'
69
136
70
137
nb_labels=len(labels)
71
-
logger.info(f'There is/are {nb_labels} polygons in {SHPFILE}')
138
+
logger.info(f"There are {nb_labels} polygons in {SHPFILE}")
logger.info("- The surface area occupied by the bbox of the AoI used to find empty tiles is bigger than the label's one. The AoI boundaries will be used for tiling")
191
+
boundaries_df=EPT_aoi_boundaries_df
192
+
else:
193
+
logger.info("- The surface area occupied by the bbox of the AoI used to find empty tiles is smaller than the label's one. Both the AoI and labels area will be used for tiling")
0 commit comments