Skip to content

Commit 42658b6

Browse files
committed
various updates
1 parent 830825f commit 42658b6

File tree

4 files changed

+41
-21
lines changed

4 files changed

+41
-21
lines changed

etc/forestry/forestry-s3-v2.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
configuration:
2-
model_path: "s3://sagegroup-data/sage/models/{name}"
2+
# model_path: "s3://sagegroup-data/sage/models/{name}"
33
name: "unet-forestry-dev"
44
workspace: "/home/marian/models/{name}"
55

@@ -15,6 +15,7 @@ data_source: !!python/object/apply:hugin.io.FSSpecFilesystemLoader
1515
type_format: '{type}'
1616
validation_percent: 0.25
1717
randomise: True
18+
persist_file: ""
1819

1920
trainer: !!python/object/apply:hugin.engine.scene.RasterSceneTrainer
2021
kwds:
@@ -54,18 +55,11 @@ trainer: !!python/object/apply:hugin.engine.scene.RasterSceneTrainer
5455
model_builder_options:
5556
output_channels: 2
5657
model_path: "/data/bid/storage0/sage-storage/homes/eosmith/marian/models/{name}"
57-
batch_size: 16
58+
batch_size: 14
5859
epochs: 100
5960
metrics:
6061
- categorical_accuracy
6162
- !!python/name:hugin.tools.utils.dice_coef
62-
- !!python/object/apply:tensorflow.keras.metrics.MeanIoU
63-
kwds:
64-
num_classes: 2
65-
- !!python/object/apply:tensorflow.keras.metrics.IoU
66-
kwds:
67-
target_class_ids: [0, 1]
68-
num_classes: 2
6963
- !!python/object/apply:tensorflow.keras.metrics.BinaryIoU
7064
kwds:
7165
target_class_ids: [1]

requirements.txt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
numpy>=1.16.0,<1.19.0
2-
geojson==2.4.1
1+
numpy
2+
geojson
33
rasterio
44
scikit-image
55
scipy
66
geopandas
77
Shapely
88
Fiona
9-
s3fs
109
dask[array]
11-
gcsfs
12-
zarr>=2.6.0 # Needed due to bug in S3FS interaction, see: https://github.com/zarr-developers/zarr-python/issues/649
13-
h5py==2.10.0
14-
backoff==1.8.0
10+
zarr
11+
h5py
12+
backoff
1513
matplotlib
1614
scikit-learn
17-
imgaug==0.2.8
18-
tensorflow>=1.15,<=2.3.1
19-
backports.tempfile==1.0
15+
imgaug
16+
tensorflow
2017
tqdm
2118
traitlets

src/hugin/io/dataset_loaders.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ def __init__(self,
161161
else:
162162
self.scan_datasets()
163163

164+
@property
165+
def persist_file(self):
166+
if not hasattr(self, "_persist_file"):
167+
return None
168+
else:
169+
return self._persist_file
170+
@persist_file.setter
171+
def persist_file(self, value):
172+
self._persist_file = value
164173

165174
def scan_datasets(self):
166175
self._datasets.clear()

src/hugin/tools/train.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
3+
4+
__license__ = \
5+
"""Copyright 2023 West University of Timisoara
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
"""
19+
120
import logging
221
from urllib.parse import urlparse, parse_qs
322

@@ -45,11 +64,12 @@ def train_handler(args):
4564

4665
if workspace_directory is not None:
4766
workspace_directory = workspace_directory.format(**experiment_configuration)
48-
67+
else:
68+
raise ValueError("No workspace directory specified")
4969
if not os.path.exists(workspace_directory):
5070
os.makedirs(workspace_directory)
5171

52-
title = f"hugin train (name: {experiment_name})"
72+
title = f"hugin train ({experiment_name})"
5373
setproctitle(title)
5474
log.info(f"workspace directory: {workspace_directory}")
5575
if workspace_directory and trainer.base_directory is None:

0 commit comments

Comments
 (0)