{
  "id": 279413,
  "title": "[Which reshape ?] Does RLE in this competition really follow top -> bottom, then left to right ?",
  "url": "/competitions/sartorius-cell-instance-segmentation/discussion/279413",
  "author_name": "",
  "post_date": "2021-10-18T06:56:26.917651600Z",
  "votes": 7,
  "comment_count": 1,
  "views": 0,
  "content": "<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.<br>\nThat means when you have 1D mask and you want to project onto a 2D mask, you should use: np.reshape(order='F')<br>\nHowever, all the public notebook I've seen so far, use the default np.reshape(). For example: <a href=\"https://www.kaggle.com/dschettler8845/sartorius-segmentation-eda-efficientdet-tf\" target=\"_blank\">https://www.kaggle.com/dschettler8845/sartorius-segmentation-eda-efficientdet-tf</a></p>\n<p>This notebook compares the 2 usages of reshape: <a href=\"https://www.kaggle.com/namgalielei/which-reshape-is-used-in-rle?scriptVersionId=77366414\" target=\"_blank\">https://www.kaggle.com/namgalielei/which-reshape-is-used-in-rle?scriptVersionId=77366414</a></p>\n<p>But interestingly, when I used np.reshape(order='F') the mask produced seemed wrong in this dataset</p>\n<p>Use np.reshape: <br>\n<img src=\"https://github.com/gallegi/Sartorius/blob/main/default.jpeg\" alt=\"\"></p>\n<p>Use np.reshape(order='F')<br>\n<img src=\"https://github.com/gallegi/Sartorius/blob/main/orderF.jpeg\" alt=\"\"></p>",
  "messages": [
    {
      "id": "1548343",
      "postDate": "10/18/2021 06:56:26",
      "content": "<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.<br>\nThat means when you have 1D mask and you want to project onto a 2D mask, you should use: np.reshape(order='F')<br>\nHowever, all the public notebook I've seen so far, use the default np.reshape(). For example: <a href=\"https://www.kaggle.com/dschettler8845/sartorius-segmentation-eda-efficientdet-tf\" target=\"_blank\">https://www.kaggle.com/dschettler8845/sartorius-segmentation-eda-efficientdet-tf</a></p>\n<p>This notebook compares the 2 usages of reshape: <a href=\"https://www.kaggle.com/namgalielei/which-reshape-is-used-in-rle?scriptVersionId=77366414\" target=\"_blank\">https://www.kaggle.com/namgalielei/which-reshape-is-used-in-rle?scriptVersionId=77366414</a></p>\n<p>But interestingly, when I used np.reshape(order='F') the mask produced seemed wrong in this dataset</p>\n<p>Use np.reshape: <br>\n<img src=\"https://github.com/gallegi/Sartorius/blob/main/default.jpeg\" alt=\"\"></p>\n<p>Use np.reshape(order='F')<br>\n<img src=\"https://github.com/gallegi/Sartorius/blob/main/orderF.jpeg\" alt=\"\"></p>",
      "rawMarkdown": "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.\nThat means when you have 1D mask and you want to project onto a 2D mask, you should use: np.reshape(order='F')\nHowever, all the public notebook I've seen so far, use the default np.reshape(). For example: https://www.kaggle.com/dschettler8845/sartorius-segmentation-eda-efficientdet-tf\n\n\nThis notebook compares the 2 usages of reshape: https://www.kaggle.com/namgalielei/which-reshape-is-used-in-rle?scriptVersionId=77366414\n\nBut interestingly, when I used np.reshape(order='F') the mask produced seemed wrong in this dataset\n\nUse np.reshape: \n![](https://github.com/gallegi/Sartorius/blob/main/default.jpeg)\n\nUse np.reshape(order='F')\n![](https://github.com/gallegi/Sartorius/blob/main/orderF.jpeg)",
      "votes": null
    },
    {
      "id": "1548496",
      "postDate": "10/18/2021 09:27:54",
      "content": "<p>Can you give some idea about this ? <a href=\"https://www.kaggle.com/christoffersartorius\" target=\"_blank\">@christoffersartorius</a> </p>",
      "rawMarkdown": "Can you give some idea about this ? @christoffersartorius",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1548496,
      "author_name": "namgalielei",
      "author_url": "",
      "post_date": "10/18/2021 09:27:54",
      "content": "<p>Can you give some idea about this ? <a href=\"https://www.kaggle.com/christoffersartorius\" target=\"_blank\">@christoffersartorius</a> </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1548343": "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.\nThat means when you have 1D mask and you want to project onto a 2D mask, you should use: np.reshape(order='F')\nHowever, all the public notebook I've seen so far, use the default np.reshape(). For example: https://www.kaggle.com/dschettler8845/sartorius-segmentation-eda-efficientdet-tf\n\n\nThis notebook compares the 2 usages of reshape: https://www.kaggle.com/namgalielei/which-reshape-is-used-in-rle?scriptVersionId=77366414\n\nBut interestingly, when I used np.reshape(order='F') the mask produced seemed wrong in this dataset\n\nUse np.reshape: \n![](https://github.com/gallegi/Sartorius/blob/main/default.jpeg)\n\nUse np.reshape(order='F')\n![](https://github.com/gallegi/Sartorius/blob/main/orderF.jpeg)",
    "1548496": "Can you give some idea about this ? @christoffersartorius"
  },
  "source": "meta"
}