This project is a Streamlit web application that detects whether a person is wearing a face mask using a Convolutional Neural Network (CNN). The application offers three options for input: uploading an image, entering an image URL, or capturing a live image using a webcam.
- Image Upload: Upload an image from your device, and the app will classify whether the person in the image is wearing a mask or not.
- URL Input: Enter the URL of an image, and the app will fetch and classify the image.
- Live Image Capture: Capture a live image from your webcam and classify it.
-
Clone the repository:
git clone https://github.com/alihassanml/Face-mask-detection-By-CNN.git
-
Navigate to the project directory:
cd Face-mask-detection-By-CNN
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Run the Streamlit application:
streamlit run your_app.py
-
Open your web browser and go to the URL provided by Streamlit (usually http://localhost:8501).
-
Select the input method from the sidebar:
- Image Upload: Upload an image file.
- URL Input: Enter the URL of an image.
- Live Image Capture: Capture an image from your webcam.
- Python 3.x
- TensorFlow
- OpenCV
- Pillow
- Requests
- Streamlit
- NumPy
You can find the requirements.txt
file in the repository to install all dependencies.
- LinkedIn: Ali Hassan
- GitHub: alihassanml
Developed by: Ali Hassan