{
  "id": 471808,
  "title": "Mask size impact on RLE",
  "url": "/competitions/blood-vessel-segmentation/discussion/471808",
  "author_name": "",
  "post_date": "2024-01-29T17:33:53.262046900Z",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hi all, This is just a general question. During inference we have to submit the RLE of the mask. I am wondering just the mask shape predicted by the model has an impact on the RLE. Say, if my model gives mask of shape <code>(8, 1, 512, 512)</code> and generated the RLE, will this RLE be same when, say, the model outputs of shape <code>(8, 1, 1024, 1024)</code>. </p>\n<p>If that is the case, what do we do in that case?</p>\n<p>Thanks</p>",
  "messages": [
    {
      "id": "2625912",
      "postDate": "01/29/2024 17:33:53",
      "content": "<p>Hi all, This is just a general question. During inference we have to submit the RLE of the mask. I am wondering just the mask shape predicted by the model has an impact on the RLE. Say, if my model gives mask of shape <code>(8, 1, 512, 512)</code> and generated the RLE, will this RLE be same when, say, the model outputs of shape <code>(8, 1, 1024, 1024)</code>. </p>\n<p>If that is the case, what do we do in that case?</p>\n<p>Thanks</p>",
      "rawMarkdown": "Hi all, This is just a general question. During inference we have to submit the RLE of the mask. I am wondering just the mask shape predicted by the model has an impact on the RLE. Say, if my model gives mask of shape `(8, 1, 512, 512)` and generated the RLE, will this RLE be same when, say, the model outputs of shape `(8, 1, 1024, 1024)`. \n\nIf that is the case, what do we do in that case?\n\nThanks",
      "votes": null
    },
    {
      "id": "2626069",
      "postDate": "01/29/2024 19:03:39",
      "content": "<p>The rle is applyed to flatten pixels. So yes, it will change with different shapes. You need to redimension your masks to what is spected, the initial input shapes.<br>\nAnd also your examples includes batch size, the rle should be applyed to each individual input slice (each of the test *.tif files).</p>",
      "rawMarkdown": "The rle is applyed to flatten pixels. So yes, it will change with different shapes. You need to redimension your masks to what is spected, the initial input shapes.\nAnd also your examples includes batch size, the rle should be applyed to each individual input slice (each of the test *.tif files).",
      "votes": null
    },
    {
      "id": "2626098",
      "postDate": "01/29/2024 19:26:28",
      "content": "<p><code>You need to redimension your masks to what is spected, the initial input shapes.</code><br>\nBut how will you know the dimension to which it is to be change to? Let's say I model with all the resized image size of (512 x 512) and also the masks of shape (512 x 512). Then what should be change? Can you elaborate this. Didn't get the idea.</p>",
      "rawMarkdown": "`You need to redimension your masks to what is spected, the initial input shapes.`\nBut how will you know the dimension to which it is to be change to? Let's say I model with all the resized image size of (512 x 512) and also the masks of shape (512 x 512). Then what should be change? Can you elaborate this. Didn't get the idea.",
      "votes": null
    },
    {
      "id": "2626112",
      "postDate": "01/29/2024 19:30:26",
      "content": "<p>The input original shapes. Let's say you read example.tif from test folder. And that image is 1300x900, you preprocess that input because your model needs another input shape, ok. And als outputs another shape, also ok. Then redimension the obtained mask to the original 1300x900.</p>",
      "rawMarkdown": "The input original shapes. Let's say you read example.tif from test folder. And that image is 1300x900, you preprocess that input because your model needs another input shape, ok. And als outputs another shape, also ok. Then redimension the obtained mask to the original 1300x900.",
      "votes": null
    },
    {
      "id": "2626154",
      "postDate": "01/29/2024 19:53:36",
      "content": "<p>ok got it. Thanks for the clarification.</p>",
      "rawMarkdown": "ok got it. Thanks for the clarification.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2626069,
      "author_name": "sacuscreed",
      "author_url": "",
      "post_date": "01/29/2024 19:03:39",
      "content": "<p>The rle is applyed to flatten pixels. So yes, it will change with different shapes. You need to redimension your masks to what is spected, the initial input shapes.<br>\nAnd also your examples includes batch size, the rle should be applyed to each individual input slice (each of the test *.tif files).</p>",
      "votes": null,
      "replies": [
        {
          "id": 2626098,
          "author_name": "pritamsinha23",
          "author_url": "",
          "post_date": "01/29/2024 19:26:28",
          "content": "<p><code>You need to redimension your masks to what is spected, the initial input shapes.</code><br>\nBut how will you know the dimension to which it is to be change to? Let's say I model with all the resized image size of (512 x 512) and also the masks of shape (512 x 512). Then what should be change? Can you elaborate this. Didn't get the idea.</p>",
          "votes": null,
          "replies": [
            {
              "id": 2626112,
              "author_name": "sacuscreed",
              "author_url": "",
              "post_date": "01/29/2024 19:30:26",
              "content": "<p>The input original shapes. Let's say you read example.tif from test folder. And that image is 1300x900, you preprocess that input because your model needs another input shape, ok. And als outputs another shape, also ok. Then redimension the obtained mask to the original 1300x900.</p>",
              "votes": null,
              "replies": [
                {
                  "id": 2626154,
                  "author_name": "pritamsinha23",
                  "author_url": "",
                  "post_date": "01/29/2024 19:53:36",
                  "content": "<p>ok got it. Thanks for the clarification.</p>",
                  "votes": null,
                  "replies": []
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2625912": "Hi all, This is just a general question. During inference we have to submit the RLE of the mask. I am wondering just the mask shape predicted by the model has an impact on the RLE. Say, if my model gives mask of shape `(8, 1, 512, 512)` and generated the RLE, will this RLE be same when, say, the model outputs of shape `(8, 1, 1024, 1024)`. \n\nIf that is the case, what do we do in that case?\n\nThanks",
    "2626069": "The rle is applyed to flatten pixels. So yes, it will change with different shapes. You need to redimension your masks to what is spected, the initial input shapes.\nAnd also your examples includes batch size, the rle should be applyed to each individual input slice (each of the test *.tif files).",
    "2626098": "`You need to redimension your masks to what is spected, the initial input shapes.`\nBut how will you know the dimension to which it is to be change to? Let's say I model with all the resized image size of (512 x 512) and also the masks of shape (512 x 512). Then what should be change? Can you elaborate this. Didn't get the idea.",
    "2626112": "The input original shapes. Let's say you read example.tif from test folder. And that image is 1300x900, you preprocess that input because your model needs another input shape, ok. And als outputs another shape, also ok. Then redimension the obtained mask to the original 1300x900.",
    "2626154": "ok got it. Thanks for the clarification."
  },
  "source": "meta"
}