Skip to content

Commit

Permalink
Merge pull request #57 from BrainLesion/119_and_coverage
Browse files Browse the repository at this point in the history
updated examples with 119 update from panoptica
  • Loading branch information
Hendrik-code authored Aug 20, 2024
2 parents 98e3fcf + e052e17 commit e9d6e66
Show file tree
Hide file tree
Showing 5 changed files with 821 additions and 427 deletions.
117 changes: 23 additions & 94 deletions panoptica/example_config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: panoptica in /opt/anaconda3/envs/seg11panoptdev/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (0.6.6.post13.dev0+a2f5dd3)\n",
"Requirement already satisfied: panoptica in /opt/anaconda3/envs/seg11panoptdev/lib/python3.11/site-packages (from -r requirements.txt (line 1)) (1.0.0.post2.dev0+2f7d01f)\n",
"Requirement already satisfied: auxiliary in /opt/anaconda3/envs/seg11panoptdev/lib/python3.11/site-packages (from -r requirements.txt (line 2)) (0.0.42)\n",
"Requirement already satisfied: rich in /opt/anaconda3/envs/seg11panoptdev/lib/python3.11/site-packages (from -r requirements.txt (line 3)) (13.6.0)\n",
"Requirement already satisfied: numpy in /opt/anaconda3/envs/seg11panoptdev/lib/python3.11/site-packages (from -r requirements.txt (line 4)) (1.25.2)\n",
Expand Down Expand Up @@ -60,7 +60,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -90,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand All @@ -102,7 +102,7 @@
" 106, 107, 108, 202, 203, 204, 205, 206, 207, 208], dtype=uint8))"
]
},
"execution_count": 3,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -124,74 +124,9 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">────────────────────────────────────────── </span>Thank you for using <span style=\"font-weight: bold\">panoptica</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ──────────────────────────────────────────</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[92m────────────────────────────────────────── \u001b[0mThank you for using \u001b[1mpanoptica\u001b[0m\u001b[92m ──────────────────────────────────────────\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> Please support our development by citing \n",
"</pre>\n"
],
"text/plain": [
" Please support our development by citing \n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://github.com/BrainLesion/panoptica#citation</span> -- Thank you! \n",
"</pre>\n"
],
"text/plain": [
" \u001b[4;94mhttps://github.com/BrainLesion/panoptica#citation\u001b[0m -- Thank you! \n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────────────────────────────────────────────────────────────────────────────────</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[92m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
"</pre>\n"
],
"text/plain": [
"\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
Expand All @@ -208,7 +143,7 @@
" decision_threshold=0.5,\n",
")\n",
"\n",
"result, debug_data = evaluator.evaluate(pred_masks, ref_masks)[\"ungrouped\"]"
"result, intermediate_steps_data = evaluator.evaluate(pred_masks, ref_masks)[\"ungrouped\"]"
]
},
{
Expand All @@ -221,7 +156,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand All @@ -239,16 +174,13 @@
"\n",
"+++ GLOBAL +++\n",
"Global Binary Dice (global_bin_dsc): 0.9744370224078394\n",
"Global Binary Centerline Dice (global_bin_cldsc): 0.9637064011802574\n",
"Global Binary Average Symmetric Surface Distance (global_bin_assd): 0.1499152780072207\n",
"Global Binary Relative Volume Difference (global_bin_rvd): -0.0006011763989268869\n",
"\n",
"+++ INSTANCE +++\n",
"Segmentation Quality IoU (sq): 0.8328184295330796 +- 0.15186064004517466\n",
"Panoptic Quality IoU (pq): 0.8328184295330796\n",
"Segmentation Quality Dsc (sq_dsc): 0.900292616009954 +- 0.10253566174957332\n",
"Panoptic Quality Dsc (pq_dsc): 0.900292616009954\n",
"Segmentation Quality Assd (sq_assd): 0.250331887879225 +- 0.07696680402317076\n",
"Segmentation Quality ASSD (sq_assd): 0.250331887879225 +- 0.07696680402317076\n",
"Segmentation Quality Relative Volume Difference (sq_rvd): 0.0028133049062930553 +- 0.034518928495505724\n",
"\n"
]
Expand All @@ -270,14 +202,14 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Saved config into /opt/anaconda3/envs/seg11panoptdev/lib/python3.11/site-packages/panoptica/test_config.yaml\n"
"Saved config into /DATA/NAS/ongoing_projects/hendrik/panoptica/repo/panoptica/test_config.yaml\n"
]
}
],
Expand Down Expand Up @@ -306,14 +238,14 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<panoptica.panoptica_evaluator.Panoptica_Evaluator object at 0x7fbe999a9c90>\n"
"<panoptica.panoptica_evaluator.Panoptica_Evaluator object at 0x7f05ac7b80d0>\n"
]
}
],
Expand All @@ -324,7 +256,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -335,26 +267,23 @@
"-- Got MatchedInstancePair, will evaluate instances\n",
"\n",
"+++ MATCHING +++\n",
"Number of instances in reference (num_ref_instances): 22\n",
"Number of instances in prediction (num_pred_instances): 22\n",
"True Positives (tp): 22\n",
"Number of instances in reference (num_ref_instances): 1\n",
"Number of instances in prediction (num_pred_instances): 1\n",
"True Positives (tp): 1\n",
"False Positives (fp): 0\n",
"False Negatives (fn): 0\n",
"Recognition Quality / F1-Score (rq): 1.0\n",
"\n",
"+++ GLOBAL +++\n",
"Global Binary Dice (global_bin_dsc): 0.9744370224078394\n",
"Global Binary Centerline Dice (global_bin_cldsc): 0.9637064011802574\n",
"Global Binary Average Symmetric Surface Distance (global_bin_assd): 0.1499152780072207\n",
"Global Binary Relative Volume Difference (global_bin_rvd): -0.0006011763989268869\n",
"\n",
"+++ INSTANCE +++\n",
"Segmentation Quality IoU (sq): 0.8328184295330796 +- 0.15186064004517466\n",
"Panoptic Quality IoU (pq): 0.8328184295330796\n",
"Segmentation Quality Dsc (sq_dsc): 0.900292616009954 +- 0.10253566174957332\n",
"Panoptic Quality Dsc (pq_dsc): 0.900292616009954\n",
"Segmentation Quality Assd (sq_assd): 0.250331887879225 +- 0.07696680402317076\n",
"Segmentation Quality Relative Volume Difference (sq_rvd): 0.0028133049062930553 +- 0.034518928495505724\n",
"Segmentation Quality IoU (sq): 0.9501484001456879 +- 0.0\n",
"Panoptic Quality IoU (pq): 0.9501484001456879\n",
"Segmentation Quality Dsc (sq_dsc): 0.9744370224078394 +- 0.0\n",
"Panoptic Quality Dsc (pq_dsc): 0.9744370224078394\n",
"Segmentation Quality ASSD (sq_assd): 0.1499152780072207 +- 0.0\n",
"Segmentation Quality Relative Volume Difference (sq_rvd): -0.0006011763989268869 +- 0.0\n",
"\n"
]
}
Expand Down
Loading

0 comments on commit e9d6e66

Please sign in to comment.