-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathevaluate.py
More file actions
executable file
·36 lines (29 loc) · 1.06 KB
/
evaluate.py
File metadata and controls
executable file
·36 lines (29 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
__author__ = "Bo Pang"
__copyright__ = "Copyright 2022, IRP Project"
__credits__ = ["Bo Pang"]
__license__ = "Apache 2.0"
__version__ = "1.0"
__email__ = "bo.pang21@imperial.ac.uk"
import os
import tensorflow as tf
import FIDN
# Turn on mixed precision training
# train the model with float16 to speed up and reduce memory usage
os.environ['TF_ENABLE_AUTO_MIXED_PRECISION'] = '1'
print('Start Loading Dataset...')
fpath = './all_304_fire_combine_all_feature_512_wind_precipitation_new.npy'
# Load Dataset
dataset = FIDN.dataset.load_dataset(fpath)
train_dataset, val_dataset, test_dataset = FIDN.dataset.split_dataset(dataset)
print('Dataset Loaded Successful!')
if __name__ == '__main__':
config = dict(
version='1.0',
model_path='./models/fidn_1.0_fidn_epoch100_batchsize16.h5',
name='fidn',
)
# Load Model in config
fidn_model = FIDN.evaluate.load_model(config['model_path'])
# Evaluate the model and
# save the result pic and metrics csv in ./result/
FIDN.evaluate.evaluate_and_save_pic(fidn_model, config, test_dataset)