{
  "id": 215773,
  "title": "Segmentation Mask Dataset",
  "url": "/competitions/hpa-single-cell-image-classification/discussion/215773",
  "author_name": "tito",
  "post_date": "2021-01-31T05:56:48.456000",
  "votes": 76,
  "comment_count": 21,
  "views": 0,
  "content": "<p>I made a Segmentation Mask Dataset.<br>\n<a href=\"https://www.kaggle.com/its7171/hpa-mask\" target=\"_blank\">https://www.kaggle.com/its7171/hpa-mask</a></p>\n<p>This dataset includes Segmentation information made by <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation\" target=\"_blank\">CellSegmentator</a>.</p>\n<p>This mask files are made as follows:</p>\n<pre>nucl_mask, cell_mask = label_cell(nuc_segmentations[1], cell_segmentations[1])\nnp.savez_compressed(f'{cell_dir}/{image_id}', cell_mask)\nnp.savez_compressed(f'{nucl_dir}/{image_id}', nucl_mask)\n</pre>\n<p>So you can load this mask as follows:</p>\n<pre>cell_mask = np.load(f'{cell_dir}/{image_id}.npz')['arr_0']\nnucl_mask = np.load(f'{nucl_dir}/{image_id}.npz')['arr_0']\n</pre>",
  "messages": [
    {
      "id": 1178800,
      "postDate": "2021-01-31T05:56:48.457Z",
      "content": "<p>I made a Segmentation Mask Dataset.<br>\n<a href=\"https://www.kaggle.com/its7171/hpa-mask\" target=\"_blank\">https://www.kaggle.com/its7171/hpa-mask</a></p>\n<p>This dataset includes Segmentation information made by <a href=\"https://github.com/CellProfiling/HPA-Cell-Segmentation\" target=\"_blank\">CellSegmentator</a>.</p>\n<p>This mask files are made as follows:</p>\n<pre>nucl_mask, cell_mask = label_cell(nuc_segmentations[1], cell_segmentations[1])\nnp.savez_compressed(f'{cell_dir}/{image_id}', cell_mask)\nnp.savez_compressed(f'{nucl_dir}/{image_id}', nucl_mask)\n</pre>\n<p>So you can load this mask as follows:</p>\n<pre>cell_mask = np.load(f'{cell_dir}/{image_id}.npz')['arr_0']\nnucl_mask = np.load(f'{nucl_dir}/{image_id}.npz')['arr_0']\n</pre>",
      "rawMarkdown": "I made a Segmentation Mask Dataset.\nhttps://www.kaggle.com/its7171/hpa-mask\n\nThis dataset includes Segmentation information made by [CellSegmentator](https://github.com/CellProfiling/HPA-Cell-Segmentation).\n\nThis mask files are made as follows:\n<pre>\nnucl_mask, cell_mask = label_cell(nuc_segmentations[1], cell_segmentations[1])\nnp.savez_compressed(f'{cell_dir}/{image_id}', cell_mask)\nnp.savez_compressed(f'{nucl_dir}/{image_id}', nucl_mask)\n</pre>\nSo you can load this mask as follows:\n<pre>\ncell_mask = np.load(f'{cell_dir}/{image_id}.npz')['arr_0']\nnucl_mask = np.load(f'{nucl_dir}/{image_id}.npz')['arr_0']\n</pre>",
      "votes": 76
    },
    {
      "id": 1229372,
      "postDate": "2021-03-07T09:45:04.537Z",
      "content": "<p>thanks!<br>\n<img src=\"https://purepng.com/public/uploads/large/thumbs-up-icon-te7.png\" alt=\"\"></p>",
      "rawMarkdown": "thanks!\n![](https://purepng.com/public/uploads/large/thumbs-up-icon-te7.png)",
      "votes": 6
    },
    {
      "id": 1179255,
      "postDate": "2021-01-31T13:02:56.290Z",
      "content": "<p>You are a hero. You saved me a whole day.</p>",
      "rawMarkdown": "You are a hero. You saved me a whole day.",
      "votes": 3
    },
    {
      "id": 1256781,
      "postDate": "2021-03-30T08:28:50.647Z",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/its7171\" target=\"_blank\">@its7171</a> </p>\n<p>I'm having an issue when I segment cells. Sometimes the CellSegmentator doesn't detect any masks, so the only value in the arrays is 0. Did this happened to you?</p>",
      "rawMarkdown": "Hi @its7171 \n\nI'm having an issue when I segment cells. Sometimes the CellSegmentator doesn't detect any masks, so the only value in the arrays is 0. Did this happened to you?",
      "votes": 1
    },
    {
      "id": 1226332,
      "postDate": "2021-03-04T12:58:13.167Z",
      "content": "<p>Hi, so you have segmented the images with CellSegmentator, but how did you assign labels for each mask?</p>",
      "rawMarkdown": "Hi, so you have segmented the images with CellSegmentator, but how did you assign labels for each mask?",
      "votes": 1,
      "replies": [
        {
          "id": 1227462,
          "postDate": "2021-03-05T15:01:38.617Z",
          "content": "<p>In this dataset, only segment information is provided, no label information is included.</p>",
          "rawMarkdown": "In this dataset, only segment information is provided, no label information is included.",
          "votes": 1
        },
        {
          "id": 1227618,
          "postDate": "2021-03-05T17:27:54.773Z",
          "content": "<p><a href=\"https://www.kaggle.com/its7171\" target=\"_blank\">@its7171</a>, thanks, how did you assign labels to segmentation masks in your mmdetection notebook? As far as I know, mmdetection requires label and corresponding masks for instance segmentation. Thanks!</p>",
          "rawMarkdown": "@its7171, thanks, how did you assign labels to segmentation masks in your mmdetection notebook? As far as I know, mmdetection requires label and corresponding masks for instance segmentation. Thanks!",
          "votes": 1
        },
        {
          "id": 1227663,
          "postDate": "2021-03-05T18:21:10.563Z",
          "content": "<p>In <a href=\"https://www.kaggle.com/its7171/mmdetection-for-segmentation-training\" target=\"_blank\">this notebook</a>, I simply assigned image level labels to segmented cells in that image.</p>",
          "rawMarkdown": "In [this notebook](https://www.kaggle.com/its7171/mmdetection-for-segmentation-training), I simply assigned image level labels to segmented cells in that image.",
          "votes": 1
        },
        {
          "id": 1229285,
          "postDate": "2021-03-07T08:31:00.400Z",
          "content": "<p><a href=\"https://www.kaggle.com/t2100208\" target=\"_blank\">@t2100208</a> Thanks, but how did you choose which label assing to an individual mask?</p>",
          "rawMarkdown": "@t2100208 Thanks, but how did you choose which label assing to an individual mask?",
          "votes": 1
        },
        {
          "id": 1229366,
          "postDate": "2021-03-07T09:38:29.313Z",
          "content": "<p>All image labels were simply assigned to all cells in the image.</p>",
          "rawMarkdown": "All image labels were simply assigned to all cells in the image."
        },
        {
          "id": 1270872,
          "postDate": "2021-04-12T05:48:18.843Z",
          "content": "<p>This is a good idea, and it gave me a lot of inspiration. But if all image-level labels are assigned to each cell, a lot of noise will be introduced. Do you think it is better to discard these multi-label images directly, or it is better to use noisy labels?</p>",
          "rawMarkdown": "This is a good idea, and it gave me a lot of inspiration. But if all image-level labels are assigned to each cell, a lot of noise will be introduced. Do you think it is better to discard these multi-label images directly, or it is better to use noisy labels?"
        }
      ]
    },
    {
      "id": 1204439,
      "postDate": "2021-02-16T06:21:37.223Z",
      "content": "<p>How to see the image?</p>",
      "rawMarkdown": "How to see the image?",
      "votes": 1,
      "replies": [
        {
          "id": 1204738,
          "postDate": "2021-02-16T10:11:09.383Z",
          "content": "<p>Please refer to <a href=\"https://www.kaggle.com/its7171/mmdetection-for-segmentation-training\" target=\"_blank\">this notebook</a> which contains an example of drawing an image for this dataset.</p>",
          "rawMarkdown": "Please refer to [this notebook](https://www.kaggle.com/its7171/mmdetection-for-segmentation-training) which contains an example of drawing an image for this dataset.\n"
        }
      ]
    },
    {
      "id": 1199379,
      "postDate": "2021-02-13T19:33:45.390Z",
      "content": "<p>Hi, tito, I have a very naive question, where I can find the label index definition? I cannot find on the CellSegmentator repo</p>",
      "rawMarkdown": "Hi, tito, I have a very naive question, where I can find the label index definition? I cannot find on the CellSegmentator repo",
      "votes": 1,
      "replies": [
        {
          "id": 1199632,
          "postDate": "2021-02-14T03:02:25.130Z",
          "content": "<p>CellSegmentator will only output the cell segment information, but not the label information.<br>\nThe value of cell mask array is just a consecutive serial number.<br>\nIf I have misunderstood your question, please let me know.</p>",
          "rawMarkdown": "CellSegmentator will only output the cell segment information, but not the label information.\nThe value of cell mask array is just a consecutive serial number.\nIf I have misunderstood your question, please let me know.",
          "votes": 2
        }
      ]
    },
    {
      "id": 1204851,
      "postDate": "2021-02-16T11:28:56.807Z",
      "content": "<p>Hi. I have a question. When I try to view the image I am getting a colored image. Why don't we get we the black and white image where 1 represents foreground and 0 represents background? Is the color coming because of combining all the three channels</p>",
      "rawMarkdown": "Hi. I have a question. When I try to view the image I am getting a colored image. Why don't we get we the black and white image where 1 represents foreground and 0 represents background? Is the color coming because of combining all the three channels",
      "votes": 2,
      "replies": [
        {
          "id": 1204877,
          "postDate": "2021-02-16T11:45:53.107Z",
          "content": "<blockquote>\n  <p>Is the color coming because of combining all the three channels</p>\n</blockquote>\n<p>That's normally true.<br>\nHowever, matplotlib will colorize one channel image to make it easier to see.</p>",
          "rawMarkdown": "> Is the color coming because of combining all the three channels\n\nThat's normally true.\nHowever, matplotlib will colorize one channel image to make it easier to see.",
          "votes": 1
        },
        {
          "id": 1242501,
          "postDate": "2021-03-17T16:42:26.520Z",
          "content": "<p>The CellSegmentator gives each cell a number so each photo has 0 where there are no cells, 1 for the first cell, 2 for the second, etc.  To view as simply binary change all values greater than 1 to 1. </p>",
          "rawMarkdown": "The CellSegmentator gives each cell a number so each photo has 0 where there are no cells, 1 for the first cell, 2 for the second, etc.  To view as simply binary change all values greater than 1 to 1. ",
          "votes": 1
        }
      ]
    },
    {
      "id": 1200590,
      "postDate": "2021-02-14T19:04:05.497Z",
      "rawMarkdown": "",
      "isDeleted": true
    },
    {
      "id": 1815651,
      "postDate": "2022-06-09T09:09:07.727Z",
      "content": "<p>Thanks for sharing!</p>",
      "rawMarkdown": "Thanks for sharing!",
      "votes": 1
    },
    {
      "id": 1239425,
      "postDate": "2021-03-15T17:53:23.077Z",
      "content": "<p>Thanks a lot, very useful </p>",
      "rawMarkdown": "Thanks a lot, very useful ",
      "votes": 6
    },
    {
      "id": 1904948,
      "postDate": "2022-08-18T16:06:27.793Z",
      "content": "<p>Thanks for sharing</p>",
      "rawMarkdown": "Thanks for sharing"
    }
  ],
  "comments": [
    {
      "id": 1229372,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "2021-03-07T09:45:04.537000",
      "content": "<p>thanks!<br>\n<img src=\"https://purepng.com/public/uploads/large/thumbs-up-icon-te7.png\" alt=\"\"></p>",
      "votes": 6,
      "replies": []
    },
    {
      "id": 1179255,
      "author_name": "Darien Schettler",
      "author_url": "",
      "post_date": "2021-01-31T13:02:56.290000",
      "content": "<p>You are a hero. You saved me a whole day.</p>",
      "votes": 3,
      "replies": []
    },
    {
      "id": 1256781,
      "author_name": "glopezzz",
      "author_url": "",
      "post_date": "2021-03-30T08:28:50.647000",
      "content": "<p>Hi <a href=\"https://www.kaggle.com/its7171\" target=\"_blank\">@its7171</a> </p>\n<p>I'm having an issue when I segment cells. Sometimes the CellSegmentator doesn't detect any masks, so the only value in the arrays is 0. Did this happened to you?</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1226332,
      "author_name": "wayfarer",
      "author_url": "",
      "post_date": "2021-03-04T12:58:13.167000",
      "content": "<p>Hi, so you have segmented the images with CellSegmentator, but how did you assign labels for each mask?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1227462,
          "author_name": "tito",
          "author_url": "",
          "post_date": "2021-03-05T15:01:38.617000",
          "content": "<p>In this dataset, only segment information is provided, no label information is included.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1227618,
          "author_name": "wayfarer",
          "author_url": "",
          "post_date": "2021-03-05T17:27:54.773000",
          "content": "<p><a href=\"https://www.kaggle.com/its7171\" target=\"_blank\">@its7171</a>, thanks, how did you assign labels to segmentation masks in your mmdetection notebook? As far as I know, mmdetection requires label and corresponding masks for instance segmentation. Thanks!</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1227663,
          "author_name": "tito",
          "author_url": "",
          "post_date": "2021-03-05T18:21:10.563000",
          "content": "<p>In <a href=\"https://www.kaggle.com/its7171/mmdetection-for-segmentation-training\" target=\"_blank\">this notebook</a>, I simply assigned image level labels to segmented cells in that image.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1229285,
          "author_name": "wayfarer",
          "author_url": "",
          "post_date": "2021-03-07T08:31:00.400000",
          "content": "<p><a href=\"https://www.kaggle.com/t2100208\" target=\"_blank\">@t2100208</a> Thanks, but how did you choose which label assing to an individual mask?</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1229366,
          "author_name": "tito",
          "author_url": "",
          "post_date": "2021-03-07T09:38:29.313000",
          "content": "<p>All image labels were simply assigned to all cells in the image.</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 1270872,
          "author_name": "hujianxin",
          "author_url": "",
          "post_date": "2021-04-12T05:48:18.843000",
          "content": "<p>This is a good idea, and it gave me a lot of inspiration. But if all image-level labels are assigned to each cell, a lot of noise will be introduced. Do you think it is better to discard these multi-label images directly, or it is better to use noisy labels?</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1204439,
      "author_name": "RSASHWIN",
      "author_url": "",
      "post_date": "2021-02-16T06:21:37.223000",
      "content": "<p>How to see the image?</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1204738,
          "author_name": "tito",
          "author_url": "",
          "post_date": "2021-02-16T10:11:09.383000",
          "content": "<p>Please refer to <a href=\"https://www.kaggle.com/its7171/mmdetection-for-segmentation-training\" target=\"_blank\">this notebook</a> which contains an example of drawing an image for this dataset.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 1199379,
      "author_name": "Strideradu",
      "author_url": "",
      "post_date": "2021-02-13T19:33:45.390000",
      "content": "<p>Hi, tito, I have a very naive question, where I can find the label index definition? I cannot find on the CellSegmentator repo</p>",
      "votes": 1,
      "replies": [
        {
          "id": 1199632,
          "author_name": "tito",
          "author_url": "",
          "post_date": "2021-02-14T03:02:25.130000",
          "content": "<p>CellSegmentator will only output the cell segment information, but not the label information.<br>\nThe value of cell mask array is just a consecutive serial number.<br>\nIf I have misunderstood your question, please let me know.</p>",
          "votes": 2,
          "replies": []
        }
      ]
    },
    {
      "id": 1204851,
      "author_name": "RSASHWIN",
      "author_url": "",
      "post_date": "2021-02-16T11:28:56.807000",
      "content": "<p>Hi. I have a question. When I try to view the image I am getting a colored image. Why don't we get we the black and white image where 1 represents foreground and 0 represents background? Is the color coming because of combining all the three channels</p>",
      "votes": 2,
      "replies": [
        {
          "id": 1204877,
          "author_name": "tito",
          "author_url": "",
          "post_date": "2021-02-16T11:45:53.107000",
          "content": "<blockquote>\n  <p>Is the color coming because of combining all the three channels</p>\n</blockquote>\n<p>That's normally true.<br>\nHowever, matplotlib will colorize one channel image to make it easier to see.</p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 1242501,
          "author_name": "Amanda K Kimball",
          "author_url": "",
          "post_date": "2021-03-17T16:42:26.520000",
          "content": "<p>The CellSegmentator gives each cell a number so each photo has 0 where there are no cells, 1 for the first cell, 2 for the second, etc.  To view as simply binary change all values greater than 1 to 1. </p>",
          "votes": 1,
          "replies": []
        }
      ]
    },
    {
      "id": 1200590,
      "author_name": "",
      "author_url": "",
      "post_date": "2021-02-14T19:04:05.497000",
      "content": "",
      "votes": 0,
      "replies": []
    },
    {
      "id": 1815651,
      "author_name": "Jyoti Dabass",
      "author_url": "",
      "post_date": "2022-06-09T09:09:07.727000",
      "content": "<p>Thanks for sharing!</p>",
      "votes": 1,
      "replies": []
    },
    {
      "id": 1239425,
      "author_name": "Salim Khazem",
      "author_url": "",
      "post_date": "2021-03-15T17:53:23.077000",
      "content": "<p>Thanks a lot, very useful </p>",
      "votes": 6,
      "replies": []
    },
    {
      "id": 1904948,
      "author_name": "Esco",
      "author_url": "",
      "post_date": "2022-08-18T16:06:27.793000",
      "content": "<p>Thanks for sharing</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1178800": "I made a Segmentation Mask Dataset.\nhttps://www.kaggle.com/its7171/hpa-mask\n\nThis dataset includes Segmentation information made by [CellSegmentator](https://github.com/CellProfiling/HPA-Cell-Segmentation).\n\nThis mask files are made as follows:\n<pre>\nnucl_mask, cell_mask = label_cell(nuc_segmentations[1], cell_segmentations[1])\nnp.savez_compressed(f'{cell_dir}/{image_id}', cell_mask)\nnp.savez_compressed(f'{nucl_dir}/{image_id}', nucl_mask)\n</pre>\nSo you can load this mask as follows:\n<pre>\ncell_mask = np.load(f'{cell_dir}/{image_id}.npz')['arr_0']\nnucl_mask = np.load(f'{nucl_dir}/{image_id}.npz')['arr_0']\n</pre>",
    "1229372": "thanks!\n![](https://purepng.com/public/uploads/large/thumbs-up-icon-te7.png)",
    "1179255": "You are a hero. You saved me a whole day.",
    "1256781": "Hi @its7171 \n\nI'm having an issue when I segment cells. Sometimes the CellSegmentator doesn't detect any masks, so the only value in the arrays is 0. Did this happened to you?",
    "1226332": "Hi, so you have segmented the images with CellSegmentator, but how did you assign labels for each mask?",
    "1204439": "How to see the image?",
    "1199379": "Hi, tito, I have a very naive question, where I can find the label index definition? I cannot find on the CellSegmentator repo",
    "1204851": "Hi. I have a question. When I try to view the image I am getting a colored image. Why don't we get we the black and white image where 1 represents foreground and 0 represents background? Is the color coming because of combining all the three channels",
    "1200590": "",
    "1815651": "Thanks for sharing!",
    "1239425": "Thanks a lot, very useful ",
    "1904948": "Thanks for sharing"
  }
}