-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathmetrics_class.py
71 lines (55 loc) · 2.84 KB
/
metrics_class.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
"""
The following code was produced for the Journal paper
"Automatic crack classification and segmentation on masonry surfaces using convolutional neural networks and transfer learning"
by D. Dais, İ. E. Bal, E. Smyrou, and V. Sarhosis published in "Automation in Construction"
in order to apply Deep Learning and Computer Vision with Python for crack detection on masonry surfaces.
In case you use or find interesting our work please cite the following Journal publication:
D. Dais, İ.E. Bal, E. Smyrou, V. Sarhosis, Automatic crack classification and segmentation on masonry surfaces
using convolutional neural networks and transfer learning, Automation in Construction. 125 (2021), pp. 103606.
https://doi.org/10.1016/j.autcon.2021.103606.
@article{Dais2021,
author = {Dais, Dimitris and Bal, İhsan Engin and Smyrou, Eleni and Sarhosis, Vasilis},
doi = {10.1016/j.autcon.2021.103606},
journal = {Automation in Construction},
pages = {103606},
title = {{Automatic crack classification and segmentation on masonry surfaces using convolutional neural networks and transfer learning}},
url = {https://linkinghub.elsevier.com/retrieve/pii/S0926580521000571},
volume = {125},
year = {2021}
}
The paper can be downloaded from the following links:
https://doi.org/10.1016/j.autcon.2021.103606
https://www.researchgate.net/publication/349645935_Automatic_crack_classification_and_segmentation_on_masonry_surfaces_using_convolutional_neural_networks_and_transfer_learning/stats
The code used for the publication can be found in the GitHb Repository:
https://github.com/dimitrisdais/crack_detection_CNN_masonry
Author and Moderator of the Repository: Dimitris Dais
For further information please follow me in the below links
LinkedIn: https://www.linkedin.com/in/dimitris-dais/
Email: d.dais@pl.hanze.nl
ResearchGate: https://www.researchgate.net/profile/Dimitris_Dais2
Research Group Page: https://www.linkedin.com/company/earthquake-resistant-structures-promising-groningen
YouTube Channel: https://www.youtube.com/channel/UCuSdAarhISVQzV2GhxaErsg
Your feedback is welcome. Feel free to reach out to explore any options for collaboration.
"""
import sys
import keras
class Metrics:
def __init__(self, args):
self.args = args
def define_Metrics(self):
sys.path.append(self.args["main"])
from subroutines.loss_metric import Recall
from subroutines.loss_metric import Precision
from subroutines.loss_metric import Precision_dil
from subroutines.loss_metric import F1_score
from subroutines.loss_metric import F1_score_dil
# Prepare metrics
metrics = [
keras.metrics.BinaryAccuracy(name='accuracy'),
Recall,
Precision,
Precision_dil,
F1_score,
F1_score_dil
]
return metrics