fimeval 0.1.43__py3-none-any.whl → 0.1.45__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fimeval/ContingencyMap/evaluationFIM.py +1 -5
- fimeval/ContingencyMap/metrics.py +15 -16
- fimeval/ContingencyMap/printcontingency.py +6 -7
- {fimeval-0.1.43.dist-info → fimeval-0.1.45.dist-info}/METADATA +2 -2
- {fimeval-0.1.43.dist-info → fimeval-0.1.45.dist-info}/RECORD +7 -7
- {fimeval-0.1.43.dist-info → fimeval-0.1.45.dist-info}/WHEEL +1 -1
- {fimeval-0.1.43.dist-info → fimeval-0.1.45.dist-info}/LICENSE.txt +0 -0
|
@@ -40,7 +40,6 @@ def evaluateFIM(
|
|
|
40
40
|
Merged = []
|
|
41
41
|
Unique = []
|
|
42
42
|
FAR_values = []
|
|
43
|
-
Dice_values = []
|
|
44
43
|
|
|
45
44
|
# Dynamically call the specified method
|
|
46
45
|
method = globals().get(method)
|
|
@@ -226,7 +225,7 @@ def evaluateFIM(
|
|
|
226
225
|
extract_c = np.where(mask2, out_image2, 0)
|
|
227
226
|
extract_c = np.where(extract_c > 0, 1, 0)
|
|
228
227
|
idx_pwc = np.where(extract_c == 1)
|
|
229
|
-
out_image2[idx_pwc] =
|
|
228
|
+
out_image2[idx_pwc] = 5
|
|
230
229
|
out_image2_resized = resize_image(
|
|
231
230
|
out_image2,
|
|
232
231
|
out_transform2,
|
|
@@ -255,7 +254,6 @@ def evaluateFIM(
|
|
|
255
254
|
FPR,
|
|
256
255
|
merged,
|
|
257
256
|
FAR,
|
|
258
|
-
Dice,
|
|
259
257
|
) = evaluationmetrics(out_image1, out_image2_resized)
|
|
260
258
|
|
|
261
259
|
# Append values to the lists
|
|
@@ -275,7 +273,6 @@ def evaluateFIM(
|
|
|
275
273
|
Merged.append(merged)
|
|
276
274
|
Unique.append(unique_values)
|
|
277
275
|
FAR_values.append(FAR)
|
|
278
|
-
Dice_values.append(Dice)
|
|
279
276
|
|
|
280
277
|
results = {
|
|
281
278
|
"CSI_values": csi_values,
|
|
@@ -294,7 +291,6 @@ def evaluateFIM(
|
|
|
294
291
|
# 'Merged': Merged,
|
|
295
292
|
# 'Unique': Unique
|
|
296
293
|
"FAR_values": FAR_values,
|
|
297
|
-
"Dice_values": Dice_values,
|
|
298
294
|
}
|
|
299
295
|
for candidate_idx, candidate_path in enumerate(candidate_paths):
|
|
300
296
|
candidate_BASENAME = os.path.splitext(os.path.basename(candidate_path))[0]
|
|
@@ -7,21 +7,21 @@ def evaluationmetrics(out_image1, out_image2):
|
|
|
7
7
|
unique_values, counts = np.unique(merged, return_counts=True)
|
|
8
8
|
class_pixel_counts = dict(zip(unique_values, counts))
|
|
9
9
|
class_pixel_counts
|
|
10
|
-
TN = class_pixel_counts
|
|
11
|
-
FP = class_pixel_counts
|
|
12
|
-
FN = class_pixel_counts
|
|
13
|
-
TP = class_pixel_counts
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
TN = class_pixel_counts.get(1,0)
|
|
11
|
+
FP = class_pixel_counts.get(2,0)
|
|
12
|
+
FN = class_pixel_counts.get(3,0)
|
|
13
|
+
TP = class_pixel_counts.get(4,0)
|
|
14
|
+
epsilon = 1e-8
|
|
15
|
+
TPR = TP / (TP + FN+epsilon)
|
|
16
|
+
FNR = FN / (TP + FN+epsilon)
|
|
17
|
+
Acc = (TP + TN) / (TP + TN + FP + FN+epsilon)
|
|
18
|
+
Prec = TP / (TP + FP+epsilon)
|
|
19
|
+
sen = TP / (TP + FN+epsilon)
|
|
20
|
+
F1_score = 2 * (Prec * sen) / (Prec + sen+epsilon)
|
|
21
|
+
CSI = TP / (TP + FN + FP+epsilon)
|
|
22
|
+
POD = TP / (TP + FN+epsilon)
|
|
23
|
+
FPR = FP / (FP + TN+epsilon)
|
|
24
|
+
FAR = FP / (TP + FP+epsilon)
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
unique_values,
|
|
@@ -40,5 +40,4 @@ def evaluationmetrics(out_image1, out_image2):
|
|
|
40
40
|
FPR,
|
|
41
41
|
merged,
|
|
42
42
|
FAR,
|
|
43
|
-
Dice,
|
|
44
43
|
)
|
|
@@ -18,7 +18,7 @@ def getContingencyMap(raster_path, method_path):
|
|
|
18
18
|
combined_flood = np.full_like(band1, fill_value=1, dtype=int)
|
|
19
19
|
|
|
20
20
|
# Map pixel values to colors
|
|
21
|
-
combined_flood[band1 ==
|
|
21
|
+
combined_flood[band1 == 5] = 0
|
|
22
22
|
combined_flood[band1 == 0] = 1
|
|
23
23
|
combined_flood[band1 == 1] = 2
|
|
24
24
|
combined_flood[band1 == 2] = 3
|
|
@@ -60,12 +60,11 @@ def getContingencyMap(raster_path, method_path):
|
|
|
60
60
|
|
|
61
61
|
# Create legend patches
|
|
62
62
|
value_labels = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
5: "True Positive",
|
|
63
|
+
1: "True negative",
|
|
64
|
+
2: "False positive",
|
|
65
|
+
3: "False negative",
|
|
66
|
+
4: "True positive",
|
|
67
|
+
5: "Permanent water bodies"
|
|
69
68
|
}
|
|
70
69
|
legend_patches = [
|
|
71
70
|
Patch(
|
|
@@ -2,14 +2,14 @@ fimeval/BuildingFootprint/__init__.py,sha256=oP9YWLdo6ANzSQFxYLv7Ku_26AY5NkLNhZL
|
|
|
2
2
|
fimeval/BuildingFootprint/evaluationwithBF.py,sha256=59XxVlMLD7Lj7iXirWZpz1p6eDwHOai26Kap7nyDEEQ,14520
|
|
3
3
|
fimeval/ContingencyMap/PWBs3.py,sha256=YAg03jzdplYIstG-pZM1MECse7gYjWrJNKAopjgt3uk,1294
|
|
4
4
|
fimeval/ContingencyMap/__init__.py,sha256=ckps2dyg6aci3TA-3P7oTMcCAcSTz9AA6sndHtZEwdE,259
|
|
5
|
-
fimeval/ContingencyMap/evaluationFIM.py,sha256=
|
|
5
|
+
fimeval/ContingencyMap/evaluationFIM.py,sha256=8oRWG1pcjX3t_i7jtlfYgk4cLQ7BixlkU-0P5cvBQUM,15553
|
|
6
6
|
fimeval/ContingencyMap/methods.py,sha256=kbutfo9FUH-yjvnOXxwLpdErUuebMJ8NjCroNWIYCjo,3299
|
|
7
|
-
fimeval/ContingencyMap/metrics.py,sha256=
|
|
7
|
+
fimeval/ContingencyMap/metrics.py,sha256=eEv1zAfmIjyg9OWM1b6-i25q_3jEBmeLZ7JeuvxS1QI,1070
|
|
8
8
|
fimeval/ContingencyMap/plotevaluationmetrics.py,sha256=3bKfPKZnMR39dA3teDVpQBeTFKnF9v_2Vku0JNVGggs,3921
|
|
9
|
-
fimeval/ContingencyMap/printcontingency.py,sha256=
|
|
9
|
+
fimeval/ContingencyMap/printcontingency.py,sha256=u46MF2DEo6Kt1w7Xks6BoW1fOO4byy8B0g7RVWYWhkY,5399
|
|
10
10
|
fimeval/__init__.py,sha256=kN114EvzG_BFjd65fKWXg29TqaWvR173EdCN3yj30oc,433
|
|
11
11
|
fimeval/utilis.py,sha256=7S4ef_6rVKKZ1rrCe2ewxuNHapDJmtBcv_1jflteVUw,7386
|
|
12
|
-
fimeval-0.1.
|
|
13
|
-
fimeval-0.1.
|
|
14
|
-
fimeval-0.1.
|
|
15
|
-
fimeval-0.1.
|
|
12
|
+
fimeval-0.1.45.dist-info/LICENSE.txt,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
13
|
+
fimeval-0.1.45.dist-info/METADATA,sha256=jW53sD-fK0v0godbonnrbe50sdlr0BOcJc2oLNH0TNI,14848
|
|
14
|
+
fimeval-0.1.45.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
15
|
+
fimeval-0.1.45.dist-info/RECORD,,
|
|
File without changes
|