{
  "id": 295603,
  "title": "RLE to mask bug",
  "url": "/competitions/sartorius-cell-instance-segmentation/discussion/295603",
  "author_name": "",
  "post_date": "2021-12-16T20:58:47.735713800Z",
  "votes": 16,
  "comment_count": 4,
  "views": 0,
  "content": "<p>When I look closely at the numpy mask converted from RLE, I noticed some of the cells are missed. </p>\n<p>Take '17d738f88487' for example, <br>\n<img src=\"https://i.ibb.co/ZM8nnLb/Screenshot-2021-12-16-145731.png\" alt=\"\"><br>\nThe left is the correct one, and the right is the output of many high vote notebooks.</p>\n<p>To correct the bug, you can enumerate from number&gt;0, like such as 10 or sth</p>\n<pre><code> for i, annot in enumerate(annotations,10):\n         img_mask = np.where(rle2mask(annot, shape)!=0, i, img_mask)\n</code></pre>",
  "messages": [
    {
      "id": "1620506",
      "postDate": "12/16/2021 20:58:47",
      "content": "<p>When I look closely at the numpy mask converted from RLE, I noticed some of the cells are missed. </p>\n<p>Take '17d738f88487' for example, <br>\n<img src=\"https://i.ibb.co/ZM8nnLb/Screenshot-2021-12-16-145731.png\" alt=\"\"><br>\nThe left is the correct one, and the right is the output of many high vote notebooks.</p>\n<p>To correct the bug, you can enumerate from number&gt;0, like such as 10 or sth</p>\n<pre><code> for i, annot in enumerate(annotations,10):\n         img_mask = np.where(rle2mask(annot, shape)!=0, i, img_mask)\n</code></pre>",
      "rawMarkdown": "When I look closely at the numpy mask converted from RLE, I noticed some of the cells are missed. \n\nTake '17d738f88487' for example, \n![](https://i.ibb.co/ZM8nnLb/Screenshot-2021-12-16-145731.png)\nThe left is the correct one, and the right is the output of many high vote notebooks.\n\nTo correct the bug, you can enumerate from number>0, like such as 10 or sth\n\n```\n for i, annot in enumerate(annotations,10):\n         img_mask = np.where(rle2mask(annot, shape)!=0, i, img_mask)\n```",
      "votes": null
    },
    {
      "id": "1620663",
      "postDate": "12/17/2021 02:54:18",
      "content": "<p>I just looked at my annotation file for 17d738f88487 and it is not missing the above cell. Which notebook did you use? This is what I used: <a href=\"https://www.kaggle.com/ammarnassanalhajali/k-fold-crossvalidation-coco-dataset-generator?scriptVersionId=79370156\" target=\"_blank\">https://www.kaggle.com/ammarnassanalhajali/k-fold-crossvalidation-coco-dataset-generator?scriptVersionId=79370156</a></p>",
      "rawMarkdown": "I just looked at my annotation file for 17d738f88487 and it is not missing the above cell. Which notebook did you use? This is what I used: https://www.kaggle.com/ammarnassanalhajali/k-fold-crossvalidation-coco-dataset-generator?scriptVersionId=79370156",
      "votes": null
    },
    {
      "id": "1620698",
      "postDate": "12/17/2021 04:30:19",
      "content": "<p>yeah i think this is the best one since it uses uncompressed RLE. A lot slower than the other generators but in my experiments it might be a reason for better performance. Haven't tried the one with clean astro annotations since I couldn't incorporate polygon masks loss calculation into my pipeline</p>",
      "rawMarkdown": "yeah i think this is the best one since it uses uncompressed RLE. A lot slower than the other generators but in my experiments it might be a reason for better performance. Haven't tried the one with clean astro annotations since I couldn't incorporate polygon masks loss calculation into my pipeline",
      "votes": null
    },
    {
      "id": "1622277",
      "postDate": "12/18/2021 14:37:03",
      "content": "<p>I found this bug, too. it lost one example. Thank you for sharing.</p>",
      "rawMarkdown": "I found this bug, too. it lost one example. Thank you for sharing.",
      "votes": null
    },
    {
      "id": "1624024",
      "postDate": "12/20/2021 13:31:22",
      "content": "<p>Could anyone figure out which notebooks are wrong?</p>",
      "rawMarkdown": "Could anyone figure out which notebooks are wrong?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1620663,
      "author_name": "shujun717",
      "author_url": "",
      "post_date": "12/17/2021 02:54:18",
      "content": "<p>I just looked at my annotation file for 17d738f88487 and it is not missing the above cell. Which notebook did you use? This is what I used: <a href=\"https://www.kaggle.com/ammarnassanalhajali/k-fold-crossvalidation-coco-dataset-generator?scriptVersionId=79370156\" target=\"_blank\">https://www.kaggle.com/ammarnassanalhajali/k-fold-crossvalidation-coco-dataset-generator?scriptVersionId=79370156</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 1620698,
          "author_name": "ferlockx",
          "author_url": "",
          "post_date": "12/17/2021 04:30:19",
          "content": "<p>yeah i think this is the best one since it uses uncompressed RLE. A lot slower than the other generators but in my experiments it might be a reason for better performance. Haven't tried the one with clean astro annotations since I couldn't incorporate polygon masks loss calculation into my pipeline</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1622277,
      "author_name": "shigengtian",
      "author_url": "",
      "post_date": "12/18/2021 14:37:03",
      "content": "<p>I found this bug, too. it lost one example. Thank you for sharing.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1624024,
      "author_name": "chihantsai",
      "author_url": "",
      "post_date": "12/20/2021 13:31:22",
      "content": "<p>Could anyone figure out which notebooks are wrong?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1620506": "When I look closely at the numpy mask converted from RLE, I noticed some of the cells are missed. \n\nTake '17d738f88487' for example, \n![](https://i.ibb.co/ZM8nnLb/Screenshot-2021-12-16-145731.png)\nThe left is the correct one, and the right is the output of many high vote notebooks.\n\nTo correct the bug, you can enumerate from number>0, like such as 10 or sth\n\n```\n for i, annot in enumerate(annotations,10):\n         img_mask = np.where(rle2mask(annot, shape)!=0, i, img_mask)\n```",
    "1620663": "I just looked at my annotation file for 17d738f88487 and it is not missing the above cell. Which notebook did you use? This is what I used: https://www.kaggle.com/ammarnassanalhajali/k-fold-crossvalidation-coco-dataset-generator?scriptVersionId=79370156",
    "1620698": "yeah i think this is the best one since it uses uncompressed RLE. A lot slower than the other generators but in my experiments it might be a reason for better performance. Haven't tried the one with clean astro annotations since I couldn't incorporate polygon masks loss calculation into my pipeline",
    "1622277": "I found this bug, too. it lost one example. Thank you for sharing.",
    "1624024": "Could anyone figure out which notebooks are wrong?"
  },
  "source": "meta"
}