{
  "id": 47699,
  "title": "Understanding run-length encoded representation?",
  "url": "/competitions/data-science-bowl-2018/discussion/47699",
  "author_name": "",
  "post_date": "2018-01-17T19:29:31.561508800Z",
  "votes": 3,
  "comment_count": 5,
  "views": 0,
  "content": "<p>Hi everyone,</p>\n\n<p>I have trouble understanding the run-length encoded representation. For the very first entry 00071198d059ba7f5914a526d124d28e6d010c92466da21d4a04cd5413362552 the sum of the encoded pixels is 141324, whereas the image is 256x256=65536 pixels.</p>\n\n<p>According to my understanding the run-length encoding alternatively specifies the number of zeros and 255s in the masks. The first entry is:\n[6908 1 7161 8 7417 8 7672 9 7928 9 8184 9 8440 9 8696 9 8952 9 9209 8 9465 8 9722 7 9978 7 10235 6 10493 4 10752 1]\nSo I would expect 6908 zeros, 1 255, 7161 zeros, etc. But that does not seem to be the case.</p>\n\n<p>Could someone please point me to the error in my thought and how to convert the encoding to the mask?</p>\n\n<p>Thanks a lot,\nFlorian</p>",
  "messages": [
    {
      "id": "270128",
      "postDate": "01/17/2018 19:29:31",
      "content": "<p>Hi everyone,</p>\n\n<p>I have trouble understanding the run-length encoded representation. For the very first entry 00071198d059ba7f5914a526d124d28e6d010c92466da21d4a04cd5413362552 the sum of the encoded pixels is 141324, whereas the image is 256x256=65536 pixels.</p>\n\n<p>According to my understanding the run-length encoding alternatively specifies the number of zeros and 255s in the masks. The first entry is:\n[6908 1 7161 8 7417 8 7672 9 7928 9 8184 9 8440 9 8696 9 8952 9 9209 8 9465 8 9722 7 9978 7 10235 6 10493 4 10752 1]\nSo I would expect 6908 zeros, 1 255, 7161 zeros, etc. But that does not seem to be the case.</p>\n\n<p>Could someone please point me to the error in my thought and how to convert the encoding to the mask?</p>\n\n<p>Thanks a lot,\nFlorian</p>",
      "rawMarkdown": "Hi everyone,\n\nI have trouble understanding the run-length encoded representation. For the very first entry 00071198d059ba7f5914a526d124d28e6d010c92466da21d4a04cd5413362552 the sum of the encoded pixels is 141324, whereas the image is 256x256=65536 pixels.\n\nAccording to my understanding the run-length encoding alternatively specifies the number of zeros and 255s in the masks. The first entry is:\n[6908 1 7161 8 7417 8 7672 9 7928 9 8184 9 8440 9 8696 9 8952 9 9209 8 9465 8 9722 7 9978 7 10235 6 10493 4 10752 1]\nSo I would expect 6908 zeros, 1 255, 7161 zeros, etc. But that does not seem to be the case.\n\nCould someone please point me to the error in my thought and how to convert the encoding to the mask?\n\nThanks a lot,\nFlorian",
      "votes": null
    },
    {
      "id": "270162",
      "postDate": "01/17/2018 21:15:25",
      "content": "<p>take a look here  <a href=\"https://www.kaggle.com/c/data-science-bowl-2018#evaluation\">https://www.kaggle.com/c/data-science-bowl-2018#evaluation</a></p>\n\n<blockquote>\n  <p>In order to reduce the submission file size, our metric uses run-length encoding on the pixel values. Instead of submitting an exhaustive list of indices for your segmentation, you will submit pairs of values that contain a start position and a run length. E.g. '1 3' implies starting at pixel 1 and running a total of 3 pixels (1,2,3).</p>\n  \n  <p>The competition format requires a space delimited list of pairs. For example, '1 3 10 5' implies pixels 1,2,3,10,11,12,13,14 are to be included in the mask. 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.</p>\n</blockquote>",
      "rawMarkdown": "take a look here  [https://www.kaggle.com/c/data-science-bowl-2018#evaluation][1]\n\n&gt; In order to reduce the submission file size, our metric uses run-length encoding on the pixel values. Instead of submitting an exhaustive list of indices for your segmentation, you will submit pairs of values that contain a start position and a run length. E.g. '1 3' implies starting at pixel 1 and running a total of 3 pixels (1,2,3).\n\n&gt;The competition format requires a space delimited list of pairs. For example, '1 3 10 5' implies pixels 1,2,3,10,11,12,13,14 are to be included in the mask. 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.\n\n\n\n  [1]: https://www.kaggle.com/c/data-science-bowl-2018#evaluation",
      "votes": null
    },
    {
      "id": "270396",
      "postDate": "01/18/2018 07:25:51",
      "content": "<p>The kernel by Kjetil Åmdal-Sævik has an implementation to generate a submission in this format from the predictions.</p>",
      "rawMarkdown": "The kernel by Kjetil Åmdal-Sævik has an implementation to generate a submission in this format from the predictions.",
      "votes": null
    },
    {
      "id": "274291",
      "postDate": "01/26/2018 09:04:25",
      "content": "<p>From what I've understood, the first entry starts at pixel number 6908 and has 1 pixel. The 2nd one starts at 7161 and has 8 pixels, so it goes from 7161 to 7168, the third one from 7417 to 7424 and so on...</p>",
      "rawMarkdown": "From what I've understood, the first entry starts at pixel number 6908 and has 1 pixel. The 2nd one starts at 7161 and has 8 pixels, so it goes from 7161 to 7168, the third one from 7417 to 7424 and so on...",
      "votes": null
    },
    {
      "id": "274503",
      "postDate": "01/26/2018 18:06:52",
      "content": "<p>As mentioned in <a href=\"https://www.kaggle.com/c/data-science-bowl-2018/discussion/48321\">https://www.kaggle.com/c/data-science-bowl-2018/discussion/48321</a></p>\n\n<p>This demo feels more easy to understand for newcomers. </p>\n\n<p><a href=\"http://www.csfieldguide.org.nz/releases/1.9.9/_static/interactives/cc/run-length-encoding/index.html\">http://www.csfieldguide.org.nz/releases/1.9.9/_static/interactives/cc/run-length-encoding/index.html</a></p>",
      "rawMarkdown": "As mentioned in https://www.kaggle.com/c/data-science-bowl-2018/discussion/48321\n\nThis demo feels more easy to understand for newcomers. \n\nhttp://www.csfieldguide.org.nz/releases/1.9.9/_static/interactives/cc/run-length-encoding/index.html",
      "votes": null
    },
    {
      "id": "782407",
      "postDate": "03/22/2020 08:57:02",
      "content": "<p>The csfieldguide link is a great one for understanding. Thanks Abner for sharing that! \nThe url is no more existent now, but I could search to find the relevant article:\n<a href=\"https://www.csfieldguide.org.nz/en/chapters/coding-compression/run-length-encoding/\">https://www.csfieldguide.org.nz/en/chapters/coding-compression/run-length-encoding/</a>\nand here's the interactive:\n<a href=\"https://www.csfieldguide.org.nz/en/interactives/run-length-encoding/\">https://www.csfieldguide.org.nz/en/interactives/run-length-encoding/</a></p>",
      "rawMarkdown": "The csfieldguide link is a great one for understanding. Thanks Abner for sharing that! \nThe url is no more existent now, but I could search to find the relevant article:\nhttps://www.csfieldguide.org.nz/en/chapters/coding-compression/run-length-encoding/\nand here's the interactive:\nhttps://www.csfieldguide.org.nz/en/interactives/run-length-encoding/",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 270162,
      "author_name": "steubk",
      "author_url": "",
      "post_date": "01/17/2018 21:15:25",
      "content": "<p>take a look here  <a href=\"https://www.kaggle.com/c/data-science-bowl-2018#evaluation\">https://www.kaggle.com/c/data-science-bowl-2018#evaluation</a></p>\n\n<blockquote>\n  <p>In order to reduce the submission file size, our metric uses run-length encoding on the pixel values. Instead of submitting an exhaustive list of indices for your segmentation, you will submit pairs of values that contain a start position and a run length. E.g. '1 3' implies starting at pixel 1 and running a total of 3 pixels (1,2,3).</p>\n  \n  <p>The competition format requires a space delimited list of pairs. For example, '1 3 10 5' implies pixels 1,2,3,10,11,12,13,14 are to be included in the mask. 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.</p>\n</blockquote>",
      "votes": null,
      "replies": []
    },
    {
      "id": 270396,
      "author_name": "mustafaradha",
      "author_url": "",
      "post_date": "01/18/2018 07:25:51",
      "content": "<p>The kernel by Kjetil Åmdal-Sævik has an implementation to generate a submission in this format from the predictions.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 274291,
      "author_name": "soodankit",
      "author_url": "",
      "post_date": "01/26/2018 09:04:25",
      "content": "<p>From what I've understood, the first entry starts at pixel number 6908 and has 1 pixel. The 2nd one starts at 7161 and has 8 pixels, so it goes from 7161 to 7168, the third one from 7417 to 7424 and so on...</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 274503,
      "author_name": "abnerchou",
      "author_url": "",
      "post_date": "01/26/2018 18:06:52",
      "content": "<p>As mentioned in <a href=\"https://www.kaggle.com/c/data-science-bowl-2018/discussion/48321\">https://www.kaggle.com/c/data-science-bowl-2018/discussion/48321</a></p>\n\n<p>This demo feels more easy to understand for newcomers. </p>\n\n<p><a href=\"http://www.csfieldguide.org.nz/releases/1.9.9/_static/interactives/cc/run-length-encoding/index.html\">http://www.csfieldguide.org.nz/releases/1.9.9/_static/interactives/cc/run-length-encoding/index.html</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 782407,
          "author_name": "himanshuhc",
          "author_url": "",
          "post_date": "03/22/2020 08:57:02",
          "content": "<p>The csfieldguide link is a great one for understanding. Thanks Abner for sharing that! \nThe url is no more existent now, but I could search to find the relevant article:\n<a href=\"https://www.csfieldguide.org.nz/en/chapters/coding-compression/run-length-encoding/\">https://www.csfieldguide.org.nz/en/chapters/coding-compression/run-length-encoding/</a>\nand here's the interactive:\n<a href=\"https://www.csfieldguide.org.nz/en/interactives/run-length-encoding/\">https://www.csfieldguide.org.nz/en/interactives/run-length-encoding/</a></p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "270128": "Hi everyone,\n\nI have trouble understanding the run-length encoded representation. For the very first entry 00071198d059ba7f5914a526d124d28e6d010c92466da21d4a04cd5413362552 the sum of the encoded pixels is 141324, whereas the image is 256x256=65536 pixels.\n\nAccording to my understanding the run-length encoding alternatively specifies the number of zeros and 255s in the masks. The first entry is:\n[6908 1 7161 8 7417 8 7672 9 7928 9 8184 9 8440 9 8696 9 8952 9 9209 8 9465 8 9722 7 9978 7 10235 6 10493 4 10752 1]\nSo I would expect 6908 zeros, 1 255, 7161 zeros, etc. But that does not seem to be the case.\n\nCould someone please point me to the error in my thought and how to convert the encoding to the mask?\n\nThanks a lot,\nFlorian",
    "270162": "take a look here  [https://www.kaggle.com/c/data-science-bowl-2018#evaluation][1]\n\n&gt; In order to reduce the submission file size, our metric uses run-length encoding on the pixel values. Instead of submitting an exhaustive list of indices for your segmentation, you will submit pairs of values that contain a start position and a run length. E.g. '1 3' implies starting at pixel 1 and running a total of 3 pixels (1,2,3).\n\n&gt;The competition format requires a space delimited list of pairs. For example, '1 3 10 5' implies pixels 1,2,3,10,11,12,13,14 are to be included in the mask. 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.\n\n\n\n  [1]: https://www.kaggle.com/c/data-science-bowl-2018#evaluation",
    "270396": "The kernel by Kjetil Åmdal-Sævik has an implementation to generate a submission in this format from the predictions.",
    "274291": "From what I've understood, the first entry starts at pixel number 6908 and has 1 pixel. The 2nd one starts at 7161 and has 8 pixels, so it goes from 7161 to 7168, the third one from 7417 to 7424 and so on...",
    "274503": "As mentioned in https://www.kaggle.com/c/data-science-bowl-2018/discussion/48321\n\nThis demo feels more easy to understand for newcomers. \n\nhttp://www.csfieldguide.org.nz/releases/1.9.9/_static/interactives/cc/run-length-encoding/index.html",
    "782407": "The csfieldguide link is a great one for understanding. Thanks Abner for sharing that! \nThe url is no more existent now, but I could search to find the relevant article:\nhttps://www.csfieldguide.org.nz/en/chapters/coding-compression/run-length-encoding/\nand here's the interactive:\nhttps://www.csfieldguide.org.nz/en/interactives/run-length-encoding/"
  },
  "source": "meta"
}