{
  "id": 127482,
  "title": "Suggestions for cropping face from video",
  "url": "/competitions/deepfake-detection-challenge/discussion/127482",
  "author_name": "",
  "post_date": "2020-01-24T06:14:53.433094Z",
  "votes": 1,
  "comment_count": 4,
  "views": 0,
  "content": "<h3>My approach</h3>\n\n<p>Currently I'm using opencv face detection with deep learning. You can check out <a href=\"https://www.pyimagesearch.com/2018/02/26/face-detection-with-opencv-and-deep-learning/\">pyimagesearch post about face detection</a>. A little trick is to gradually increase brightness if we can't find the face as many Videos are very dark. I used help from this <a href=\"https://stackoverflow.com/questions/57030125/automatically-adjusting-brightness-of-image-with-opencv\">stackoverflow question (kanat's answer).</a> </p>\n\n<h3>How good it is</h3>\n\n<p>Most of the time it performs well and is faster then MTCNN as per my testing but in some cases it can't detect a face at all. However in other frames of video it'll detect the face. </p>\n\n<h3>Better possibility</h3>\n\n<p>If there's a good way to take advantage of face detection over whole video as atleast some frames will get it right then we can get much better results. </p>\n\n<h3>Dataset with only cropped face videos</h3>\n\n<p>You can check out the training part 48's cropped face videos I created at <a href=\"https://drive.google.com/open?id=1hBZ_auVT9z1-DEwDodLV4Ub7LusyZXiB\">My google drive</a>. Before using the dataset you need to accept this competitions rules. I'll soon get this dataset on kaggle. Using this dataset will reduce the preprocessing and loading in ram or gpu time by a great margin but be aware that it's not perfect and every 1 of 20 videos are not of interest.</p>\n\n<h3>If you have any suggestion on how to take advantage of face detection over whole video or in general any other suggestion for face detection please share in comments.</h3>",
  "messages": [
    {
      "id": "727868",
      "postDate": "01/24/2020 06:14:53",
      "content": "<h3>My approach</h3>\n\n<p>Currently I'm using opencv face detection with deep learning. You can check out <a href=\"https://www.pyimagesearch.com/2018/02/26/face-detection-with-opencv-and-deep-learning/\">pyimagesearch post about face detection</a>. A little trick is to gradually increase brightness if we can't find the face as many Videos are very dark. I used help from this <a href=\"https://stackoverflow.com/questions/57030125/automatically-adjusting-brightness-of-image-with-opencv\">stackoverflow question (kanat's answer).</a> </p>\n\n<h3>How good it is</h3>\n\n<p>Most of the time it performs well and is faster then MTCNN as per my testing but in some cases it can't detect a face at all. However in other frames of video it'll detect the face. </p>\n\n<h3>Better possibility</h3>\n\n<p>If there's a good way to take advantage of face detection over whole video as atleast some frames will get it right then we can get much better results. </p>\n\n<h3>Dataset with only cropped face videos</h3>\n\n<p>You can check out the training part 48's cropped face videos I created at <a href=\"https://drive.google.com/open?id=1hBZ_auVT9z1-DEwDodLV4Ub7LusyZXiB\">My google drive</a>. Before using the dataset you need to accept this competitions rules. I'll soon get this dataset on kaggle. Using this dataset will reduce the preprocessing and loading in ram or gpu time by a great margin but be aware that it's not perfect and every 1 of 20 videos are not of interest.</p>\n\n<h3>If you have any suggestion on how to take advantage of face detection over whole video or in general any other suggestion for face detection please share in comments.</h3>",
      "rawMarkdown": "### My approach\nCurrently I'm using opencv face detection with deep learning. You can check out [pyimagesearch post about face detection](https://www.pyimagesearch.com/2018/02/26/face-detection-with-opencv-and-deep-learning/). A little trick is to gradually increase brightness if we can't find the face as many Videos are very dark. I used help from this [stackoverflow question (kanat's answer).](https://stackoverflow.com/questions/57030125/automatically-adjusting-brightness-of-image-with-opencv) \n\n### How good it is\nMost of the time it performs well and is faster then MTCNN as per my testing but in some cases it can't detect a face at all. However in other frames of video it'll detect the face. \n\n### Better possibility\nIf there's a good way to take advantage of face detection over whole video as atleast some frames will get it right then we can get much better results. \n\n### Dataset with only cropped face videos\n You can check out the training part 48's cropped face videos I created at [My google drive](https://drive.google.com/open?id=1hBZ_auVT9z1-DEwDodLV4Ub7LusyZXiB). Before using the dataset you need to accept this competitions rules. I'll soon get this dataset on kaggle. Using this dataset will reduce the preprocessing and loading in ram or gpu time by a great margin but be aware that it's not perfect and every 1 of 20 videos are not of interest.\n\n### If you have any suggestion on how to take advantage of face detection over whole video or in general any other suggestion for face detection please share in comments.",
      "votes": null
    },
    {
      "id": "728533",
      "postDate": "01/24/2020 21:34:02",
      "content": "<p>I think normalizing brightness/contrast of the videos beforehand seem like a good idea. How exactly to do it is another question. Have you seen noticeable improvements using the brightness increase?</p>",
      "rawMarkdown": "I think normalizing brightness/contrast of the videos beforehand seem like a good idea. How exactly to do it is another question. Have you seen noticeable improvements using the brightness increase?",
      "votes": null
    },
    {
      "id": "729459",
      "postDate": "01/26/2020 08:25:39",
      "content": "<p>yes, as I'm using opencv face detection which is not as accuracte as mtcnn but much faster. so increasing brightness gives the accuracy same as mtcnn in less time.</p>",
      "rawMarkdown": "yes, as I'm using opencv face detection which is not as accuracte as mtcnn but much faster. so increasing brightness gives the accuracy same as mtcnn in less time.",
      "votes": null
    },
    {
      "id": "757183",
      "postDate": "02/26/2020 14:01:30",
      "content": "<p>Do you crop the faces and save them in jpg format?</p>",
      "rawMarkdown": "Do you crop the faces and save them in jpg format?",
      "votes": null
    },
    {
      "id": "757804",
      "postDate": "02/27/2020 05:51:43",
      "content": "<p>Hi Ankit - thanks for sharing these tips ! </p>\n\n<p>I had a query regarding the pre-processing step where you increase the brightness of the frame (in-case the algo cannot detect a face) \nAre you using it during training or only for the inference phase ? </p>",
      "rawMarkdown": "Hi Ankit - thanks for sharing these tips ! \n\nI had a query regarding the pre-processing step where you increase the brightness of the frame (in-case the algo cannot detect a face) \nAre you using it during training or only for the inference phase ?",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 728533,
      "author_name": "dagnelies",
      "author_url": "",
      "post_date": "01/24/2020 21:34:02",
      "content": "<p>I think normalizing brightness/contrast of the videos beforehand seem like a good idea. How exactly to do it is another question. Have you seen noticeable improvements using the brightness increase?</p>",
      "votes": null,
      "replies": [
        {
          "id": 729459,
          "author_name": "ankitsainiankit",
          "author_url": "",
          "post_date": "01/26/2020 08:25:39",
          "content": "<p>yes, as I'm using opencv face detection which is not as accuracte as mtcnn but much faster. so increasing brightness gives the accuracy same as mtcnn in less time.</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 757183,
      "author_name": "fuzhuolin",
      "author_url": "",
      "post_date": "02/26/2020 14:01:30",
      "content": "<p>Do you crop the faces and save them in jpg format?</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 757804,
      "author_name": "skylord",
      "author_url": "",
      "post_date": "02/27/2020 05:51:43",
      "content": "<p>Hi Ankit - thanks for sharing these tips ! </p>\n\n<p>I had a query regarding the pre-processing step where you increase the brightness of the frame (in-case the algo cannot detect a face) \nAre you using it during training or only for the inference phase ? </p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "727868": "### My approach\nCurrently I'm using opencv face detection with deep learning. You can check out [pyimagesearch post about face detection](https://www.pyimagesearch.com/2018/02/26/face-detection-with-opencv-and-deep-learning/). A little trick is to gradually increase brightness if we can't find the face as many Videos are very dark. I used help from this [stackoverflow question (kanat's answer).](https://stackoverflow.com/questions/57030125/automatically-adjusting-brightness-of-image-with-opencv) \n\n### How good it is\nMost of the time it performs well and is faster then MTCNN as per my testing but in some cases it can't detect a face at all. However in other frames of video it'll detect the face. \n\n### Better possibility\nIf there's a good way to take advantage of face detection over whole video as atleast some frames will get it right then we can get much better results. \n\n### Dataset with only cropped face videos\n You can check out the training part 48's cropped face videos I created at [My google drive](https://drive.google.com/open?id=1hBZ_auVT9z1-DEwDodLV4Ub7LusyZXiB). Before using the dataset you need to accept this competitions rules. I'll soon get this dataset on kaggle. Using this dataset will reduce the preprocessing and loading in ram or gpu time by a great margin but be aware that it's not perfect and every 1 of 20 videos are not of interest.\n\n### If you have any suggestion on how to take advantage of face detection over whole video or in general any other suggestion for face detection please share in comments.",
    "728533": "I think normalizing brightness/contrast of the videos beforehand seem like a good idea. How exactly to do it is another question. Have you seen noticeable improvements using the brightness increase?",
    "729459": "yes, as I'm using opencv face detection which is not as accuracte as mtcnn but much faster. so increasing brightness gives the accuracy same as mtcnn in less time.",
    "757183": "Do you crop the faces and save them in jpg format?",
    "757804": "Hi Ankit - thanks for sharing these tips ! \n\nI had a query regarding the pre-processing step where you increase the brightness of the frame (in-case the algo cannot detect a face) \nAre you using it during training or only for the inference phase ?"
  },
  "source": "meta"
}