fimeval 0.1.44__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.
@@ -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)
@@ -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[1]
11
- FP = class_pixel_counts[2]
12
- FN = class_pixel_counts[3]
13
- TP = class_pixel_counts[4]
14
- TPR = TP / (TP + FN)
15
- FNR = FN / (TP + FN)
16
- Acc = (TP + TN) / (TP + TN + FP + FN)
17
- Prec = TP / (TP + FP)
18
- sen = TP / (TP + FN)
19
- F1_score = 2 * (Prec * sen) / (Prec + sen)
20
- CSI = TP / (TP + FN + FP)
21
- POD = TP / (TP + FN)
22
- FPR = FP / (FP + TN)
23
- FAR = FP / (TP + FP)
24
- Dice = 2 * TP / (2 * TP + FP + FN)
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
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fimeval
3
- Version: 0.1.44
3
+ Version: 0.1.45
4
4
  Summary: A Framework for Automatic Evaluation of Flood Inundation Mapping Predictions Evaluation
5
5
  License: GPLv3
6
6
  Author: Surface Dynamics Modeling Lab
@@ -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=cTfVzcV4sVu3n6wZF4NjhSPHzqhrrEbV02cfqkC39Kk,15669
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=xVOgcgjDX1hGDPQgLaUCiBtuwH-smXELo5vOKhrujZc,1000
7
+ fimeval/ContingencyMap/metrics.py,sha256=eEv1zAfmIjyg9OWM1b6-i25q_3jEBmeLZ7JeuvxS1QI,1070
8
8
  fimeval/ContingencyMap/plotevaluationmetrics.py,sha256=3bKfPKZnMR39dA3teDVpQBeTFKnF9v_2Vku0JNVGggs,3921
9
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.44.dist-info/LICENSE.txt,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
13
- fimeval-0.1.44.dist-info/METADATA,sha256=1RsMsX0StXpzxiZpLY84k3jTjY0LnoQQrJIFyTUNDPE,14848
14
- fimeval-0.1.44.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
15
- fimeval-0.1.44.dist-info/RECORD,,
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,,