|
62 | 62 | "import numpy as np\n", |
63 | 63 | "from auxiliary.nifti.io import read_nifti\n", |
64 | 64 | "from rich import print as pprint\n", |
65 | | - "from panoptica import MatchedInstancePair, Panoptic_Evaluator" |
| 65 | + "from panoptica import MatchedInstancePair, Panoptic_Evaluator\n", |
| 66 | + "from panoptica.metrics import Metrics" |
66 | 67 | ] |
67 | 68 | }, |
68 | 69 | { |
|
192 | 193 | "text": [ |
193 | 194 | "Panoptic: Start Evaluation\n", |
194 | 195 | "-- Got MatchedInstancePair, will evaluate instances\n", |
195 | | - "-- evaluate took 1.7750227451324463 seconds to execute.\n" |
| 196 | + "-- evaluate took 1.4501242637634277 seconds to execute.\n" |
196 | 197 | ] |
197 | 198 | } |
198 | 199 | ], |
|
201 | 202 | "\n", |
202 | 203 | "evaluator = Panoptic_Evaluator(\n", |
203 | 204 | " expected_input=MatchedInstancePair,\n", |
204 | | - " iou_threshold=0.5,\n", |
| 205 | + " decision_metric=Metrics.IOU,\n", |
| 206 | + " decision_threshold=0.5,\n", |
205 | 207 | ")\n", |
206 | 208 | "\n", |
207 | 209 | "result, debug_data = evaluator.evaluate(sample)" |
|
226 | 228 | "text": [ |
227 | 229 | "Number of instances in prediction: 22\n", |
228 | 230 | "Number of instances in reference: 22\n", |
229 | | - "True Positives (tp): 19\n", |
230 | | - "False Positives (fp): 3\n", |
231 | | - "False Negatives (fn): 3\n", |
232 | | - "Recognition Quality / F1 Score (RQ): 0.8636363636363636\n", |
233 | | - "Segmentation Quality (SQ): 0.8328184295330796 ± 0.15186064004517466\n", |
| 231 | + "True Positives (tp): 22\n", |
| 232 | + "False Positives (fp): 0\n", |
| 233 | + "False Negatives (fn): 0\n", |
| 234 | + "Recognition Quality / F1 Score (RQ): 1.0\n", |
| 235 | + "Segmentation Quality (SQ): 0.719252280051296 ± 0.15186064004517466\n", |
234 | 236 | "Panoptic Quality (PQ): 0.719252280051296\n", |
235 | | - "DSC-based Segmentation Quality (DQ_DSC): 0.900292616009954 ± 0.10253566174957332\n", |
| 237 | + "DSC-based Segmentation Quality (DQ_DSC): 0.7775254410995057 ± 0.10253566174957332\n", |
236 | 238 | "DSC-based Panoptic Quality (PQ_DSC): 0.7775254410995057\n", |
237 | | - "Average symmetric surface distance (ASSD): 0.250331887879225 ± 0.07696680402317076\n", |
| 239 | + "Average symmetric surface distance (ASSD): 0.2161957213502398 ± 0.07696680402317076\n", |
238 | 240 | "ASSD-based Panoptic Quality (PQ_ASSD): 0.2161957213502398\n" |
239 | 241 | ] |
240 | 242 | } |
|
280 | 282 | "<span style=\"font-weight: bold\">{</span>\n", |
281 | 283 | " <span style=\"color: #008000; text-decoration-color: #008000\">'num_pred_instances'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">22</span>,\n", |
282 | 284 | " <span style=\"color: #008000; text-decoration-color: #008000\">'num_ref_instances'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">22</span>,\n", |
283 | | - " <span style=\"color: #008000; text-decoration-color: #008000\">'tp'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">19</span>,\n", |
284 | | - " <span style=\"color: #008000; text-decoration-color: #008000\">'fp'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>,\n", |
285 | | - " <span style=\"color: #008000; text-decoration-color: #008000\">'fn'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>,\n", |
286 | | - " <span style=\"color: #008000; text-decoration-color: #008000\">'rq'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.8636363636363636</span>,\n", |
287 | | - " <span style=\"color: #008000; text-decoration-color: #008000\">'sq'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.8328184295330796</span>,\n", |
| 285 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'tp'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">22</span>,\n", |
| 286 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'fp'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n", |
| 287 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'fn'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n", |
| 288 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'rq'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1.0</span>,\n", |
| 289 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'sq'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.719252280051296</span>,\n", |
288 | 290 | " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_sd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.15186064004517466</span>,\n", |
289 | 291 | " <span style=\"color: #008000; text-decoration-color: #008000\">'pq'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.719252280051296</span>,\n", |
290 | | - " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_dsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.900292616009954</span>,\n", |
| 292 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_dsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.7775254410995057</span>,\n", |
291 | 293 | " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_dsc_sd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.10253566174957332</span>,\n", |
292 | 294 | " <span style=\"color: #008000; text-decoration-color: #008000\">'pq_dsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.7775254410995057</span>,\n", |
293 | | - " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_assd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.250331887879225</span>,\n", |
| 295 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_assd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.2161957213502398</span>,\n", |
294 | 296 | " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_assd_sd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.07696680402317076</span>,\n", |
295 | 297 | " <span style=\"color: #008000; text-decoration-color: #008000\">'pq_assd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.2161957213502398</span>\n", |
296 | 298 | "<span style=\"font-weight: bold\">}</span>\n", |
|
301 | 303 | "\u001b[1m{\u001b[0m\n", |
302 | 304 | " \u001b[32m'num_pred_instances'\u001b[0m: \u001b[1;36m22\u001b[0m,\n", |
303 | 305 | " \u001b[32m'num_ref_instances'\u001b[0m: \u001b[1;36m22\u001b[0m,\n", |
304 | | - " \u001b[32m'tp'\u001b[0m: \u001b[1;36m19\u001b[0m,\n", |
305 | | - " \u001b[32m'fp'\u001b[0m: \u001b[1;36m3\u001b[0m,\n", |
306 | | - " \u001b[32m'fn'\u001b[0m: \u001b[1;36m3\u001b[0m,\n", |
307 | | - " \u001b[32m'rq'\u001b[0m: \u001b[1;36m0.8636363636363636\u001b[0m,\n", |
308 | | - " \u001b[32m'sq'\u001b[0m: \u001b[1;36m0.8328184295330796\u001b[0m,\n", |
| 306 | + " \u001b[32m'tp'\u001b[0m: \u001b[1;36m22\u001b[0m,\n", |
| 307 | + " \u001b[32m'fp'\u001b[0m: \u001b[1;36m0\u001b[0m,\n", |
| 308 | + " \u001b[32m'fn'\u001b[0m: \u001b[1;36m0\u001b[0m,\n", |
| 309 | + " \u001b[32m'rq'\u001b[0m: \u001b[1;36m1.0\u001b[0m,\n", |
| 310 | + " \u001b[32m'sq'\u001b[0m: \u001b[1;36m0.719252280051296\u001b[0m,\n", |
309 | 311 | " \u001b[32m'sq_sd'\u001b[0m: \u001b[1;36m0.15186064004517466\u001b[0m,\n", |
310 | 312 | " \u001b[32m'pq'\u001b[0m: \u001b[1;36m0.719252280051296\u001b[0m,\n", |
311 | | - " \u001b[32m'sq_dsc'\u001b[0m: \u001b[1;36m0.900292616009954\u001b[0m,\n", |
| 313 | + " \u001b[32m'sq_dsc'\u001b[0m: \u001b[1;36m0.7775254410995057\u001b[0m,\n", |
312 | 314 | " \u001b[32m'sq_dsc_sd'\u001b[0m: \u001b[1;36m0.10253566174957332\u001b[0m,\n", |
313 | 315 | " \u001b[32m'pq_dsc'\u001b[0m: \u001b[1;36m0.7775254410995057\u001b[0m,\n", |
314 | | - " \u001b[32m'sq_assd'\u001b[0m: \u001b[1;36m0.250331887879225\u001b[0m,\n", |
| 316 | + " \u001b[32m'sq_assd'\u001b[0m: \u001b[1;36m0.2161957213502398\u001b[0m,\n", |
315 | 317 | " \u001b[32m'sq_assd_sd'\u001b[0m: \u001b[1;36m0.07696680402317076\u001b[0m,\n", |
316 | 318 | " \u001b[32m'pq_assd'\u001b[0m: \u001b[1;36m0.2161957213502398\u001b[0m\n", |
317 | 319 | "\u001b[1m}\u001b[0m\n" |
|
343 | 345 | "name": "python", |
344 | 346 | "nbconvert_exporter": "python", |
345 | 347 | "pygments_lexer": "ipython3", |
346 | | - "version": "3.10.13" |
| 348 | + "version": "3.11.6" |
347 | 349 | } |
348 | 350 | }, |
349 | 351 | "nbformat": 4, |
|
0 commit comments