{
  "id": 99923,
  "title": "Image shape and mask shape mismatched!",
  "url": "/competitions/open-images-2019-instance-segmentation/discussion/99923",
  "author_name": "",
  "post_date": "2019-07-15T11:44:00.752088Z",
  "votes": 2,
  "comment_count": 9,
  "views": 0,
  "content": "<p>I notice that the original image (jpg format) shape and the corresponding mask (png format) shape is different for almost all the images for train and validation set. Is it natural? or I am missing something from the data description or any important information. If this is the case in reality, how will we shape the mask for the test set?\nI really appreciate if anyone could clarify the situation. Thanks a lot in advance!</p>",
  "messages": [
    {
      "id": "575415",
      "postDate": "07/15/2019 11:44:00",
      "content": "<p>I notice that the original image (jpg format) shape and the corresponding mask (png format) shape is different for almost all the images for train and validation set. Is it natural? or I am missing something from the data description or any important information. If this is the case in reality, how will we shape the mask for the test set?\nI really appreciate if anyone could clarify the situation. Thanks a lot in advance!</p>",
      "rawMarkdown": "I notice that the original image (jpg format) shape and the corresponding mask (png format) shape is different for almost all the images for train and validation set. Is it natural? or I am missing something from the data description or any important information. If this is the case in reality, how will we shape the mask for the test set?\nI really appreciate if anyone could clarify the situation. Thanks a lot in advance!",
      "votes": null
    },
    {
      "id": "576815",
      "postDate": "07/16/2019 03:56:26",
      "content": "<p>I think the submitted binary mask should of the same resolution as the input test set image</p>",
      "rawMarkdown": "I think the submitted binary mask should of the same resolution as the input test set image",
      "votes": null
    },
    {
      "id": "580015",
      "postDate": "07/19/2019 14:46:17",
      "content": "<p>Thanks MAK for reporting this issue.\nWe have inspected the data and we can confirm we have found an mismatch regarding images &lt;-&gt; masks resolution.</p>\n\n<p>Regarding the training data, resizing the masks (down) to match the image sizes should provide the desired ground-truth.</p>\n\n<p>Regarding the submission masks, this relates to <a href=\"https://www.kaggle.com/c/open-images-2019-instance-segmentation/discussion/100595\">the issue reported on this parallel thread</a>. As indicated there, we are working on a solution that we expect to deploy early next week.</p>\n\n<p>In the mean-time, as indicated by DavidFan, you should work towards preparing submission files where the detection binary masks have the same resolution as the input test set image.</p>",
      "rawMarkdown": "Thanks MAK for reporting this issue.\nWe have inspected the data and we can confirm we have found an mismatch regarding images &lt;-&gt; masks resolution.\n\nRegarding the training data, resizing the masks (down) to match the image sizes should provide the desired ground-truth.\n\nRegarding the submission masks, this relates to [the issue reported on this parallel thread](https://www.kaggle.com/c/open-images-2019-instance-segmentation/discussion/100595). As indicated there, we are working on a solution that we expect to deploy early next week.\n\nIn the mean-time, as indicated by DavidFan, you should work towards preparing submission files where the detection binary masks have the same resolution as the input test set image.",
      "votes": null
    },
    {
      "id": "582109",
      "postDate": "07/22/2019 18:27:04",
      "content": "<p>For information <a href=\"https://www.kaggle.com/c/open-images-2019-instance-segmentation/discussion/100595\">the issue</a> has been solved, and the <a href=\"https://www.kaggle.com/c/open-images-2019-instance-segmentation/leaderboard\">leaderboard</a> updated.</p>\n\n<p>As long as in the submission csv file the detection binary masks have the same resolution as the corresponding input test set image, the results will (now) be scored correctly.</p>",
      "rawMarkdown": "For information [the issue](https://www.kaggle.com/c/open-images-2019-instance-segmentation/discussion/100595) has been solved, and the [leaderboard](https://www.kaggle.com/c/open-images-2019-instance-segmentation/leaderboard) updated.\n\nAs long as in the submission csv file the detection binary masks have the same resolution as the corresponding input test set image, the results will (now) be scored correctly.",
      "votes": null
    },
    {
      "id": "582425",
      "postDate": "07/23/2019 07:07:11",
      "content": "<p>Thank you for the update <a href=\"/benenson\">@benenson</a> </p>",
      "rawMarkdown": "Thank you for the update @benenson",
      "votes": null
    },
    {
      "id": "582426",
      "postDate": "07/23/2019 07:07:43",
      "content": "<p>Thanks a lot!👍 </p>",
      "rawMarkdown": "Thanks a lot!👍",
      "votes": null
    },
    {
      "id": "592481",
      "postDate": "08/05/2019 11:11:53",
      "content": "<p><a href=\"/benenson\">@benenson</a> Could you please confirm the following code snippet is correct for resizing the mask (down). Thnx a lot in advance.\n<code>\nh, w = img_h, img_w // original training image wrt given mask\nx1, y1, x2, y2 = BoxXMin*w, BoxYMin*h, BoxXMax*w, BoxYMax*h //from challenge-2019-segmentation-masks.csv file\n</code></p>",
      "rawMarkdown": "benenson Could you please confirm the following code snippet is correct for resizing the mask (down). Thnx a lot in advance.\n```\nh, w = img_h, img_w // original training image wrt given mask\nx1, y1, x2, y2 = BoxXMin*w, BoxYMin*h, BoxXMax*w, BoxYMax*h //from challenge-2019-segmentation-masks.csv file\n```",
      "votes": null
    },
    {
      "id": "592508",
      "postDate": "08/05/2019 12:00:36",
      "content": "<p>Any generic image resizing function would do; such as <a href=\"https://scikit-image.org/docs/dev/api/skimage.transform.html#skimage.transform.resize\"><code>skimage.transform.resize(..., anti_aliasing=True)</code></a>.</p>",
      "rawMarkdown": "Any generic image resizing function would do; such as [`skimage.transform.resize(..., anti_aliasing=True)`](https://scikit-image.org/docs/dev/api/skimage.transform.html#skimage.transform.resize).",
      "votes": null
    },
    {
      "id": "592512",
      "postDate": "08/05/2019 12:04:39",
      "content": "<p>So, we just need to resize the mask, e.g., cv2.resize(...), to the original image size. Thank you.</p>",
      "rawMarkdown": "So, we just need to resize the mask, e.g., cv2.resize(...), to the original image size. Thank you.",
      "votes": null
    },
    {
      "id": "592747",
      "postDate": "08/05/2019 19:01:16",
      "content": "<blockquote>\n  <p>So, we just need to resize the mask to the original image size\n  Exactly.</p>\n</blockquote>\n\n<p>The only two things to take care when shrinking the masks are aliasing effects, and making sure the result is binary (if your pipeline expects binary masks).</p>",
      "rawMarkdown": "&gt; So, we just need to resize the mask to the original image size\nExactly.\n\nThe only two things to take care when shrinking the masks are aliasing effects, and making sure the result is binary (if your pipeline expects binary masks).",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 576815,
      "author_name": "dfan97",
      "author_url": "",
      "post_date": "07/16/2019 03:56:26",
      "content": "<p>I think the submitted binary mask should of the same resolution as the input test set image</p>",
      "votes": null,
      "replies": [
        {
          "id": 582426,
          "author_name": "muhammedazamkhan",
          "author_url": "",
          "post_date": "07/23/2019 07:07:43",
          "content": "<p>Thanks a lot!👍 </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 580015,
      "author_name": "benenson",
      "author_url": "",
      "post_date": "07/19/2019 14:46:17",
      "content": "<p>Thanks MAK for reporting this issue.\nWe have inspected the data and we can confirm we have found an mismatch regarding images &lt;-&gt; masks resolution.</p>\n\n<p>Regarding the training data, resizing the masks (down) to match the image sizes should provide the desired ground-truth.</p>\n\n<p>Regarding the submission masks, this relates to <a href=\"https://www.kaggle.com/c/open-images-2019-instance-segmentation/discussion/100595\">the issue reported on this parallel thread</a>. As indicated there, we are working on a solution that we expect to deploy early next week.</p>\n\n<p>In the mean-time, as indicated by DavidFan, you should work towards preparing submission files where the detection binary masks have the same resolution as the input test set image.</p>",
      "votes": null,
      "replies": [
        {
          "id": 592481,
          "author_name": "muhammedazamkhan",
          "author_url": "",
          "post_date": "08/05/2019 11:11:53",
          "content": "<p><a href=\"/benenson\">@benenson</a> Could you please confirm the following code snippet is correct for resizing the mask (down). Thnx a lot in advance.\n<code>\nh, w = img_h, img_w // original training image wrt given mask\nx1, y1, x2, y2 = BoxXMin*w, BoxYMin*h, BoxXMax*w, BoxYMax*h //from challenge-2019-segmentation-masks.csv file\n</code></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 592508,
          "author_name": "benenson",
          "author_url": "",
          "post_date": "08/05/2019 12:00:36",
          "content": "<p>Any generic image resizing function would do; such as <a href=\"https://scikit-image.org/docs/dev/api/skimage.transform.html#skimage.transform.resize\"><code>skimage.transform.resize(..., anti_aliasing=True)</code></a>.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 592512,
          "author_name": "muhammedazamkhan",
          "author_url": "",
          "post_date": "08/05/2019 12:04:39",
          "content": "<p>So, we just need to resize the mask, e.g., cv2.resize(...), to the original image size. Thank you.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 592747,
          "author_name": "rodrigob",
          "author_url": "",
          "post_date": "08/05/2019 19:01:16",
          "content": "<blockquote>\n  <p>So, we just need to resize the mask to the original image size\n  Exactly.</p>\n</blockquote>\n\n<p>The only two things to take care when shrinking the masks are aliasing effects, and making sure the result is binary (if your pipeline expects binary masks).</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 582109,
      "author_name": "benenson",
      "author_url": "",
      "post_date": "07/22/2019 18:27:04",
      "content": "<p>For information <a href=\"https://www.kaggle.com/c/open-images-2019-instance-segmentation/discussion/100595\">the issue</a> has been solved, and the <a href=\"https://www.kaggle.com/c/open-images-2019-instance-segmentation/leaderboard\">leaderboard</a> updated.</p>\n\n<p>As long as in the submission csv file the detection binary masks have the same resolution as the corresponding input test set image, the results will (now) be scored correctly.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 582425,
      "author_name": "muhammedazamkhan",
      "author_url": "",
      "post_date": "07/23/2019 07:07:11",
      "content": "<p>Thank you for the update <a href=\"/benenson\">@benenson</a> </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "575415": "I notice that the original image (jpg format) shape and the corresponding mask (png format) shape is different for almost all the images for train and validation set. Is it natural? or I am missing something from the data description or any important information. If this is the case in reality, how will we shape the mask for the test set?\nI really appreciate if anyone could clarify the situation. Thanks a lot in advance!",
    "576815": "I think the submitted binary mask should of the same resolution as the input test set image",
    "580015": "Thanks MAK for reporting this issue.\nWe have inspected the data and we can confirm we have found an mismatch regarding images &lt;-&gt; masks resolution.\n\nRegarding the training data, resizing the masks (down) to match the image sizes should provide the desired ground-truth.\n\nRegarding the submission masks, this relates to [the issue reported on this parallel thread](https://www.kaggle.com/c/open-images-2019-instance-segmentation/discussion/100595). As indicated there, we are working on a solution that we expect to deploy early next week.\n\nIn the mean-time, as indicated by DavidFan, you should work towards preparing submission files where the detection binary masks have the same resolution as the input test set image.",
    "582109": "For information [the issue](https://www.kaggle.com/c/open-images-2019-instance-segmentation/discussion/100595) has been solved, and the [leaderboard](https://www.kaggle.com/c/open-images-2019-instance-segmentation/leaderboard) updated.\n\nAs long as in the submission csv file the detection binary masks have the same resolution as the corresponding input test set image, the results will (now) be scored correctly.",
    "582425": "Thank you for the update @benenson",
    "582426": "Thanks a lot!👍",
    "592481": "benenson Could you please confirm the following code snippet is correct for resizing the mask (down). Thnx a lot in advance.\n```\nh, w = img_h, img_w // original training image wrt given mask\nx1, y1, x2, y2 = BoxXMin*w, BoxYMin*h, BoxXMax*w, BoxYMax*h //from challenge-2019-segmentation-masks.csv file\n```",
    "592508": "Any generic image resizing function would do; such as [`skimage.transform.resize(..., anti_aliasing=True)`](https://scikit-image.org/docs/dev/api/skimage.transform.html#skimage.transform.resize).",
    "592512": "So, we just need to resize the mask, e.g., cv2.resize(...), to the original image size. Thank you.",
    "592747": "&gt; So, we just need to resize the mask to the original image size\nExactly.\n\nThe only two things to take care when shrinking the masks are aliasing effects, and making sure the result is binary (if your pipeline expects binary masks)."
  },
  "source": "meta"
}