{
  "id": 53495,
  "title": "Image augmentation in matterport's mask_rcnn.",
  "url": "/competitions/data-science-bowl-2018/discussion/53495",
  "author_name": "",
  "post_date": "2018-03-31T13:35:00.959784200Z",
  "votes": 13,
  "comment_count": 22,
  "views": 0,
  "content": "<p>Hi All,</p>\n\n<p>Matterport already implement image augmentation in <strong>train()</strong>.</p>\n\n<p>You can check the latest version <a href=\"https://github.com/matterport/Mask_RCNN/blob/dffcb6110184707c28e80879ac8c70f7ebf6dcfe/model.py#L2210\">here</a>.</p>\n\n<p>And the sample code is shown below:</p>\n\n<pre><code>import imgaug  # https://github.com/aleju/imgaug (pip3 install imageaug)\naugmentation = imgaug.augmenters.Fliplr(0.5)\nmodel.train(dataset_train, dataset_val,\n                     learning_rate=config.LEARNING_RATE,\n                     epochs=40,\n                     layers='heads',\n                     augmentation=augmentation)\n</code></pre>",
  "messages": [
    {
      "id": "306981",
      "postDate": "03/31/2018 13:35:00",
      "content": "<p>Hi All,</p>\n\n<p>Matterport already implement image augmentation in <strong>train()</strong>.</p>\n\n<p>You can check the latest version <a href=\"https://github.com/matterport/Mask_RCNN/blob/dffcb6110184707c28e80879ac8c70f7ebf6dcfe/model.py#L2210\">here</a>.</p>\n\n<p>And the sample code is shown below:</p>\n\n<pre><code>import imgaug  # https://github.com/aleju/imgaug (pip3 install imageaug)\naugmentation = imgaug.augmenters.Fliplr(0.5)\nmodel.train(dataset_train, dataset_val,\n                     learning_rate=config.LEARNING_RATE,\n                     epochs=40,\n                     layers='heads',\n                     augmentation=augmentation)\n</code></pre>",
      "rawMarkdown": "Hi All,\n\nMatterport already implement image augmentation in **train()**.\n\nYou can check the latest version [here][1].\n\nAnd the sample code is shown below:\n\n    import imgaug  # https://github.com/aleju/imgaug (pip3 install imageaug)\n    augmentation = imgaug.augmenters.Fliplr(0.5)\n    model.train(dataset_train, dataset_val,\n                         learning_rate=config.LEARNING_RATE,\n                         epochs=40,\n                         layers='heads',\n                         augmentation=augmentation)\n\n  [1]: https://github.com/matterport/Mask_RCNN/blob/dffcb6110184707c28e80879ac8c70f7ebf6dcfe/model.py#L2210",
      "votes": null
    },
    {
      "id": "307106",
      "postDate": "03/31/2018 20:16:48",
      "content": "<p>@IAmLegend, Awesome! thanks for sharing . I am just trying it out.  Will let you know if it improves results.\nAlso in the new version resnet50 and resnet101 can be passed via config. \nIn the old version resnet101 was hard-coded. I put resnet50 in config but it was not doing anything (my bad!)\nI wasted a week on resnet50 but i finally found resnet101 is giving me better results than resnet50</p>",
      "rawMarkdown": "IAmLegend, Awesome! thanks for sharing . I am just trying it out.  Will let you know if it improves results.\nAlso in the new version resnet50 and resnet101 can be passed via config. \nIn the old version resnet101 was hard-coded. I put resnet50 in config but it was not doing anything (my bad!)\nI wasted a week on resnet50 but i finally found resnet101 is giving me better results than resnet50",
      "votes": null
    },
    {
      "id": "307107",
      "postDate": "03/31/2018 20:17:44",
      "content": "<p>@IAmLegend one question. did you figure out how to do multiple transforms. so for example rotation + translation ? </p>",
      "rawMarkdown": "IAmLegend one question. did you figure out how to do multiple transforms. so for example rotation + translation ?",
      "votes": null
    },
    {
      "id": "307211",
      "postDate": "04/01/2018 04:58:59",
      "content": "<p>@IAmLegend, when i try to run with \"augmentation = imgaug.augmenters.Fliplr(0.5)\" I get the following issue on K80: \"Floating point exception(core dumped)\"; did the new augmentation work for you ? </p>",
      "rawMarkdown": "IAmLegend, when i try to run with \"augmentation = imgaug.augmenters.Fliplr(0.5)\" I get the following issue on K80: \"Floating point exception(core dumped)\"; did the new augmentation work for you ?",
      "votes": null
    },
    {
      "id": "307221",
      "postDate": "04/01/2018 05:31:46",
      "content": "<p>Sorry for the spam! I figured out that new image augmentation from imgaug works if we use USE_MINI_MASK = False. \nI will write to Waleed about the bug in the matterport implementation; and ask him why it causes core-dump sometimes. </p>\n\n<p>Lastly, the full list of augmentations can be found here:\n<a href=\"http://imgaug.readthedocs.io/en/latest/source/augmenters.html\">http://imgaug.readthedocs.io/en/latest/source/augmenters.html</a></p>",
      "rawMarkdown": "Sorry for the spam! I figured out that new image augmentation from imgaug works if we use USE_MINI_MASK = False. \nI will write to Waleed about the bug in the matterport implementation; and ask him why it causes core-dump sometimes. \n\nLastly, the full list of augmentations can be found here:\nhttp://imgaug.readthedocs.io/en/latest/source/augmenters.html",
      "votes": null
    },
    {
      "id": "307253",
      "postDate": "04/01/2018 07:25:13",
      "content": "<p>so great, how do you find that?</p>",
      "rawMarkdown": "so great, how do you find that?",
      "votes": null
    },
    {
      "id": "307258",
      "postDate": "04/01/2018 07:43:13",
      "content": "<p>Thanks @ZhengLi. I was just debugging the code and found it. </p>\n\n<p>Also someone else also had the exact same problem and opened this issue: <a href=\"https://github.com/matterport/Mask_RCNN/issues/379\">https://github.com/matterport/Mask_RCNN/issues/379</a>\nIn the comments you will see, I put the line where it is failing and let Waleed know about the issue.</p>",
      "rawMarkdown": "Thanks @ZhengLi. I was just debugging the code and found it. \n\nAlso someone else also had the exact same problem and opened this issue: https://github.com/matterport/Mask_RCNN/issues/379\nIn the comments you will see, I put the line where it is failing and let Waleed know about the issue.",
      "votes": null
    },
    {
      "id": "307284",
      "postDate": "04/01/2018 09:29:43",
      "content": "<p>@Mehul Sampat, I noticed a different problem. Although i have installed and can succesfully import imageaug, using the train statement as above complained about the argument variable as unknown extra passed to model.train() , do I need to set something else somewhere for this to work with matterport mask RCNN?</p>",
      "rawMarkdown": "Mehul Sampat, I noticed a different problem. Although i have installed and can succesfully import imageaug, using the train statement as above complained about the argument variable as unknown extra passed to model.train() , do I need to set something else somewhere for this to work with matterport mask RCNN?",
      "votes": null
    },
    {
      "id": "307304",
      "postDate": "04/01/2018 10:24:48",
      "content": "<p>@Mehul Sampat, sorry for the late reply.\nI trace the source code and I think we can just pass one transform to the train(). If we want to do multiple transforms we need to use other methods, such as use the imgaug library directly. I also face the same issue about the core-down when passing augmentation to train(). Even when I didn't pass any augmentation to the model the kernel also dump. Therefore, I use the previous version and still waiting for this issue be solved.</p>",
      "rawMarkdown": "Mehul Sampat, sorry for the late reply.\nI trace the source code and I think we can just pass one transform to the train(). If we want to do multiple transforms we need to use other methods, such as use the imgaug library directly. I also face the same issue about the core-down when passing augmentation to train(). Even when I didn't pass any augmentation to the model the kernel also dump. Therefore, I use the previous version and still waiting for this issue be solved.",
      "votes": null
    },
    {
      "id": "307307",
      "postDate": "04/01/2018 10:30:17",
      "content": "<p>@YaGana Sheriff-Hussaini, did you update the latest version? \nYou can trace train() in model.py and check this part as below. The previous version didn't have the augmentation part. </p>\n\n<pre><code>def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,\n              augmentation=None)\n</code></pre>",
      "rawMarkdown": "YaGana Sheriff-Hussaini, did you update the latest version? \nYou can trace train() in model.py and check this part as below. The previous version didn't have the augmentation part. \n\n    def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,\n                  augmentation=None)",
      "votes": null
    },
    {
      "id": "307313",
      "postDate": "04/01/2018 10:40:38",
      "content": "<p>@IAmLegend, yes I copied the latest version today when I saw this post before trying it out.</p>",
      "rawMarkdown": "IAmLegend, yes I copied the latest version today when I saw this post before trying it out.",
      "votes": null
    },
    {
      "id": "307405",
      "postDate": "04/01/2018 14:37:58",
      "content": "<p>nice work </p>",
      "rawMarkdown": "nice work",
      "votes": null
    },
    {
      "id": "307446",
      "postDate": "04/01/2018 16:14:39",
      "content": "<p>@YaGana. i dont have the issue . could you please check the variable name is \"augmentation=\" ?\nAlso to be sure you have the latest version please check if it matches this line \n<a href=\"https://github.com/matterport/Mask_RCNN/blob/master/model.py#L1167\">https://github.com/matterport/Mask_RCNN/blob/master/model.py#L1167</a>\nLet me know if that helps.</p>",
      "rawMarkdown": "YaGana. i dont have the issue . could you please check the variable name is \"augmentation=\" ?\nAlso to be sure you have the latest version please check if it matches this line \nhttps://github.com/matterport/Mask_RCNN/blob/master/model.py#L1167\nLet me know if that helps.",
      "votes": null
    },
    {
      "id": "307535",
      "postDate": "04/02/2018 00:07:32",
      "content": "<p>@Mehul i had it correct but still get the following error.</p>\n\n<blockquote>\n  <p>TypeError                                 Traceback (most recent call last)\n   in ()\n        7                      epochs=10,\n        8                      layers='heads',\n  ----&gt; 9                      augmentation=augment)\n       10 \"\"\"\n       11 \n  TypeError: train() got an unexpected keyword argument 'augmentation'</p>\n</blockquote>\n\n<p>And here is the whole code:</p>\n\n<blockquote>\n  <p>import imgaug <br>\n  augment = imgaug.augmenters.Fliplr(0.5)</p>\n  \n  <p>model.train(dataset_train, dataset_val,\n                       learning_rate=config.LEARNING_RATE,\n                       epochs=10,\n                       layers='heads',\n                       augmentation=augment)</p>\n</blockquote>",
      "rawMarkdown": "Mehul i had it correct but still get the following error.\n\n&gt; TypeError                                 Traceback (most recent call last)",
      "votes": null
    },
    {
      "id": "307545",
      "postDate": "04/02/2018 01:00:30",
      "content": "<p>@IAmLegend, below is what I have in the latest model.py I copied over:</p>\n\n<blockquote>\n  <p>def load_image_gt(dataset, config, image_id, augment=False, augmentation=None,\n                    use_mini_mask=False):</p>\n</blockquote>",
      "rawMarkdown": "IAmLegend, below is what I have in the latest model.py I copied over:\n\n&gt; def load_image_gt(dataset, config, image_id, augment=False, augmentation=None,\n                  use_mini_mask=False):",
      "votes": null
    },
    {
      "id": "307549",
      "postDate": "04/02/2018 01:19:57",
      "content": "<p>@YaGana which OS are you using ? and how did you install imgaug ? I did pip3 install imgaug</p>",
      "rawMarkdown": "YaGana which OS are you using ? and how did you install imgaug ? I did pip3 install imgaug",
      "votes": null
    },
    {
      "id": "307556",
      "postDate": "04/02/2018 01:43:14",
      "content": "<p>@YaGana, the error msg shows clearly that train() got an unexpected keyword. I think you should replace whole model.py. Could you check your model.py in <strong>def train()</strong> that is the same as below?</p>\n\n<pre><code>def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,\n              augmentation=None):\n</code></pre>\n\n<p>I guess your train() have 6 keywords without augmentation=None likes below</p>\n\n<pre><code>def train(self, train_dataset, val_dataset, learning_rate, epochs, layers):\n</code></pre>",
      "rawMarkdown": "YaGana, the error msg shows clearly that train() got an unexpected keyword. I think you should replace whole model.py. Could you check your model.py in **def train()** that is the same as below?\n\n    def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,\n                  augmentation=None):\n\nI guess your train() have 6 keywords without augmentation=None likes below\n\n    def train(self, train_dataset, val_dataset, learning_rate, epochs, layers):",
      "votes": null
    },
    {
      "id": "307584",
      "postDate": "04/02/2018 04:31:43",
      "content": "<p>Hi Mehul Sampat,</p>\n\n<p>I am using Google colab and installed it as follows because pip install could not find it.</p>\n\n<blockquote>\n  <p>!pip install  git+<a href=\"https://github.com/aleju/imgaug.git@master\">https://github.com/aleju/imgaug.git@master</a></p>\n</blockquote>\n\n<p>I think the installation was successful as I can import it.</p>",
      "rawMarkdown": "Hi Mehul Sampat,\n\nI am using Google colab and installed it as follows because pip install could not find it.\n\n&gt; !pip install  git+https://github.com/aleju/imgaug.git@master\n\nI think the installation was successful as I can import it.",
      "votes": null
    },
    {
      "id": "308186",
      "postDate": "04/03/2018 04:57:11",
      "content": "<p>@YaGana, just checking if you were able to make it work ? \nPlease also do a git pull on master for Mask_RCNN. I see Waleed has a few new updates there. </p>",
      "rawMarkdown": "YaGana, just checking if you were able to make it work ? \nPlease also do a git pull on master for Mask_RCNN. I see Waleed has a few new updates there.",
      "votes": null
    },
    {
      "id": "308844",
      "postDate": "04/04/2018 07:28:15",
      "content": "<p>@Mehul Sampat, </p>\n\n<p>I could not get it to work.  By the way I am using this in Google colab. Were you ever able to get the pytorch mask-RCNN to work on Google colab? If so which one? Heng's or matterport in pytorch?</p>",
      "rawMarkdown": "Mehul Sampat, \n\nI could not get it to work.  By the way I am using this in Google colab. Were you ever able to get the pytorch mask-RCNN to work on Google colab? If so which one? Heng's or matterport in pytorch?",
      "votes": null
    },
    {
      "id": "309295",
      "postDate": "04/05/2018 01:41:08",
      "content": "<p>@YaGana, I use the Matterport Mask_RCNN which is tensorflow and keras. I have not tried it on google colab yet. I just used the Google Cloud instance. I will try and see if I can run Mask RCNN in google colab.  I need to run too many different experiments and it will be much better if i can do then colab</p>",
      "rawMarkdown": "YaGana, I use the Matterport Mask_RCNN which is tensorflow and keras. I have not tried it on google colab yet. I just used the Google Cloud instance. I will try and see if I can run Mask RCNN in google colab.  I need to run too many different experiments and it will be much better if i can do then colab",
      "votes": null
    },
    {
      "id": "311463",
      "postDate": "04/10/2018 05:42:26",
      "content": "<p>Just in case anyone else is having the problem I mentioned  earlier, the installation statement in the post is wrong. It should be as follows:</p>\n\n<p>pip install imgaug</p>",
      "rawMarkdown": "Just in case anyone else is having the problem I mentioned  earlier, the installation statement in the post is wrong. It should be as follows:\n\npip install imgaug",
      "votes": null
    },
    {
      "id": "854630",
      "postDate": "05/20/2020 06:56:09",
      "content": "<p><a href=\"/mpsampat\">@mpsampat</a> hi, just one query. Is matterport mask rcnn supports only <code>imgaug</code> augmentation library? Can we use <code>albumentation</code> or other custom augmentation as the same?</p>",
      "rawMarkdown": "mpsampat hi, just one query. Is matterport mask rcnn supports only `imgaug` augmentation library? Can we use `albumentation` or other custom augmentation as the same?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 307106,
      "author_name": "mpsampat",
      "author_url": "",
      "post_date": "03/31/2018 20:16:48",
      "content": "<p>@IAmLegend, Awesome! thanks for sharing . I am just trying it out.  Will let you know if it improves results.\nAlso in the new version resnet50 and resnet101 can be passed via config. \nIn the old version resnet101 was hard-coded. I put resnet50 in config but it was not doing anything (my bad!)\nI wasted a week on resnet50 but i finally found resnet101 is giving me better results than resnet50</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 307107,
      "author_name": "mpsampat",
      "author_url": "",
      "post_date": "03/31/2018 20:17:44",
      "content": "<p>@IAmLegend one question. did you figure out how to do multiple transforms. so for example rotation + translation ? </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 307211,
      "author_name": "mpsampat",
      "author_url": "",
      "post_date": "04/01/2018 04:58:59",
      "content": "<p>@IAmLegend, when i try to run with \"augmentation = imgaug.augmenters.Fliplr(0.5)\" I get the following issue on K80: \"Floating point exception(core dumped)\"; did the new augmentation work for you ? </p>",
      "votes": null,
      "replies": [
        {
          "id": 307304,
          "author_name": "chiaosun",
          "author_url": "",
          "post_date": "04/01/2018 10:24:48",
          "content": "<p>@Mehul Sampat, sorry for the late reply.\nI trace the source code and I think we can just pass one transform to the train(). If we want to do multiple transforms we need to use other methods, such as use the imgaug library directly. I also face the same issue about the core-down when passing augmentation to train(). Even when I didn't pass any augmentation to the model the kernel also dump. Therefore, I use the previous version and still waiting for this issue be solved.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 307221,
      "author_name": "mpsampat",
      "author_url": "",
      "post_date": "04/01/2018 05:31:46",
      "content": "<p>Sorry for the spam! I figured out that new image augmentation from imgaug works if we use USE_MINI_MASK = False. \nI will write to Waleed about the bug in the matterport implementation; and ask him why it causes core-dump sometimes. </p>\n\n<p>Lastly, the full list of augmentations can be found here:\n<a href=\"http://imgaug.readthedocs.io/en/latest/source/augmenters.html\">http://imgaug.readthedocs.io/en/latest/source/augmenters.html</a></p>",
      "votes": null,
      "replies": [
        {
          "id": 307253,
          "author_name": "mdlszhengli",
          "author_url": "",
          "post_date": "04/01/2018 07:25:13",
          "content": "<p>so great, how do you find that?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307258,
          "author_name": "mpsampat",
          "author_url": "",
          "post_date": "04/01/2018 07:43:13",
          "content": "<p>Thanks @ZhengLi. I was just debugging the code and found it. </p>\n\n<p>Also someone else also had the exact same problem and opened this issue: <a href=\"https://github.com/matterport/Mask_RCNN/issues/379\">https://github.com/matterport/Mask_RCNN/issues/379</a>\nIn the comments you will see, I put the line where it is failing and let Waleed know about the issue.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307284,
          "author_name": "sheriytm",
          "author_url": "",
          "post_date": "04/01/2018 09:29:43",
          "content": "<p>@Mehul Sampat, I noticed a different problem. Although i have installed and can succesfully import imageaug, using the train statement as above complained about the argument variable as unknown extra passed to model.train() , do I need to set something else somewhere for this to work with matterport mask RCNN?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307307,
          "author_name": "chiaosun",
          "author_url": "",
          "post_date": "04/01/2018 10:30:17",
          "content": "<p>@YaGana Sheriff-Hussaini, did you update the latest version? \nYou can trace train() in model.py and check this part as below. The previous version didn't have the augmentation part. </p>\n\n<pre><code>def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,\n              augmentation=None)\n</code></pre>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307313,
          "author_name": "sheriytm",
          "author_url": "",
          "post_date": "04/01/2018 10:40:38",
          "content": "<p>@IAmLegend, yes I copied the latest version today when I saw this post before trying it out.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307446,
          "author_name": "mpsampat",
          "author_url": "",
          "post_date": "04/01/2018 16:14:39",
          "content": "<p>@YaGana. i dont have the issue . could you please check the variable name is \"augmentation=\" ?\nAlso to be sure you have the latest version please check if it matches this line \n<a href=\"https://github.com/matterport/Mask_RCNN/blob/master/model.py#L1167\">https://github.com/matterport/Mask_RCNN/blob/master/model.py#L1167</a>\nLet me know if that helps.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307535,
          "author_name": "sheriytm",
          "author_url": "",
          "post_date": "04/02/2018 00:07:32",
          "content": "<p>@Mehul i had it correct but still get the following error.</p>\n\n<blockquote>\n  <p>TypeError                                 Traceback (most recent call last)\n   in ()\n        7                      epochs=10,\n        8                      layers='heads',\n  ----&gt; 9                      augmentation=augment)\n       10 \"\"\"\n       11 \n  TypeError: train() got an unexpected keyword argument 'augmentation'</p>\n</blockquote>\n\n<p>And here is the whole code:</p>\n\n<blockquote>\n  <p>import imgaug <br>\n  augment = imgaug.augmenters.Fliplr(0.5)</p>\n  \n  <p>model.train(dataset_train, dataset_val,\n                       learning_rate=config.LEARNING_RATE,\n                       epochs=10,\n                       layers='heads',\n                       augmentation=augment)</p>\n</blockquote>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307545,
          "author_name": "sheriytm",
          "author_url": "",
          "post_date": "04/02/2018 01:00:30",
          "content": "<p>@IAmLegend, below is what I have in the latest model.py I copied over:</p>\n\n<blockquote>\n  <p>def load_image_gt(dataset, config, image_id, augment=False, augmentation=None,\n                    use_mini_mask=False):</p>\n</blockquote>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307549,
          "author_name": "mpsampat",
          "author_url": "",
          "post_date": "04/02/2018 01:19:57",
          "content": "<p>@YaGana which OS are you using ? and how did you install imgaug ? I did pip3 install imgaug</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307556,
          "author_name": "chiaosun",
          "author_url": "",
          "post_date": "04/02/2018 01:43:14",
          "content": "<p>@YaGana, the error msg shows clearly that train() got an unexpected keyword. I think you should replace whole model.py. Could you check your model.py in <strong>def train()</strong> that is the same as below?</p>\n\n<pre><code>def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,\n              augmentation=None):\n</code></pre>\n\n<p>I guess your train() have 6 keywords without augmentation=None likes below</p>\n\n<pre><code>def train(self, train_dataset, val_dataset, learning_rate, epochs, layers):\n</code></pre>",
          "votes": null,
          "replies": []
        },
        {
          "id": 307584,
          "author_name": "sheriytm",
          "author_url": "",
          "post_date": "04/02/2018 04:31:43",
          "content": "<p>Hi Mehul Sampat,</p>\n\n<p>I am using Google colab and installed it as follows because pip install could not find it.</p>\n\n<blockquote>\n  <p>!pip install  git+<a href=\"https://github.com/aleju/imgaug.git@master\">https://github.com/aleju/imgaug.git@master</a></p>\n</blockquote>\n\n<p>I think the installation was successful as I can import it.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 308186,
          "author_name": "mpsampat",
          "author_url": "",
          "post_date": "04/03/2018 04:57:11",
          "content": "<p>@YaGana, just checking if you were able to make it work ? \nPlease also do a git pull on master for Mask_RCNN. I see Waleed has a few new updates there. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 308844,
          "author_name": "sheriytm",
          "author_url": "",
          "post_date": "04/04/2018 07:28:15",
          "content": "<p>@Mehul Sampat, </p>\n\n<p>I could not get it to work.  By the way I am using this in Google colab. Were you ever able to get the pytorch mask-RCNN to work on Google colab? If so which one? Heng's or matterport in pytorch?</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 309295,
          "author_name": "mpsampat",
          "author_url": "",
          "post_date": "04/05/2018 01:41:08",
          "content": "<p>@YaGana, I use the Matterport Mask_RCNN which is tensorflow and keras. I have not tried it on google colab yet. I just used the Google Cloud instance. I will try and see if I can run Mask RCNN in google colab.  I need to run too many different experiments and it will be much better if i can do then colab</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 311463,
          "author_name": "sheriytm",
          "author_url": "",
          "post_date": "04/10/2018 05:42:26",
          "content": "<p>Just in case anyone else is having the problem I mentioned  earlier, the installation statement in the post is wrong. It should be as follows:</p>\n\n<p>pip install imgaug</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 307405,
      "author_name": "mayankjn34",
      "author_url": "",
      "post_date": "04/01/2018 14:37:58",
      "content": "<p>nice work </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 854630,
      "author_name": "ipythonx",
      "author_url": "",
      "post_date": "05/20/2020 06:56:09",
      "content": "<p><a href=\"/mpsampat\">@mpsampat</a> hi, just one query. Is matterport mask rcnn supports only <code>imgaug</code> augmentation library? Can we use <code>albumentation</code> or other custom augmentation as the same?</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "306981": "Hi All,\n\nMatterport already implement image augmentation in **train()**.\n\nYou can check the latest version [here][1].\n\nAnd the sample code is shown below:\n\n    import imgaug  # https://github.com/aleju/imgaug (pip3 install imageaug)\n    augmentation = imgaug.augmenters.Fliplr(0.5)\n    model.train(dataset_train, dataset_val,\n                         learning_rate=config.LEARNING_RATE,\n                         epochs=40,\n                         layers='heads',\n                         augmentation=augmentation)\n\n  [1]: https://github.com/matterport/Mask_RCNN/blob/dffcb6110184707c28e80879ac8c70f7ebf6dcfe/model.py#L2210",
    "307106": "IAmLegend, Awesome! thanks for sharing . I am just trying it out.  Will let you know if it improves results.\nAlso in the new version resnet50 and resnet101 can be passed via config. \nIn the old version resnet101 was hard-coded. I put resnet50 in config but it was not doing anything (my bad!)\nI wasted a week on resnet50 but i finally found resnet101 is giving me better results than resnet50",
    "307107": "IAmLegend one question. did you figure out how to do multiple transforms. so for example rotation + translation ?",
    "307211": "IAmLegend, when i try to run with \"augmentation = imgaug.augmenters.Fliplr(0.5)\" I get the following issue on K80: \"Floating point exception(core dumped)\"; did the new augmentation work for you ?",
    "307221": "Sorry for the spam! I figured out that new image augmentation from imgaug works if we use USE_MINI_MASK = False. \nI will write to Waleed about the bug in the matterport implementation; and ask him why it causes core-dump sometimes. \n\nLastly, the full list of augmentations can be found here:\nhttp://imgaug.readthedocs.io/en/latest/source/augmenters.html",
    "307253": "so great, how do you find that?",
    "307258": "Thanks @ZhengLi. I was just debugging the code and found it. \n\nAlso someone else also had the exact same problem and opened this issue: https://github.com/matterport/Mask_RCNN/issues/379\nIn the comments you will see, I put the line where it is failing and let Waleed know about the issue.",
    "307284": "Mehul Sampat, I noticed a different problem. Although i have installed and can succesfully import imageaug, using the train statement as above complained about the argument variable as unknown extra passed to model.train() , do I need to set something else somewhere for this to work with matterport mask RCNN?",
    "307304": "Mehul Sampat, sorry for the late reply.\nI trace the source code and I think we can just pass one transform to the train(). If we want to do multiple transforms we need to use other methods, such as use the imgaug library directly. I also face the same issue about the core-down when passing augmentation to train(). Even when I didn't pass any augmentation to the model the kernel also dump. Therefore, I use the previous version and still waiting for this issue be solved.",
    "307307": "YaGana Sheriff-Hussaini, did you update the latest version? \nYou can trace train() in model.py and check this part as below. The previous version didn't have the augmentation part. \n\n    def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,\n                  augmentation=None)",
    "307313": "IAmLegend, yes I copied the latest version today when I saw this post before trying it out.",
    "307405": "nice work",
    "307446": "YaGana. i dont have the issue . could you please check the variable name is \"augmentation=\" ?\nAlso to be sure you have the latest version please check if it matches this line \nhttps://github.com/matterport/Mask_RCNN/blob/master/model.py#L1167\nLet me know if that helps.",
    "307535": "Mehul i had it correct but still get the following error.\n\n&gt; TypeError                                 Traceback (most recent call last)",
    "307545": "IAmLegend, below is what I have in the latest model.py I copied over:\n\n&gt; def load_image_gt(dataset, config, image_id, augment=False, augmentation=None,\n                  use_mini_mask=False):",
    "307549": "YaGana which OS are you using ? and how did you install imgaug ? I did pip3 install imgaug",
    "307556": "YaGana, the error msg shows clearly that train() got an unexpected keyword. I think you should replace whole model.py. Could you check your model.py in **def train()** that is the same as below?\n\n    def train(self, train_dataset, val_dataset, learning_rate, epochs, layers,\n                  augmentation=None):\n\nI guess your train() have 6 keywords without augmentation=None likes below\n\n    def train(self, train_dataset, val_dataset, learning_rate, epochs, layers):",
    "307584": "Hi Mehul Sampat,\n\nI am using Google colab and installed it as follows because pip install could not find it.\n\n&gt; !pip install  git+https://github.com/aleju/imgaug.git@master\n\nI think the installation was successful as I can import it.",
    "308186": "YaGana, just checking if you were able to make it work ? \nPlease also do a git pull on master for Mask_RCNN. I see Waleed has a few new updates there.",
    "308844": "Mehul Sampat, \n\nI could not get it to work.  By the way I am using this in Google colab. Were you ever able to get the pytorch mask-RCNN to work on Google colab? If so which one? Heng's or matterport in pytorch?",
    "309295": "YaGana, I use the Matterport Mask_RCNN which is tensorflow and keras. I have not tried it on google colab yet. I just used the Google Cloud instance. I will try and see if I can run Mask RCNN in google colab.  I need to run too many different experiments and it will be much better if i can do then colab",
    "311463": "Just in case anyone else is having the problem I mentioned  earlier, the installation statement in the post is wrong. It should be as follows:\n\npip install imgaug",
    "854630": "mpsampat hi, just one query. Is matterport mask rcnn supports only `imgaug` augmentation library? Can we use `albumentation` or other custom augmentation as the same?"
  },
  "source": "meta"
}