{
  "id": 280137,
  "title": "Tutorial: detectron 2",
  "url": "/competitions/sartorius-cell-instance-segmentation/discussion/280137",
  "author_name": "",
  "post_date": "2021-10-20T16:45:01.647794500Z",
  "votes": 83,
  "comment_count": 9,
  "views": 0,
  "content": "<p>I've created a three part end-to-end tutorial using the <a href=\"https://github.com/facebookresearch/detectron2\" target=\"_blank\">detectron</a> library that gives .217 LB score. It was more difficult to get a working baseline than in other competitions I've seen so far, but in the end I arrived with a quite short and clean solution, after I figured out how to use the tools.</p>\n<p>Here are the main things I stumbled upon and tips to overcome them:</p>\n<ul>\n<li>Dealing with masks can be tricky, I've encounterd few slightly different definitions of RLE, and it took me a while to debug that the one used in this competiotion is different than the one in the COCO dataset. It got me paranoid enough that I started displaying outputs on every step, but once I got all the annotations in the COCO json format the rest became much easier. I'm sharing the dataset so others can take adventage of it.</li>\n<li>The actual training of a basic model was simple to do. I followed the official tutorial: <a href=\"https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5\" target=\"_blank\">https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5</a> and it just worked. I'm not sure how hard it will be to further improve and optimize but getting an initial solution was easy.</li>\n<li>It took me more than I have expected to get all the detectron dependencies work in the offline inference notebook. Maybe it's basic to others but I haven't done it before and had to experiment with diffent pip download and pip install incantations. Again I'm sharing the dataset so you can just use it.</li>\n</ul>\n<p>Resources:</p>\n<ul>\n<li>Notebooks: <a href=\"https://www.kaggle.com/slawekbiel/positive-score-with-detectron-1-3-input-data\" target=\"_blank\">Part 1</a> <a href=\"https://www.kaggle.com/slawekbiel/positive-score-with-detectron-2-3-training\" target=\"_blank\">Part 2</a> <a href=\"https://www.kaggle.com/slawekbiel/positive-score-with-detectron-3-3-inference\" target=\"_blank\">Part 3</a></li>\n<li>Annotations in the COCO format: <a href=\"https://www.kaggle.com/slawekbiel/sartorius-cell-instance-segmentation-coco\" target=\"_blank\">https://www.kaggle.com/slawekbiel/sartorius-cell-instance-segmentation-coco</a></li>\n<li>Detectron library: <a href=\"https://www.kaggle.com/slawekbiel/detectron-05\" target=\"_blank\">https://www.kaggle.com/slawekbiel/detectron-05</a></li>\n<li>Trained Mask RCNN weights: <a href=\"https://www.kaggle.com/slawekbiel/sartorius-models\" target=\"_blank\">https://www.kaggle.com/slawekbiel/sartorius-models</a></li>\n</ul>",
  "messages": [
    {
      "id": "1551473",
      "postDate": "10/20/2021 16:45:01",
      "content": "<p>I've created a three part end-to-end tutorial using the <a href=\"https://github.com/facebookresearch/detectron2\" target=\"_blank\">detectron</a> library that gives .217 LB score. It was more difficult to get a working baseline than in other competitions I've seen so far, but in the end I arrived with a quite short and clean solution, after I figured out how to use the tools.</p>\n<p>Here are the main things I stumbled upon and tips to overcome them:</p>\n<ul>\n<li>Dealing with masks can be tricky, I've encounterd few slightly different definitions of RLE, and it took me a while to debug that the one used in this competiotion is different than the one in the COCO dataset. It got me paranoid enough that I started displaying outputs on every step, but once I got all the annotations in the COCO json format the rest became much easier. I'm sharing the dataset so others can take adventage of it.</li>\n<li>The actual training of a basic model was simple to do. I followed the official tutorial: <a href=\"https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5\" target=\"_blank\">https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5</a> and it just worked. I'm not sure how hard it will be to further improve and optimize but getting an initial solution was easy.</li>\n<li>It took me more than I have expected to get all the detectron dependencies work in the offline inference notebook. Maybe it's basic to others but I haven't done it before and had to experiment with diffent pip download and pip install incantations. Again I'm sharing the dataset so you can just use it.</li>\n</ul>\n<p>Resources:</p>\n<ul>\n<li>Notebooks: <a href=\"https://www.kaggle.com/slawekbiel/positive-score-with-detectron-1-3-input-data\" target=\"_blank\">Part 1</a> <a href=\"https://www.kaggle.com/slawekbiel/positive-score-with-detectron-2-3-training\" target=\"_blank\">Part 2</a> <a href=\"https://www.kaggle.com/slawekbiel/positive-score-with-detectron-3-3-inference\" target=\"_blank\">Part 3</a></li>\n<li>Annotations in the COCO format: <a href=\"https://www.kaggle.com/slawekbiel/sartorius-cell-instance-segmentation-coco\" target=\"_blank\">https://www.kaggle.com/slawekbiel/sartorius-cell-instance-segmentation-coco</a></li>\n<li>Detectron library: <a href=\"https://www.kaggle.com/slawekbiel/detectron-05\" target=\"_blank\">https://www.kaggle.com/slawekbiel/detectron-05</a></li>\n<li>Trained Mask RCNN weights: <a href=\"https://www.kaggle.com/slawekbiel/sartorius-models\" target=\"_blank\">https://www.kaggle.com/slawekbiel/sartorius-models</a></li>\n</ul>",
      "rawMarkdown": "I've created a three part end-to-end tutorial using the [detectron](https://github.com/facebookresearch/detectron2) library that gives .217 LB score. It was more difficult to get a working baseline than in other competitions I've seen so far, but in the end I arrived with a quite short and clean solution, after I figured out how to use the tools.\n\nHere are the main things I stumbled upon and tips to overcome them:\n- Dealing with masks can be tricky, I've encounterd few slightly different definitions of RLE, and it took me a while to debug that the one used in this competiotion is different than the one in the COCO dataset. It got me paranoid enough that I started displaying outputs on every step, but once I got all the annotations in the COCO json format the rest became much easier. I'm sharing the dataset so others can take adventage of it.\n- The actual training of a basic model was simple to do. I followed the official tutorial: https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5 and it just worked. I'm not sure how hard it will be to further improve and optimize but getting an initial solution was easy.\n- It took me more than I have expected to get all the detectron dependencies work in the offline inference notebook. Maybe it's basic to others but I haven't done it before and had to experiment with diffent pip download and pip install incantations. Again I'm sharing the dataset so you can just use it.\n\n\nResources:\n- Notebooks: [Part 1](https://www.kaggle.com/slawekbiel/positive-score-with-detectron-1-3-input-data) [Part 2](https://www.kaggle.com/slawekbiel/positive-score-with-detectron-2-3-training) [Part 3](https://www.kaggle.com/slawekbiel/positive-score-with-detectron-3-3-inference)\n- Annotations in the COCO format: https://www.kaggle.com/slawekbiel/sartorius-cell-instance-segmentation-coco\n- Detectron library: https://www.kaggle.com/slawekbiel/detectron-05\n- Trained Mask RCNN weights: https://www.kaggle.com/slawekbiel/sartorius-models",
      "votes": null
    },
    {
      "id": "1553307",
      "postDate": "10/22/2021 04:40:57",
      "content": "<p>great work. nice sharing.</p>",
      "rawMarkdown": "great work. nice sharing.",
      "votes": null
    },
    {
      "id": "1554398",
      "postDate": "10/23/2021 04:09:02",
      "content": "<p>nice work. Thanks</p>",
      "rawMarkdown": "nice work. Thanks",
      "votes": null
    },
    {
      "id": "1559426",
      "postDate": "10/27/2021 01:51:59",
      "content": "<p>great work, thanks for sharing</p>",
      "rawMarkdown": "great work, thanks for sharing",
      "votes": null
    },
    {
      "id": "1591738",
      "postDate": "11/22/2021 15:24:06",
      "content": "<p>amazing work!</p>",
      "rawMarkdown": "amazing work!",
      "votes": null
    },
    {
      "id": "1631639",
      "postDate": "12/28/2021 16:26:08",
      "content": "<p>hey :) can you please share how to get all the detectron dependencies work?</p>",
      "rawMarkdown": "hey :) can you please share how to get all the detectron dependencies work?",
      "votes": null
    },
    {
      "id": "1631731",
      "postDate": "12/28/2021 18:11:13",
      "content": "<p>See the notebooks I linked.<br>\n “Part 3” does the offline installation.</p>",
      "rawMarkdown": "See the notebooks I linked.\n “Part 3” does the offline installation.",
      "votes": null
    },
    {
      "id": "1633015",
      "postDate": "12/30/2021 10:20:45",
      "content": "<p>Good work!</p>",
      "rawMarkdown": "Good work!",
      "votes": null
    },
    {
      "id": "1633069",
      "postDate": "12/30/2021 11:33:58",
      "content": "<p>thanks! i tried this code on my notebook and always get <br>\n\"  error: could not create 'build': Read-only file system</p>\n<hr>\n<p>ERROR: Failed building wheel for fvcore \"</p>\n<p>same for  antlr4-python3-runtime</p>\n<p>have any idea how to make it work?</p>",
      "rawMarkdown": "thanks! i tried this code on my notebook and always get \n\"  error: could not create 'build': Read-only file system\n  ----------------------------------------\n  ERROR: Failed building wheel for fvcore \"\n\n\nsame for  antlr4-python3-runtime\n\nhave any idea how to make it work?",
      "votes": null
    },
    {
      "id": "2942614",
      "postDate": "08/01/2024 00:28:26",
      "content": "<p>thank you, very good</p>",
      "rawMarkdown": "thank you, very good",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1553307,
      "author_name": "dragonzhang",
      "author_url": "",
      "post_date": "10/22/2021 04:40:57",
      "content": "<p>great work. nice sharing.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1554398,
      "author_name": "namgalielei",
      "author_url": "",
      "post_date": "10/23/2021 04:09:02",
      "content": "<p>nice work. Thanks</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1559426,
      "author_name": "ramu199531",
      "author_url": "",
      "post_date": "10/27/2021 01:51:59",
      "content": "<p>great work, thanks for sharing</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1591738,
      "author_name": "ccvipchenbin",
      "author_url": "",
      "post_date": "11/22/2021 15:24:06",
      "content": "<p>amazing work!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1631639,
      "author_name": "orlevy11",
      "author_url": "",
      "post_date": "12/28/2021 16:26:08",
      "content": "<p>hey :) can you please share how to get all the detectron dependencies work?</p>",
      "votes": null,
      "replies": [
        {
          "id": 1631731,
          "author_name": "slawekbiel",
          "author_url": "",
          "post_date": "12/28/2021 18:11:13",
          "content": "<p>See the notebooks I linked.<br>\n “Part 3” does the offline installation.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 1633069,
          "author_name": "orlevy11",
          "author_url": "",
          "post_date": "12/30/2021 11:33:58",
          "content": "<p>thanks! i tried this code on my notebook and always get <br>\n\"  error: could not create 'build': Read-only file system</p>\n<hr>\n<p>ERROR: Failed building wheel for fvcore \"</p>\n<p>same for  antlr4-python3-runtime</p>\n<p>have any idea how to make it work?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 1633015,
      "author_name": "towhidultonmoy",
      "author_url": "",
      "post_date": "12/30/2021 10:20:45",
      "content": "<p>Good work!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2942614,
      "author_name": "liuweiq",
      "author_url": "",
      "post_date": "08/01/2024 00:28:26",
      "content": "<p>thank you, very good</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1551473": "I've created a three part end-to-end tutorial using the [detectron](https://github.com/facebookresearch/detectron2) library that gives .217 LB score. It was more difficult to get a working baseline than in other competitions I've seen so far, but in the end I arrived with a quite short and clean solution, after I figured out how to use the tools.\n\nHere are the main things I stumbled upon and tips to overcome them:\n- Dealing with masks can be tricky, I've encounterd few slightly different definitions of RLE, and it took me a while to debug that the one used in this competiotion is different than the one in the COCO dataset. It got me paranoid enough that I started displaying outputs on every step, but once I got all the annotations in the COCO json format the rest became much easier. I'm sharing the dataset so others can take adventage of it.\n- The actual training of a basic model was simple to do. I followed the official tutorial: https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5 and it just worked. I'm not sure how hard it will be to further improve and optimize but getting an initial solution was easy.\n- It took me more than I have expected to get all the detectron dependencies work in the offline inference notebook. Maybe it's basic to others but I haven't done it before and had to experiment with diffent pip download and pip install incantations. Again I'm sharing the dataset so you can just use it.\n\n\nResources:\n- Notebooks: [Part 1](https://www.kaggle.com/slawekbiel/positive-score-with-detectron-1-3-input-data) [Part 2](https://www.kaggle.com/slawekbiel/positive-score-with-detectron-2-3-training) [Part 3](https://www.kaggle.com/slawekbiel/positive-score-with-detectron-3-3-inference)\n- Annotations in the COCO format: https://www.kaggle.com/slawekbiel/sartorius-cell-instance-segmentation-coco\n- Detectron library: https://www.kaggle.com/slawekbiel/detectron-05\n- Trained Mask RCNN weights: https://www.kaggle.com/slawekbiel/sartorius-models",
    "1553307": "great work. nice sharing.",
    "1554398": "nice work. Thanks",
    "1559426": "great work, thanks for sharing",
    "1591738": "amazing work!",
    "1631639": "hey :) can you please share how to get all the detectron dependencies work?",
    "1631731": "See the notebooks I linked.\n “Part 3” does the offline installation.",
    "1633015": "Good work!",
    "1633069": "thanks! i tried this code on my notebook and always get \n\"  error: could not create 'build': Read-only file system\n  ----------------------------------------\n  ERROR: Failed building wheel for fvcore \"\n\n\nsame for  antlr4-python3-runtime\n\nhave any idea how to make it work?",
    "2942614": "thank you, very good"
  },
  "source": "meta"
}