{
  "id": 121497,
  "title": "Any effective deep learning based face detection APIs or usable Github code?",
  "url": "/competitions/deepfake-detection-challenge/discussion/121497",
  "author_name": "",
  "post_date": "2019-12-13T17:28:25.627535900Z",
  "votes": 2,
  "comment_count": 7,
  "views": 0,
  "content": "<p>I'm trying to generate face crops from the training videos. Tried Dlib, Opencv Haar face detectors, they are not working at all for images with very small faces or very dark lighting conditions like below.</p>\n\n<p>| <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1288210%2F75898865979188a65f497ce9dffa4489%2FScreenshot%202019-12-13%20at%2010.53.01%20PM.png?generation=1576257851960963&amp;alt=media\" alt=\"\"> | <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1288210%2F2c99a42c01a63dd26bbee296b30cdc20%2F1frame.jpg?generation=1576257755189540&amp;alt=media\" alt=\"\"> |\n| --- | --- |\n|  |  |</p>\n\n<p>Any suggestions for any great deep learning based APIs or usable Github code?\nThanks in advance!</p>",
  "messages": [
    {
      "id": "694485",
      "postDate": "12/13/2019 17:28:25",
      "content": "<p>I'm trying to generate face crops from the training videos. Tried Dlib, Opencv Haar face detectors, they are not working at all for images with very small faces or very dark lighting conditions like below.</p>\n\n<p>| <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1288210%2F75898865979188a65f497ce9dffa4489%2FScreenshot%202019-12-13%20at%2010.53.01%20PM.png?generation=1576257851960963&amp;alt=media\" alt=\"\"> | <img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1288210%2F2c99a42c01a63dd26bbee296b30cdc20%2F1frame.jpg?generation=1576257755189540&amp;alt=media\" alt=\"\"> |\n| --- | --- |\n|  |  |</p>\n\n<p>Any suggestions for any great deep learning based APIs or usable Github code?\nThanks in advance!</p>",
      "rawMarkdown": "I'm trying to generate face crops from the training videos. Tried Dlib, Opencv Haar face detectors, they are not working at all for images with very small faces or very dark lighting conditions like below.\n\n| ![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1288210%2F75898865979188a65f497ce9dffa4489%2FScreenshot%202019-12-13%20at%2010.53.01%20PM.png?generation=1576257851960963&amp;alt=media) | ![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1288210%2F2c99a42c01a63dd26bbee296b30cdc20%2F1frame.jpg?generation=1576257755189540&amp;alt=media) |\n| --- | --- |\n|  |  |\n\nAny suggestions for any great deep learning based APIs or usable Github code?\nThanks in advance!",
      "votes": null
    },
    {
      "id": "694590",
      "postDate": "12/13/2019 20:16:26",
      "content": "<p>Maybe something like that would help: <a href=\"https://github.com/deepinsight/insightface\">https://github.com/deepinsight/insightface</a> ?</p>",
      "rawMarkdown": "Maybe something like that would help: https://github.com/deepinsight/insightface ?",
      "votes": null
    },
    {
      "id": "694699",
      "postDate": "12/14/2019 01:34:29",
      "content": "<p>try adjusting the brightness and use mtcnn model.</p>",
      "rawMarkdown": "try adjusting the brightness and use mtcnn model.",
      "votes": null
    },
    {
      "id": "694867",
      "postDate": "12/14/2019 08:22:19",
      "content": "<p>Thank you for the suggestion.\nInsightface works great, I installed it using pip and followed this small tutorial given at <a href=\"http://insightface.ai/build/examples_face_detection/demo_retinaface.html\">http://insightface.ai/build/examples_face_detection/demo_retinaface.html</a> and it works great on all the difficult cases.\nBut the problem is, it is running on CPU (even though I installed Mxnet for GPU) and it is taking 30 seconds for each frame and I am not able to figure out how to predict on batches (like on all the frames of the video at once).\nAny suggestions on how to run it on GPU and predict on batches?</p>",
      "rawMarkdown": "Thank you for the suggestion.\nInsightface works great, I installed it using pip and followed this small tutorial given at [http://insightface.ai/build/examples_face_detection/demo_retinaface.html](http://insightface.ai/build/examples_face_detection/demo_retinaface.html) and it works great on all the difficult cases.\nBut the problem is, it is running on CPU (even though I installed Mxnet for GPU) and it is taking 30 seconds for each frame and I am not able to figure out how to predict on batches (like on all the frames of the video at once).\nAny suggestions on how to run it on GPU and predict on batches?",
      "votes": null
    },
    {
      "id": "694910",
      "postDate": "12/14/2019 10:36:04",
      "content": "<p>Thank you.\nI'm trying the <code>mtcnn</code> python package. It is very good and able to predict on difficult cases as well. But I am not able to predict on batches to utilize the full GPU ability. I don't know why, but the difference in inference time is not very high b/w running the code on CPU and GPU. Right now it is taking approximately 0.25 seconds (250 ms) per frame i.e, approx 75 seconds for each video on K80 GPU which is very huge.\nI will look at other available mtcnn repos as well.</p>",
      "rawMarkdown": "Thank you.\nI'm trying the `mtcnn` python package. It is very good and able to predict on difficult cases as well. But I am not able to predict on batches to utilize the full GPU ability. I don't know why, but the difference in inference time is not very high b/w running the code on CPU and GPU. Right now it is taking approximately 0.25 seconds (250 ms) per frame i.e, approx 75 seconds for each video on K80 GPU which is very huge.\nI will look at other available mtcnn repos as well.",
      "votes": null
    },
    {
      "id": "694931",
      "postDate": "12/14/2019 11:17:32",
      "content": "<p>These are useful. try it.\n<a href=\"https://github.com/TencentYoutuResearch/FaceDetection-DSFD\">https://github.com/TencentYoutuResearch/FaceDetection-DSFD</a>\n<a href=\"https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB\">https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB</a></p>",
      "rawMarkdown": "These are useful. try it.\nhttps://github.com/TencentYoutuResearch/FaceDetection-DSFD\nhttps://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB",
      "votes": null
    },
    {
      "id": "695175",
      "postDate": "12/14/2019 17:41:55",
      "content": "<p>Adjusting the frame size will boost the speed. You might need to balance the accuracy and speed. Usually, model with good accuracy(with great complexity) won't have a great speed. </p>",
      "rawMarkdown": "Adjusting the frame size will boost the speed. You might need to balance the accuracy and speed. Usually, model with good accuracy(with great complexity) won't have a great speed.",
      "votes": null
    },
    {
      "id": "695356",
      "postDate": "12/15/2019 02:33:05",
      "content": "<p>I'm going ahead with <code>mtcnn</code> pakage. I have reduced the height and width of frames by half and will run the code 4 times parallelly on all my 4 CPUs and the GPU. So, in this way, it will approximately take 6 days to process all the videos.</p>",
      "rawMarkdown": "I'm going ahead with `mtcnn` pakage. I have reduced the height and width of frames by half and will run the code 4 times parallelly on all my 4 CPUs and the GPU. So, in this way, it will approximately take 6 days to process all the videos.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 694590,
      "author_name": "liuftvafas",
      "author_url": "",
      "post_date": "12/13/2019 20:16:26",
      "content": "<p>Maybe something like that would help: <a href=\"https://github.com/deepinsight/insightface\">https://github.com/deepinsight/insightface</a> ?</p>",
      "votes": null,
      "replies": [
        {
          "id": 694867,
          "author_name": "manideep2510",
          "author_url": "",
          "post_date": "12/14/2019 08:22:19",
          "content": "<p>Thank you for the suggestion.\nInsightface works great, I installed it using pip and followed this small tutorial given at <a href=\"http://insightface.ai/build/examples_face_detection/demo_retinaface.html\">http://insightface.ai/build/examples_face_detection/demo_retinaface.html</a> and it works great on all the difficult cases.\nBut the problem is, it is running on CPU (even though I installed Mxnet for GPU) and it is taking 30 seconds for each frame and I am not able to figure out how to predict on batches (like on all the frames of the video at once).\nAny suggestions on how to run it on GPU and predict on batches?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 694699,
      "author_name": "unkownhihi",
      "author_url": "",
      "post_date": "12/14/2019 01:34:29",
      "content": "<p>try adjusting the brightness and use mtcnn model.</p>",
      "votes": null,
      "replies": [
        {
          "id": 694910,
          "author_name": "manideep2510",
          "author_url": "",
          "post_date": "12/14/2019 10:36:04",
          "content": "<p>Thank you.\nI'm trying the <code>mtcnn</code> python package. It is very good and able to predict on difficult cases as well. But I am not able to predict on batches to utilize the full GPU ability. I don't know why, but the difference in inference time is not very high b/w running the code on CPU and GPU. Right now it is taking approximately 0.25 seconds (250 ms) per frame i.e, approx 75 seconds for each video on K80 GPU which is very huge.\nI will look at other available mtcnn repos as well.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 695175,
          "author_name": "unkownhihi",
          "author_url": "",
          "post_date": "12/14/2019 17:41:55",
          "content": "<p>Adjusting the frame size will boost the speed. You might need to balance the accuracy and speed. Usually, model with good accuracy(with great complexity) won't have a great speed. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 695356,
          "author_name": "manideep2510",
          "author_url": "",
          "post_date": "12/15/2019 02:33:05",
          "content": "<p>I'm going ahead with <code>mtcnn</code> pakage. I have reduced the height and width of frames by half and will run the code 4 times parallelly on all my 4 CPUs and the GPU. So, in this way, it will approximately take 6 days to process all the videos.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 694931,
      "author_name": "phalanx",
      "author_url": "",
      "post_date": "12/14/2019 11:17:32",
      "content": "<p>These are useful. try it.\n<a href=\"https://github.com/TencentYoutuResearch/FaceDetection-DSFD\">https://github.com/TencentYoutuResearch/FaceDetection-DSFD</a>\n<a href=\"https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB\">https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB</a></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "694485": "I'm trying to generate face crops from the training videos. Tried Dlib, Opencv Haar face detectors, they are not working at all for images with very small faces or very dark lighting conditions like below.\n\n| ![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1288210%2F75898865979188a65f497ce9dffa4489%2FScreenshot%202019-12-13%20at%2010.53.01%20PM.png?generation=1576257851960963&amp;alt=media) | ![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F1288210%2F2c99a42c01a63dd26bbee296b30cdc20%2F1frame.jpg?generation=1576257755189540&amp;alt=media) |\n| --- | --- |\n|  |  |\n\nAny suggestions for any great deep learning based APIs or usable Github code?\nThanks in advance!",
    "694590": "Maybe something like that would help: https://github.com/deepinsight/insightface ?",
    "694699": "try adjusting the brightness and use mtcnn model.",
    "694867": "Thank you for the suggestion.\nInsightface works great, I installed it using pip and followed this small tutorial given at [http://insightface.ai/build/examples_face_detection/demo_retinaface.html](http://insightface.ai/build/examples_face_detection/demo_retinaface.html) and it works great on all the difficult cases.\nBut the problem is, it is running on CPU (even though I installed Mxnet for GPU) and it is taking 30 seconds for each frame and I am not able to figure out how to predict on batches (like on all the frames of the video at once).\nAny suggestions on how to run it on GPU and predict on batches?",
    "694910": "Thank you.\nI'm trying the `mtcnn` python package. It is very good and able to predict on difficult cases as well. But I am not able to predict on batches to utilize the full GPU ability. I don't know why, but the difference in inference time is not very high b/w running the code on CPU and GPU. Right now it is taking approximately 0.25 seconds (250 ms) per frame i.e, approx 75 seconds for each video on K80 GPU which is very huge.\nI will look at other available mtcnn repos as well.",
    "694931": "These are useful. try it.\nhttps://github.com/TencentYoutuResearch/FaceDetection-DSFD\nhttps://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB",
    "695175": "Adjusting the frame size will boost the speed. You might need to balance the accuracy and speed. Usually, model with good accuracy(with great complexity) won't have a great speed.",
    "695356": "I'm going ahead with `mtcnn` pakage. I have reduced the height and width of frames by half and will run the code 4 times parallelly on all my 4 CPUs and the GPU. So, in this way, it will approximately take 6 days to process all the videos."
  },
  "source": "meta"
}