{
  "id": 65195,
  "title": "Segmentation file and RLE",
  "url": "/competitions/airbus-ship-detection/discussion/65195",
  "author_name": "",
  "post_date": "2018-09-07T08:53:59.760166500Z",
  "votes": null,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi, </p>\n\n<p>I need help in reading the RLE column in segmentation file. For example if for an image RLE is \"264661 17 265429 33 266197 33 266965 33 267733 33 268501 33\", then how to read this?</p>\n\n<p>Second question: Is Target variable encoded pixels of a bounding box.? If yes, then the problem gives us the masks of all the ships and we need to give the bounding box pixels for each image. If no, please explain?</p>\n\n<p>Third question: What is aligned bounding box segment?</p>",
  "messages": [
    {
      "id": "382875",
      "postDate": "09/07/2018 08:53:59",
      "content": "<p>Hi, </p>\n\n<p>I need help in reading the RLE column in segmentation file. For example if for an image RLE is \"264661 17 265429 33 266197 33 266965 33 267733 33 268501 33\", then how to read this?</p>\n\n<p>Second question: Is Target variable encoded pixels of a bounding box.? If yes, then the problem gives us the masks of all the ships and we need to give the bounding box pixels for each image. If no, please explain?</p>\n\n<p>Third question: What is aligned bounding box segment?</p>",
      "rawMarkdown": "Hi, \n\nI need help in reading the RLE column in segmentation file. For example if for an image RLE is \"264661 17 265429 33 266197 33 266965 33 267733 33 268501 33\", then how to read this?\n\nSecond question: Is Target variable encoded pixels of a bounding box.? If yes, then the problem gives us the masks of all the ships and we need to give the bounding box pixels for each image. If no, please explain?\n\nThird question: What is aligned bounding box segment?",
      "votes": null
    },
    {
      "id": "382962",
      "postDate": "09/07/2018 12:08:04",
      "content": "<p>This is what I understand about RLE encoding in Kaggle for this competition:</p>\n\n<p>RLE format is explained in <a href=\"https://www.kaggle.com/c/airbus-ship-detection#evaluation\">https://www.kaggle.com/c/airbus-ship-detection#evaluation</a> , in the \"Submission File\" part. </p>\n\n<p>&gt;  The pixels are one-indexed and numbered from top to bottom, then left to right: 1 is pixel (1,1), 2 is pixel (2,1), etc\nThis explanation is a little bit confusing, because usually we start pixel coordinate from (0,0) instead of (1,1)</p>\n\n<p>some extreme values:</p>\n\n<ul>\n<li>top leftmost pixel is number 1   </li>\n<li>bottom leftmost pixel is number 768  </li>\n<li>bottom rightmost pixel is 768x768 = 589824  </li>\n<li>top rightmost pixel is 589824-768+1= 589057</li>\n</ul>\n\n<p><strong>Explanation of \"264661 17\"</strong></p>\n\n<p>264661 divided by 768 rounded down is 344 , which means 344 pixel to the right</p>\n\n<p>264661 modulo 768 is 469, which means 469 down from top</p>\n\n<p>So the segment start at position x=344 and y=469, assuming (0,0) is top-left</p>\n\n<p>\"264661 17\" means the mask consist of 17 pixels long down from (344,469), which means the mask pixels are (344,469) , (344,470) and so on until (344,469+17-1) or (344,485)</p>",
      "rawMarkdown": "This is what I understand about RLE encoding in Kaggle for this competition:\n\nRLE format is explained in https://www.kaggle.com/c/airbus-ship-detection#evaluation , in the \"Submission File\" part. \n\n&gt;  The pixels are one-indexed and numbered from top to bottom, then left to right: 1 is pixel (1,1), 2 is pixel (2,1), etc\nThis explanation is a little bit confusing, because usually we start pixel coordinate from (0,0) instead of (1,1)\n\nsome extreme values:\n\n- top leftmost pixel is number 1   \n- bottom leftmost pixel is number 768  \n- bottom rightmost pixel is 768x768 = 589824  \n- top rightmost pixel is 589824-768+1= 589057\n\n**Explanation of \"264661 17\"**\n\n264661 divided by 768 rounded down is 344 , which means 344 pixel to the right\n\n264661 modulo 768 is 469, which means 469 down from top\n\nSo the segment start at position x=344 and y=469, assuming (0,0) is top-left\n\n\"264661 17\" means the mask consist of 17 pixels long down from (344,469), which means the mask pixels are (344,469) , (344,470) and so on until (344,469+17-1) or (344,485)",
      "votes": null
    },
    {
      "id": "383700",
      "postDate": "09/09/2018 12:01:23",
      "content": "<p>A total NOOB to Run Length Encoding, I do not understand how to use it, at all.</p>\n\n<p>Besides, I read that I cannot mask the images manually. So is there a pre existing piece of code that I can use to convert the Run Length Encoded Data present here to some kind of image/less cryptic representation?</p>",
      "rawMarkdown": "A total NOOB to Run Length Encoding, I do not understand how to use it, at all.\n\nBesides, I read that I cannot mask the images manually. So is there a pre existing piece of code that I can use to convert the Run Length Encoded Data present here to some kind of image/less cryptic representation?",
      "votes": null
    },
    {
      "id": "383747",
      "postDate": "09/09/2018 14:15:23",
      "content": "<p>RLE codes are available here:</p>\n\n<ul>\n<li><a href=\"https://www.kaggle.com/paulorzp/run-length-encode-and-decode\">https://www.kaggle.com/paulorzp/run-length-encode-and-decode</a></li>\n<li><a href=\"https://www.kaggle.com/inversion/run-length-decoding-quick-start\">https://www.kaggle.com/inversion/run-length-decoding-quick-start</a></li>\n</ul>\n\n<p>Personally I think the codes are quite cryptic for non-Python programmer.</p>",
      "rawMarkdown": "RLE codes are available here:\n\n - [https://www.kaggle.com/paulorzp/run-length-encode-and-decode][1]\n - [https://www.kaggle.com/inversion/run-length-decoding-quick-start][2]\n\nPersonally I think the codes are quite cryptic for non-Python programmer.\n\n  [1]: https://www.kaggle.com/paulorzp/run-length-encode-and-decode\n  [2]: https://www.kaggle.com/inversion/run-length-decoding-quick-start",
      "votes": null
    },
    {
      "id": "383903",
      "postDate": "09/09/2018 22:13:38",
      "content": "<p>Thanks..I'll try it right away!</p>\n\n<p>Even though I've been a Python Programmer for about 1.5 years now, I've never used Run Length Encoding, though(I was into web earlier)</p>",
      "rawMarkdown": "Thanks..I'll try it right away!\n\nEven though I've been a Python Programmer for about 1.5 years now, I've never used Run Length Encoding, though(I was into web earlier)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 382962,
      "author_name": "waskita",
      "author_url": "",
      "post_date": "09/07/2018 12:08:04",
      "content": "<p>This is what I understand about RLE encoding in Kaggle for this competition:</p>\n\n<p>RLE format is explained in <a href=\"https://www.kaggle.com/c/airbus-ship-detection#evaluation\">https://www.kaggle.com/c/airbus-ship-detection#evaluation</a> , in the \"Submission File\" part. </p>\n\n<p>&gt;  The pixels are one-indexed and numbered from top to bottom, then left to right: 1 is pixel (1,1), 2 is pixel (2,1), etc\nThis explanation is a little bit confusing, because usually we start pixel coordinate from (0,0) instead of (1,1)</p>\n\n<p>some extreme values:</p>\n\n<ul>\n<li>top leftmost pixel is number 1   </li>\n<li>bottom leftmost pixel is number 768  </li>\n<li>bottom rightmost pixel is 768x768 = 589824  </li>\n<li>top rightmost pixel is 589824-768+1= 589057</li>\n</ul>\n\n<p><strong>Explanation of \"264661 17\"</strong></p>\n\n<p>264661 divided by 768 rounded down is 344 , which means 344 pixel to the right</p>\n\n<p>264661 modulo 768 is 469, which means 469 down from top</p>\n\n<p>So the segment start at position x=344 and y=469, assuming (0,0) is top-left</p>\n\n<p>\"264661 17\" means the mask consist of 17 pixels long down from (344,469), which means the mask pixels are (344,469) , (344,470) and so on until (344,469+17-1) or (344,485)</p>",
      "votes": null,
      "replies": [
        {
          "id": 383700,
          "author_name": "sehgaldivij",
          "author_url": "",
          "post_date": "09/09/2018 12:01:23",
          "content": "<p>A total NOOB to Run Length Encoding, I do not understand how to use it, at all.</p>\n\n<p>Besides, I read that I cannot mask the images manually. So is there a pre existing piece of code that I can use to convert the Run Length Encoded Data present here to some kind of image/less cryptic representation?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 383747,
          "author_name": "waskita",
          "author_url": "",
          "post_date": "09/09/2018 14:15:23",
          "content": "<p>RLE codes are available here:</p>\n\n<ul>\n<li><a href=\"https://www.kaggle.com/paulorzp/run-length-encode-and-decode\">https://www.kaggle.com/paulorzp/run-length-encode-and-decode</a></li>\n<li><a href=\"https://www.kaggle.com/inversion/run-length-decoding-quick-start\">https://www.kaggle.com/inversion/run-length-decoding-quick-start</a></li>\n</ul>\n\n<p>Personally I think the codes are quite cryptic for non-Python programmer.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 383903,
          "author_name": "sehgaldivij",
          "author_url": "",
          "post_date": "09/09/2018 22:13:38",
          "content": "<p>Thanks..I'll try it right away!</p>\n\n<p>Even though I've been a Python Programmer for about 1.5 years now, I've never used Run Length Encoding, though(I was into web earlier)</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "382875": "Hi, \n\nI need help in reading the RLE column in segmentation file. For example if for an image RLE is \"264661 17 265429 33 266197 33 266965 33 267733 33 268501 33\", then how to read this?\n\nSecond question: Is Target variable encoded pixels of a bounding box.? If yes, then the problem gives us the masks of all the ships and we need to give the bounding box pixels for each image. If no, please explain?\n\nThird question: What is aligned bounding box segment?",
    "382962": "This is what I understand about RLE encoding in Kaggle for this competition:\n\nRLE format is explained in https://www.kaggle.com/c/airbus-ship-detection#evaluation , in the \"Submission File\" part. \n\n&gt;  The pixels are one-indexed and numbered from top to bottom, then left to right: 1 is pixel (1,1), 2 is pixel (2,1), etc\nThis explanation is a little bit confusing, because usually we start pixel coordinate from (0,0) instead of (1,1)\n\nsome extreme values:\n\n- top leftmost pixel is number 1   \n- bottom leftmost pixel is number 768  \n- bottom rightmost pixel is 768x768 = 589824  \n- top rightmost pixel is 589824-768+1= 589057\n\n**Explanation of \"264661 17\"**\n\n264661 divided by 768 rounded down is 344 , which means 344 pixel to the right\n\n264661 modulo 768 is 469, which means 469 down from top\n\nSo the segment start at position x=344 and y=469, assuming (0,0) is top-left\n\n\"264661 17\" means the mask consist of 17 pixels long down from (344,469), which means the mask pixels are (344,469) , (344,470) and so on until (344,469+17-1) or (344,485)",
    "383700": "A total NOOB to Run Length Encoding, I do not understand how to use it, at all.\n\nBesides, I read that I cannot mask the images manually. So is there a pre existing piece of code that I can use to convert the Run Length Encoded Data present here to some kind of image/less cryptic representation?",
    "383747": "RLE codes are available here:\n\n - [https://www.kaggle.com/paulorzp/run-length-encode-and-decode][1]\n - [https://www.kaggle.com/inversion/run-length-decoding-quick-start][2]\n\nPersonally I think the codes are quite cryptic for non-Python programmer.\n\n  [1]: https://www.kaggle.com/paulorzp/run-length-encode-and-decode\n  [2]: https://www.kaggle.com/inversion/run-length-decoding-quick-start",
    "383903": "Thanks..I'll try it right away!\n\nEven though I've been a Python Programmer for about 1.5 years now, I've never used Run Length Encoding, though(I was into web earlier)"
  },
  "source": "meta"
}