Step by step Face Mask Detector in Windows
If you find this content useful, please send me "Super Thanks"
Requirement:
- Windows 10
- Webcam
Please follow these steps:
1. Download Python
Download : [ Ссылка ]
2. Install Python
Tick add path
Make new folder on D, example: Python38
Point install on that folder
3. Check python and upgrade pip
$ python --version
$ pip --version
$ python -m pip install -–upgrade pip
4. Install numpy
$ pip install numpy
5. Install opencv
$ pip install opencv-contrib-python-headless
6. Check installed opencv
$ python
$ import cv2
$ cv2.__version__
7. Install tensorflow
$ pip install --upgrade tensorflow
check tensorflow
$ python
$ import tensorflow as tf
8. Install imutils
$ pip install imutils
9. For face mask detection, we must update the libraries suitable for face mask detection
$ pip install face-mask-detector
10. Download python code from github
[ Ссылка ]
11. Trial python code
Open cmd, run as administrator
Change directory to python code folder location using cd syntax
$ python detect_mask_video.py
If you get error while running face mask detection
Edit python file
if you get error like this: "cv2.error: OpenCV(4.5.2) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-er8x_mh_\opencv\modules\highgui\src\window.cpp:679: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'"
Just reinstall opencv
$ pip uninstall opencv-python
then
$ pip install opencv-python
![](https://i.ytimg.com/vi/IODSi0hpEwQ/maxresdefault.jpg)