{
  "id": 62543,
  "title": "The same pixel may not be assigned to two different objects",
  "url": "/competitions/airbus-ship-detection/discussion/62543",
  "author_name": "",
  "post_date": "2018-08-03T01:01:30.574565Z",
  "votes": 7,
  "comment_count": 6,
  "views": 0,
  "content": "<p>Is it really necessary that pixels cannot be assigned to two different objects? In most metrics I have encountered this is not really an issue. However it will be really painful to properly separate two neighboring ships as in the case below. Most networks are simply not precise enough, it will probably involve some geometry.</p>",
  "messages": [
    {
      "id": "365586",
      "postDate": "08/03/2018 01:01:30",
      "content": "<p>Is it really necessary that pixels cannot be assigned to two different objects? In most metrics I have encountered this is not really an issue. However it will be really painful to properly separate two neighboring ships as in the case below. Most networks are simply not precise enough, it will probably involve some geometry.</p>",
      "rawMarkdown": "Is it really necessary that pixels cannot be assigned to two different objects? In most metrics I have encountered this is not really an issue. However it will be really painful to properly separate two neighboring ships as in the case below. Most networks are simply not precise enough, it will probably involve some geometry.",
      "votes": null
    },
    {
      "id": "368496",
      "postDate": "08/10/2018 02:59:33",
      "content": "<p>I encountered the the problem. Have you solved it?</p>",
      "rawMarkdown": "I encountered the the problem. Have you solved it?",
      "votes": null
    },
    {
      "id": "368735",
      "postDate": "08/10/2018 16:41:30",
      "content": "<p>I haven't found an elegant solution yet, I just do post processing where I reassign pixels which belong to multiple masks.</p>",
      "rawMarkdown": "I haven't found an elegant solution yet, I just do post processing where I reassign pixels which belong to multiple masks.",
      "votes": null
    },
    {
      "id": "391226",
      "postDate": "09/21/2018 12:42:42",
      "content": "<p>i too face the same issue...\nHow you do the post processing can you please help here..i get 5 exceptions...</p>",
      "rawMarkdown": "i too face the same issue...\nHow you do the post processing can you please help here..i get 5 exceptions...",
      "votes": null
    },
    {
      "id": "401258",
      "postDate": "10/09/2018 17:47:09",
      "content": "<p>Same here. I got 4 exceptions and just remove the overlap instances.</p>",
      "rawMarkdown": "Same here. I got 4 exceptions and just remove the overlap instances.",
      "votes": null
    },
    {
      "id": "420607",
      "postDate": "11/13/2018 22:00:08",
      "content": "<p>My quick way to find the ImageId where there is intersection.\n```\ndf = pd.read_csv('submission.csv')\nids = df.ImageId.unique().tolist()</p>\n\n<p>for i in tqdm_notebook(ids):\n    rles_list = df[df['ImageId'] == i]['EncodedPixels'].tolist()\n    if len(rles_list) &lt; 2: # no intersection if less than two ships\n        continue\n    image_list = [rle_decode(rle) for rle in rles_list]\n    if np.max(np.sum(image_list, axis=0)) &gt; 1:\n        print(i)\n```</p>\n\n<p>If the overlays are not very much you can fix manually, otherwise you can, for example, subtract the one mask from the other</p>",
      "rawMarkdown": "My quick way to find the ImageId where there is intersection.\n```\ndf = pd.read_csv('submission.csv')\nids = df.ImageId.unique().tolist()\n\nfor i in tqdm_notebook(ids):\n    rles_list = df[df['ImageId'] == i]['EncodedPixels'].tolist()\n    if len(rles_list) &lt; 2: # no intersection if less than two ships\n        continue\n    image_list = [rle_decode(rle) for rle in rles_list]\n    if np.max(np.sum(image_list, axis=0)) &gt; 1:\n        print(i)\n```\n\nIf the overlays are not very much you can fix manually, otherwise you can, for example, subtract the one mask from the other",
      "votes": null
    },
    {
      "id": "420667",
      "postDate": "11/14/2018 01:04:31",
      "content": "<p>You can consider this kernel <a href=\"https://www.kaggle.com/iafoss/remove-overlap\">https://www.kaggle.com/iafoss/remove-overlap</a>. It also fixes another problem with submission, when an image has several masks and one of them is nan.</p>",
      "rawMarkdown": "You can consider this kernel https://www.kaggle.com/iafoss/remove-overlap. It also fixes another problem with submission, when an image has several masks and one of them is nan.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 368496,
      "author_name": "zhixinzhang",
      "author_url": "",
      "post_date": "08/10/2018 02:59:33",
      "content": "<p>I encountered the the problem. Have you solved it?</p>",
      "votes": null,
      "replies": [
        {
          "id": 368735,
          "author_name": "michaelheinzer",
          "author_url": "",
          "post_date": "08/10/2018 16:41:30",
          "content": "<p>I haven't found an elegant solution yet, I just do post processing where I reassign pixels which belong to multiple masks.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 391226,
          "author_name": "jaideepvalani",
          "author_url": "",
          "post_date": "09/21/2018 12:42:42",
          "content": "<p>i too face the same issue...\nHow you do the post processing can you please help here..i get 5 exceptions...</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 420607,
          "author_name": "stepangomilko",
          "author_url": "",
          "post_date": "11/13/2018 22:00:08",
          "content": "<p>My quick way to find the ImageId where there is intersection.\n```\ndf = pd.read_csv('submission.csv')\nids = df.ImageId.unique().tolist()</p>\n\n<p>for i in tqdm_notebook(ids):\n    rles_list = df[df['ImageId'] == i]['EncodedPixels'].tolist()\n    if len(rles_list) &lt; 2: # no intersection if less than two ships\n        continue\n    image_list = [rle_decode(rle) for rle in rles_list]\n    if np.max(np.sum(image_list, axis=0)) &gt; 1:\n        print(i)\n```</p>\n\n<p>If the overlays are not very much you can fix manually, otherwise you can, for example, subtract the one mask from the other</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 401258,
      "author_name": "lingruicai",
      "author_url": "",
      "post_date": "10/09/2018 17:47:09",
      "content": "<p>Same here. I got 4 exceptions and just remove the overlap instances.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 420667,
      "author_name": "iafoss",
      "author_url": "",
      "post_date": "11/14/2018 01:04:31",
      "content": "<p>You can consider this kernel <a href=\"https://www.kaggle.com/iafoss/remove-overlap\">https://www.kaggle.com/iafoss/remove-overlap</a>. It also fixes another problem with submission, when an image has several masks and one of them is nan.</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "365586": "Is it really necessary that pixels cannot be assigned to two different objects? In most metrics I have encountered this is not really an issue. However it will be really painful to properly separate two neighboring ships as in the case below. Most networks are simply not precise enough, it will probably involve some geometry.",
    "368496": "I encountered the the problem. Have you solved it?",
    "368735": "I haven't found an elegant solution yet, I just do post processing where I reassign pixels which belong to multiple masks.",
    "391226": "i too face the same issue...\nHow you do the post processing can you please help here..i get 5 exceptions...",
    "401258": "Same here. I got 4 exceptions and just remove the overlap instances.",
    "420607": "My quick way to find the ImageId where there is intersection.\n```\ndf = pd.read_csv('submission.csv')\nids = df.ImageId.unique().tolist()\n\nfor i in tqdm_notebook(ids):\n    rles_list = df[df['ImageId'] == i]['EncodedPixels'].tolist()\n    if len(rles_list) &lt; 2: # no intersection if less than two ships\n        continue\n    image_list = [rle_decode(rle) for rle in rles_list]\n    if np.max(np.sum(image_list, axis=0)) &gt; 1:\n        print(i)\n```\n\nIf the overlays are not very much you can fix manually, otherwise you can, for example, subtract the one mask from the other",
    "420667": "You can consider this kernel https://www.kaggle.com/iafoss/remove-overlap. It also fixes another problem with submission, when an image has several masks and one of them is nan."
  },
  "source": "meta"
}