# Face Detection slow from video

**URL:** <https://forum.opencv.org/t/face-detection-slow-from-video/1179>\
**Category:** Python\
**Tags:** cuda, objdetect\
**Created:** [January 28, 2021, 3:03pm UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179 "2021-01-28T15:03:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankur\_Gupta](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ankur_gupta/32/787_2.png) [@Ankur\_Gupta](https://forum.opencv.org/u/Ankur_Gupta)\
**Post date:** [January 28, 2021, 3:03pm UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/1 "2021-01-28T15:03:27Z")

</div>

![143284097_1820655921466177_7486997300296980713_n](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/1X/6c68a7e003465552ad58f0bee57af87ed69def0c.jpeg)

Face detection slow from video.  
how can use CV.cuda in python?

---

<div class="post-metadata">

**Author:** ![laurent.berger](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@laurent.berger](https://forum.opencv.org/u/laurent.berger)\
**Post date:** [January 28, 2021, 3:34pm UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/2 "2021-01-28T15:34:13Z")

</div>

Please don’t post your code as an image.  
If you want to use cuda in opencv you have to build opencv yourself using cmake

---

<div class="post-metadata">

**Author:** ![Ankur\_Gupta](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ankur_gupta/32/787_2.png) [@Ankur\_Gupta](https://forum.opencv.org/u/Ankur_Gupta)\
**Post date:** [January 28, 2021, 4:32pm UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/3 "2021-01-28T16:32:38Z")

</div>

yes i have build by using cmake. and build is successful.

but actually the problem is can’t abe to use function and import function.

if any reference code to use in python pls help.

i don’t know how to take reference from C++

---

<div class="post-metadata">

**Author:** ![laurent.berger](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@laurent.berger](https://forum.opencv.org/u/laurent.berger)\
**Post date:** [January 28, 2021, 4:53pm UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/4 "2021-01-28T16:53:17Z")

</div>

face\_cascade using cuda it’s [here](https://docs.opencv.org/master/d9/d80/classcv_1_1cuda_1_1CascadeClassifier.html) but I cannot find any python binding

---

<div class="post-metadata">

**Author:** ![Ankur\_Gupta](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ankur_gupta/32/787_2.png) [@Ankur\_Gupta](https://forum.opencv.org/u/Ankur_Gupta)\
**Post date:** [January 29, 2021, 12:10pm UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/5 "2021-01-29T12:10:04Z")

</div>

hi Thanks for this link. i already went thru is link and reference.

but don’t know how to use this cuda with open cv in python.

if any lead pls help me to do so .

---

<div class="post-metadata">

**Author:** ![Vanleonard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/vanleonard/32/798_2.png) [@Vanleonard](https://forum.opencv.org/u/Vanleonard)\
**Post date:** [February 1, 2021, 5:36pm UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/6 "2021-02-01T17:36:16Z")

</div>

Thanks for sharing the tutorial link, but it still hasn’t helped me to make modifications in python

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [February 1, 2021, 9:05pm UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/7 "2021-02-01T21:05:07Z")

</div>

welcome.

what modifications would those be and why do you have trouble with them?

be aware of what has been said: there are no python bindings for that specific API (cascade classifier for cuda).

---

<div class="post-metadata">

**Author:** ![Supra](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/supra/32/91_2.png) [@Supra](https://forum.opencv.org/u/Supra)\
**Post date:** [February 2, 2021, 10:13am UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/8 "2021-02-02T10:13:10Z")

</div>

R u using raspberry pi?

---

<div class="post-metadata">

**Author:** ![Supra](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/supra/32/91_2.png) [@Supra](https://forum.opencv.org/u/Supra)\
**Post date:** [February 2, 2021, 10:15am UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/9 "2021-02-02T10:15:50Z")

</div>

If u can post the code. We can help u.

---

<div class="post-metadata">

**Author:** ![Ankur\_Gupta](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ankur_gupta/32/787_2.png) [@Ankur\_Gupta](https://forum.opencv.org/u/Ankur_Gupta)\
**Post date:** [February 3, 2021, 1:24pm UTC](https://forum.opencv.org/t/face-detection-slow-from-video/1179/10 "2021-02-03T13:24:29Z")

</div>

no, i am not using raspberry pi. i am using python.

i have created open cv with cuda build by using Cmake.
