|
61 | 61 | "import numpy as np\n", |
62 | 62 | "from auxiliary.nifti.io import read_nifti\n", |
63 | 63 | "from rich import print as pprint\n", |
64 | | - "from panoptica import MatchedInstancePair, Panoptic_Evaluator\n", |
| 64 | + "from panoptica import MatchedInstancePair, Panoptica_Evaluator\n", |
65 | 65 | "from panoptica.metrics import Metric" |
66 | 66 | ] |
67 | 67 | }, |
|
191 | 191 | "output_type": "stream", |
192 | 192 | "text": [ |
193 | 193 | "Panoptic: Start Evaluation\n", |
194 | | - "-- Got MatchedInstancePair, will evaluate instances\n", |
195 | | - "-- evaluate took 2.0301928520202637 seconds to execute.\n" |
| 194 | + "-- Got MatchedInstancePair, will evaluate instances\n" |
196 | 195 | ] |
197 | 196 | } |
198 | 197 | ], |
199 | 198 | "source": [ |
200 | 199 | "sample = MatchedInstancePair(prediction_arr=pred_masks, reference_arr=ref_masks)\n", |
201 | 200 | "\n", |
202 | | - "evaluator = Panoptic_Evaluator(\n", |
| 201 | + "evaluator = Panoptica_Evaluator(\n", |
203 | 202 | " expected_input=MatchedInstancePair,\n", |
204 | 203 | " decision_metric=Metric.IOU,\n", |
205 | 204 | " decision_threshold=0.5,\n", |
206 | 205 | ")\n", |
207 | 206 | "\n", |
208 | | - "result, debug_data = evaluator.evaluate(sample)" |
| 207 | + "result, debug_data = evaluator.evaluate(sample)[\"ungrouped\"]" |
209 | 208 | ] |
210 | 209 | }, |
211 | 210 | { |
|
237 | 236 | "+++ GLOBAL +++\n", |
238 | 237 | "Global Binary Dice (global_bin_dsc): 0.9744370224078394\n", |
239 | 238 | "Global Binary Centerline Dice (global_bin_cldsc): 0.9637064011802574\n", |
| 239 | + "Global Binary Average Symmetric Surface Distance (global_bin_assd): 0.1499152780072207\n", |
| 240 | + "Global Binary Relative Volume Difference (global_bin_rvd): -0.0006011763989268869\n", |
240 | 241 | "\n", |
241 | 242 | "+++ INSTANCE +++\n", |
242 | 243 | "Segmentation Quality IoU (sq): 0.8328184295330796 +- 0.15186064004517466\n", |
243 | 244 | "Panoptic Quality IoU (pq): 0.8328184295330796\n", |
244 | 245 | "Segmentation Quality Dsc (sq_dsc): 0.900292616009954 +- 0.10253566174957332\n", |
245 | 246 | "Panoptic Quality Dsc (pq_dsc): 0.900292616009954\n", |
246 | 247 | "Segmentation Quality Assd (sq_assd): 0.250331887879225 +- 0.07696680402317076\n", |
| 248 | + "Segmentation Quality Relative Volume Difference (sq_rvd): 0.0028133049062930553 +- 0.034518928495505724\n", |
247 | 249 | "\n" |
248 | 250 | ] |
249 | 251 | } |
|
292 | 294 | " <span style=\"color: #008000; text-decoration-color: #008000\">'tp'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">22</span>,\n", |
293 | 295 | " <span style=\"color: #008000; text-decoration-color: #008000\">'fp'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n", |
294 | 296 | " <span style=\"color: #008000; text-decoration-color: #008000\">'fn'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n", |
| 297 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'prec'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1.0</span>,\n", |
| 298 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'rec'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1.0</span>,\n", |
295 | 299 | " <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", |
296 | 300 | " <span style=\"color: #008000; text-decoration-color: #008000\">'global_bin_dsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.9744370224078394</span>,\n", |
297 | 301 | " <span style=\"color: #008000; text-decoration-color: #008000\">'global_bin_cldsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.9637064011802574</span>,\n", |
| 302 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'global_bin_assd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.1499152780072207</span>,\n", |
| 303 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'global_bin_rvd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">-0.0006011763989268869</span>,\n", |
298 | 304 | " <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", |
299 | 305 | " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.15186064004517466</span>,\n", |
300 | 306 | " <span style=\"color: #008000; text-decoration-color: #008000\">'pq'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.8328184295330796</span>,\n", |
301 | 307 | " <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", |
302 | 308 | " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_dsc_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.10253566174957332</span>,\n", |
303 | 309 | " <span style=\"color: #008000; text-decoration-color: #008000\">'pq_dsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.900292616009954</span>,\n", |
304 | 310 | " <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", |
305 | | - " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_assd_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.07696680402317076</span>\n", |
| 311 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_assd_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.07696680402317076</span>,\n", |
| 312 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_rvd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.0028133049062930553</span>,\n", |
| 313 | + " <span style=\"color: #008000; text-decoration-color: #008000\">'sq_rvd_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.034518928495505724</span>\n", |
306 | 314 | "<span style=\"font-weight: bold\">}</span>\n", |
307 | 315 | "</pre>\n" |
308 | 316 | ], |
|
314 | 322 | " \u001b[32m'tp'\u001b[0m: \u001b[1;36m22\u001b[0m,\n", |
315 | 323 | " \u001b[32m'fp'\u001b[0m: \u001b[1;36m0\u001b[0m,\n", |
316 | 324 | " \u001b[32m'fn'\u001b[0m: \u001b[1;36m0\u001b[0m,\n", |
| 325 | + " \u001b[32m'prec'\u001b[0m: \u001b[1;36m1.0\u001b[0m,\n", |
| 326 | + " \u001b[32m'rec'\u001b[0m: \u001b[1;36m1.0\u001b[0m,\n", |
317 | 327 | " \u001b[32m'rq'\u001b[0m: \u001b[1;36m1.0\u001b[0m,\n", |
318 | 328 | " \u001b[32m'global_bin_dsc'\u001b[0m: \u001b[1;36m0.9744370224078394\u001b[0m,\n", |
319 | 329 | " \u001b[32m'global_bin_cldsc'\u001b[0m: \u001b[1;36m0.9637064011802574\u001b[0m,\n", |
| 330 | + " \u001b[32m'global_bin_assd'\u001b[0m: \u001b[1;36m0.1499152780072207\u001b[0m,\n", |
| 331 | + " \u001b[32m'global_bin_rvd'\u001b[0m: \u001b[1;36m-0.0006011763989268869\u001b[0m,\n", |
320 | 332 | " \u001b[32m'sq'\u001b[0m: \u001b[1;36m0.8328184295330796\u001b[0m,\n", |
321 | 333 | " \u001b[32m'sq_std'\u001b[0m: \u001b[1;36m0.15186064004517466\u001b[0m,\n", |
322 | 334 | " \u001b[32m'pq'\u001b[0m: \u001b[1;36m0.8328184295330796\u001b[0m,\n", |
323 | 335 | " \u001b[32m'sq_dsc'\u001b[0m: \u001b[1;36m0.900292616009954\u001b[0m,\n", |
324 | 336 | " \u001b[32m'sq_dsc_std'\u001b[0m: \u001b[1;36m0.10253566174957332\u001b[0m,\n", |
325 | 337 | " \u001b[32m'pq_dsc'\u001b[0m: \u001b[1;36m0.900292616009954\u001b[0m,\n", |
326 | 338 | " \u001b[32m'sq_assd'\u001b[0m: \u001b[1;36m0.250331887879225\u001b[0m,\n", |
327 | | - " \u001b[32m'sq_assd_std'\u001b[0m: \u001b[1;36m0.07696680402317076\u001b[0m\n", |
| 339 | + " \u001b[32m'sq_assd_std'\u001b[0m: \u001b[1;36m0.07696680402317076\u001b[0m,\n", |
| 340 | + " \u001b[32m'sq_rvd'\u001b[0m: \u001b[1;36m0.0028133049062930553\u001b[0m,\n", |
| 341 | + " \u001b[32m'sq_rvd_std'\u001b[0m: \u001b[1;36m0.034518928495505724\u001b[0m\n", |
328 | 342 | "\u001b[1m}\u001b[0m\n" |
329 | 343 | ] |
330 | 344 | }, |
|
0 commit comments