{
  "id": 124247,
  "title": "MTCNN and GPU?",
  "url": "/competitions/deepfake-detection-challenge/discussion/124247",
  "author_name": "",
  "post_date": "2020-01-02T21:14:32.240816Z",
  "votes": null,
  "comment_count": 3,
  "views": 0,
  "content": "<p>I am running MTCNN on my linux box and I am getting 30 consecutive frames in about 8 seconds - almost 4 frames per second. This seems slow to me - some are reporting 30 frames per second or more. The code is pretty clean and simple.</p>\n\n<p>I have a GPU but I do not instruct the program to use it. Is it possible to speed things up with the GPU? If so, how do I accomplish this.</p>\n\n<p>Are there any other ways to make it faster? Note that I am already extracting consecutive frames.</p>\n\n<p>Another question: MTCNN detects NO faces in about 12% of the videos (which have faces). Are there any simple tweaks that will allow it to see these faces?</p>",
  "messages": [
    {
      "id": "708945",
      "postDate": "01/02/2020 21:14:32",
      "content": "<p>I am running MTCNN on my linux box and I am getting 30 consecutive frames in about 8 seconds - almost 4 frames per second. This seems slow to me - some are reporting 30 frames per second or more. The code is pretty clean and simple.</p>\n\n<p>I have a GPU but I do not instruct the program to use it. Is it possible to speed things up with the GPU? If so, how do I accomplish this.</p>\n\n<p>Are there any other ways to make it faster? Note that I am already extracting consecutive frames.</p>\n\n<p>Another question: MTCNN detects NO faces in about 12% of the videos (which have faces). Are there any simple tweaks that will allow it to see these faces?</p>",
      "rawMarkdown": "I am running MTCNN on my linux box and I am getting 30 consecutive frames in about 8 seconds - almost 4 frames per second. This seems slow to me - some are reporting 30 frames per second or more. The code is pretty clean and simple.\n\nI have a GPU but I do not instruct the program to use it. Is it possible to speed things up with the GPU? If so, how do I accomplish this.\n\nAre there any other ways to make it faster? Note that I am already extracting consecutive frames.\n\nAnother question: MTCNN detects NO faces in about 12% of the videos (which have faces). Are there any simple tweaks that will allow it to see these faces?",
      "votes": null
    },
    {
      "id": "709072",
      "postDate": "01/03/2020 02:38:57",
      "content": "<p>Are you using the pytorch MTCNN or the keras MTCNN? In keras, they should automatically use GPU if they are available(only if you installed tensorflow-gpu and have a nvidia gpu).</p>",
      "rawMarkdown": "Are you using the pytorch MTCNN or the keras MTCNN? In keras, they should automatically use GPU if they are available(only if you installed tensorflow-gpu and have a nvidia gpu).",
      "votes": null
    },
    {
      "id": "709511",
      "postDate": "01/03/2020 15:51:53",
      "content": "<p>In pytorch version of MTCNN you can precise on which device you want to run model:\n<code>\nmtcnn = MTCNN(post_process=False, device='cuda')\n</code>\nhere <code>cuda</code> means you want run model on GPU, it's also possible to choose id of GPU you want to use, like this <code>cuda:0</code>.</p>\n\n<p>It's possible that it's missing some faces, this model was trained on some open source datasets, which some time time are not representative in real use case, but still those datasets are good as benchmarks. I don't know if there's really some \"simple\" tricks that will work, but you can try (no garanty that it will work) with different frame/image sizes.</p>",
      "rawMarkdown": "In pytorch version of MTCNN you can precise on which device you want to run model:\n```\nmtcnn = MTCNN(post_process=False, device='cuda')\n```\nhere `cuda` means you want run model on GPU, it's also possible to choose id of GPU you want to use, like this `cuda:0`.\n\nIt's possible that it's missing some faces, this model was trained on some open source datasets, which some time time are not representative in real use case, but still those datasets are good as benchmarks. I don't know if there's really some \"simple\" tricks that will work, but you can try (no garanty that it will work) with different frame/image sizes.",
      "votes": null
    },
    {
      "id": "709550",
      "postDate": "01/03/2020 16:38:56",
      "content": "<p>Thanks for the information. When you mention \"pytorch version of MTCNN\" are you referring to the repository <a href=\"https://github.com/TropComplique/mtcnn-pytorch\">https://github.com/TropComplique/mtcnn-pytorch</a> ?</p>\n\n<p>OK I found the notebook you are referring to.(timesler)</p>",
      "rawMarkdown": "Thanks for the information. When you mention \"pytorch version of MTCNN\" are you referring to the repository https://github.com/TropComplique/mtcnn-pytorch ?\n\nOK I found the notebook you are referring to.(timesler)",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 709072,
      "author_name": "unkownhihi",
      "author_url": "",
      "post_date": "01/03/2020 02:38:57",
      "content": "<p>Are you using the pytorch MTCNN or the keras MTCNN? In keras, they should automatically use GPU if they are available(only if you installed tensorflow-gpu and have a nvidia gpu).</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 709511,
      "author_name": "evgenybazarov",
      "author_url": "",
      "post_date": "01/03/2020 15:51:53",
      "content": "<p>In pytorch version of MTCNN you can precise on which device you want to run model:\n<code>\nmtcnn = MTCNN(post_process=False, device='cuda')\n</code>\nhere <code>cuda</code> means you want run model on GPU, it's also possible to choose id of GPU you want to use, like this <code>cuda:0</code>.</p>\n\n<p>It's possible that it's missing some faces, this model was trained on some open source datasets, which some time time are not representative in real use case, but still those datasets are good as benchmarks. I don't know if there's really some \"simple\" tricks that will work, but you can try (no garanty that it will work) with different frame/image sizes.</p>",
      "votes": null,
      "replies": [
        {
          "id": 709550,
          "author_name": "petewills",
          "author_url": "",
          "post_date": "01/03/2020 16:38:56",
          "content": "<p>Thanks for the information. When you mention \"pytorch version of MTCNN\" are you referring to the repository <a href=\"https://github.com/TropComplique/mtcnn-pytorch\">https://github.com/TropComplique/mtcnn-pytorch</a> ?</p>\n\n<p>OK I found the notebook you are referring to.(timesler)</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "708945": "I am running MTCNN on my linux box and I am getting 30 consecutive frames in about 8 seconds - almost 4 frames per second. This seems slow to me - some are reporting 30 frames per second or more. The code is pretty clean and simple.\n\nI have a GPU but I do not instruct the program to use it. Is it possible to speed things up with the GPU? If so, how do I accomplish this.\n\nAre there any other ways to make it faster? Note that I am already extracting consecutive frames.\n\nAnother question: MTCNN detects NO faces in about 12% of the videos (which have faces). Are there any simple tweaks that will allow it to see these faces?",
    "709072": "Are you using the pytorch MTCNN or the keras MTCNN? In keras, they should automatically use GPU if they are available(only if you installed tensorflow-gpu and have a nvidia gpu).",
    "709511": "In pytorch version of MTCNN you can precise on which device you want to run model:\n```\nmtcnn = MTCNN(post_process=False, device='cuda')\n```\nhere `cuda` means you want run model on GPU, it's also possible to choose id of GPU you want to use, like this `cuda:0`.\n\nIt's possible that it's missing some faces, this model was trained on some open source datasets, which some time time are not representative in real use case, but still those datasets are good as benchmarks. I don't know if there's really some \"simple\" tricks that will work, but you can try (no garanty that it will work) with different frame/image sizes.",
    "709550": "Thanks for the information. When you mention \"pytorch version of MTCNN\" are you referring to the repository https://github.com/TropComplique/mtcnn-pytorch ?\n\nOK I found the notebook you are referring to.(timesler)"
  },
  "source": "meta"
}