{
  "id": 130785,
  "title": "dlip package - speed",
  "url": "/competitions/deepfake-detection-challenge/discussion/130785",
  "author_name": "",
  "post_date": "2020-02-16T11:17:21.976092600Z",
  "votes": 2,
  "comment_count": 8,
  "views": 0,
  "content": "<p>I am using dlip package for face detection but it's too slow , and there is no significant improvement by turning GPU on.\nIs there any way to speed up this process? ( without reducing image size as it affect the detection accuracy) </p>",
  "messages": [
    {
      "id": "747386",
      "postDate": "02/16/2020 11:17:21",
      "content": "<p>I am using dlip package for face detection but it's too slow , and there is no significant improvement by turning GPU on.\nIs there any way to speed up this process? ( without reducing image size as it affect the detection accuracy) </p>",
      "rawMarkdown": "I am using dlip package for face detection but it's too slow , and there is no significant improvement by turning GPU on.\nIs there any way to speed up this process? ( without reducing image size as it affect the detection accuracy)",
      "votes": null
    },
    {
      "id": "747416",
      "postDate": "02/16/2020 12:00:58",
      "content": "<p>The MTCNN model from <a href=\"https://github.com/timesler/facenet-pytorch\">https://github.com/timesler/facenet-pytorch</a> works very well. I find I can reduce the resolution of the videos by up to 25% to speed up processing without a meaningful drop in accuracy. It also runs on the GPU.</p>",
      "rawMarkdown": "The MTCNN model from https://github.com/timesler/facenet-pytorch works very well. I find I can reduce the resolution of the videos by up to 25% to speed up processing without a meaningful drop in accuracy. It also runs on the GPU.",
      "votes": null
    },
    {
      "id": "747940",
      "postDate": "02/17/2020 03:06:25",
      "content": "<p>Since dlib doesn't use a huge amount of GPU memory, you can use multiprocessing to fully utilise the GPUs. I used 4 jobs on 2 GPUs (8 jobs in total) and processed 2 million boxes over a couple of days</p>",
      "rawMarkdown": "Since dlib doesn't use a huge amount of GPU memory, you can use multiprocessing to fully utilise the GPUs. I used 4 jobs on 2 GPUs (8 jobs in total) and processed 2 million boxes over a couple of days",
      "votes": null
    },
    {
      "id": "747941",
      "postDate": "02/17/2020 03:07:38",
      "content": "<p>Many thanks James, it is at least 4 times faster . </p>",
      "rawMarkdown": "Many thanks James, it is at least 4 times faster .",
      "votes": null
    },
    {
      "id": "747950",
      "postDate": "02/17/2020 03:18:25",
      "content": "<p>Many thanks for your reply , i will try your solution later as I found James advice is good enough for me at this stat</p>",
      "rawMarkdown": "Many thanks for your reply , i will try your solution later as I found James advice is good enough for me at this stat",
      "votes": null
    },
    {
      "id": "749167",
      "postDate": "02/18/2020 11:39:15",
      "content": "<p><a href=\"/jamesphoward\">@jamesphoward</a> how do we change video resolution ?</p>",
      "rawMarkdown": "jamesphoward how do we change video resolution ?",
      "votes": null
    },
    {
      "id": "749170",
      "postDate": "02/18/2020 11:44:34",
      "content": "<p>If you read the video in frame-by-frame with openCV, you can do <code>frame = cv2.resize(frame, (new_width, new_height))</code> as you are reading in the frames.</p>",
      "rawMarkdown": "If you read the video in frame-by-frame with openCV, you can do `frame = cv2.resize(frame, (new_width, new_height))` as you are reading in the frames.",
      "votes": null
    },
    {
      "id": "754728",
      "postDate": "02/24/2020 01:27:30",
      "content": "<p><a href=\"/jamesphoward\">@jamesphoward</a> Hi! New to this competition. If you don't mind disclosing. \"Reducing the resolution of the videos by up to 25\" means cv2.resize(int(W*.75), int(H*.75))? \n    Also, MTCNN seems to output resized and warped images, not bboxs. You are just using these cropped and resized images?</p>\n\n<pre><code>Thanks in advance\n</code></pre>",
      "rawMarkdown": "jamesphoward Hi! New to this competition. If you don't mind disclosing. \"Reducing the resolution of the videos by up to 25\" means cv2.resize(int(W*.75), int(H*.75))? \n    Also, MTCNN seems to output resized and warped images, not bboxs. You are just using these cropped and resized images?\n\n    Thanks in advance",
      "votes": null
    },
    {
      "id": "754902",
      "postDate": "02/24/2020 07:37:03",
      "content": "<p>I actually meant to 25% of the original ie <code>cv2.resize(frame_in, (width*0.25, height*0.25))</code>, though I actually use 50% of the original at the moment.</p>\n\n<p>MTCNN will output bounding boxes and probabilities rather than the images if you use <code>boxes, probs = mtcnn.detect(pil_frames, landmarks=False)</code> where boxes is a list of length of number of frames, and each element is a list of faces found in the video, and each face is <code>(left, top, right, bottom)</code></p>",
      "rawMarkdown": "I actually meant to 25% of the original ie `cv2.resize(frame_in, (width*0.25, height*0.25))`, though I actually use 50% of the original at the moment.\n\nMTCNN will output bounding boxes and probabilities rather than the images if you use `boxes, probs = mtcnn.detect(pil_frames, landmarks=False)` where boxes is a list of length of number of frames, and each element is a list of faces found in the video, and each face is `(left, top, right, bottom)`",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 747416,
      "author_name": "jamesphoward",
      "author_url": "",
      "post_date": "02/16/2020 12:00:58",
      "content": "<p>The MTCNN model from <a href=\"https://github.com/timesler/facenet-pytorch\">https://github.com/timesler/facenet-pytorch</a> works very well. I find I can reduce the resolution of the videos by up to 25% to speed up processing without a meaningful drop in accuracy. It also runs on the GPU.</p>",
      "votes": null,
      "replies": [
        {
          "id": 747941,
          "author_name": "bosbos",
          "author_url": "",
          "post_date": "02/17/2020 03:07:38",
          "content": "<p>Many thanks James, it is at least 4 times faster . </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 754728,
          "author_name": "roguekk007",
          "author_url": "",
          "post_date": "02/24/2020 01:27:30",
          "content": "<p><a href=\"/jamesphoward\">@jamesphoward</a> Hi! New to this competition. If you don't mind disclosing. \"Reducing the resolution of the videos by up to 25\" means cv2.resize(int(W*.75), int(H*.75))? \n    Also, MTCNN seems to output resized and warped images, not bboxs. You are just using these cropped and resized images?</p>\n\n<pre><code>Thanks in advance\n</code></pre>",
          "votes": null,
          "replies": []
        },
        {
          "id": 754902,
          "author_name": "jamesphoward",
          "author_url": "",
          "post_date": "02/24/2020 07:37:03",
          "content": "<p>I actually meant to 25% of the original ie <code>cv2.resize(frame_in, (width*0.25, height*0.25))</code>, though I actually use 50% of the original at the moment.</p>\n\n<p>MTCNN will output bounding boxes and probabilities rather than the images if you use <code>boxes, probs = mtcnn.detect(pil_frames, landmarks=False)</code> where boxes is a list of length of number of frames, and each element is a list of faces found in the video, and each face is <code>(left, top, right, bottom)</code></p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 747940,
      "author_name": "anjum48",
      "author_url": "",
      "post_date": "02/17/2020 03:06:25",
      "content": "<p>Since dlib doesn't use a huge amount of GPU memory, you can use multiprocessing to fully utilise the GPUs. I used 4 jobs on 2 GPUs (8 jobs in total) and processed 2 million boxes over a couple of days</p>",
      "votes": null,
      "replies": [
        {
          "id": 747950,
          "author_name": "bosbos",
          "author_url": "",
          "post_date": "02/17/2020 03:18:25",
          "content": "<p>Many thanks for your reply , i will try your solution later as I found James advice is good enough for me at this stat</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 749167,
      "author_name": "jaideepvalani",
      "author_url": "",
      "post_date": "02/18/2020 11:39:15",
      "content": "<p><a href=\"/jamesphoward\">@jamesphoward</a> how do we change video resolution ?</p>",
      "votes": null,
      "replies": [
        {
          "id": 749170,
          "author_name": "jamesphoward",
          "author_url": "",
          "post_date": "02/18/2020 11:44:34",
          "content": "<p>If you read the video in frame-by-frame with openCV, you can do <code>frame = cv2.resize(frame, (new_width, new_height))</code> as you are reading in the frames.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "747386": "I am using dlip package for face detection but it's too slow , and there is no significant improvement by turning GPU on.\nIs there any way to speed up this process? ( without reducing image size as it affect the detection accuracy)",
    "747416": "The MTCNN model from https://github.com/timesler/facenet-pytorch works very well. I find I can reduce the resolution of the videos by up to 25% to speed up processing without a meaningful drop in accuracy. It also runs on the GPU.",
    "747940": "Since dlib doesn't use a huge amount of GPU memory, you can use multiprocessing to fully utilise the GPUs. I used 4 jobs on 2 GPUs (8 jobs in total) and processed 2 million boxes over a couple of days",
    "747941": "Many thanks James, it is at least 4 times faster .",
    "747950": "Many thanks for your reply , i will try your solution later as I found James advice is good enough for me at this stat",
    "749167": "jamesphoward how do we change video resolution ?",
    "749170": "If you read the video in frame-by-frame with openCV, you can do `frame = cv2.resize(frame, (new_width, new_height))` as you are reading in the frames.",
    "754728": "jamesphoward Hi! New to this competition. If you don't mind disclosing. \"Reducing the resolution of the videos by up to 25\" means cv2.resize(int(W*.75), int(H*.75))? \n    Also, MTCNN seems to output resized and warped images, not bboxs. You are just using these cropped and resized images?\n\n    Thanks in advance",
    "754902": "I actually meant to 25% of the original ie `cv2.resize(frame_in, (width*0.25, height*0.25))`, though I actually use 50% of the original at the moment.\n\nMTCNN will output bounding boxes and probabilities rather than the images if you use `boxes, probs = mtcnn.detect(pil_frames, landmarks=False)` where boxes is a list of length of number of frames, and each element is a list of faces found in the video, and each face is `(left, top, right, bottom)`"
  },
  "source": "meta"
}