Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/developer239/cv2-pytest-example
https://github.com/developer239/cv2-pytest-example
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/developer239/cv2-pytest-example
- Owner: developer239
- Created: 2024-04-13T10:42:35.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-04-13T12:25:16.000Z (7 months ago)
- Last Synced: 2024-04-14T00:45:27.013Z (7 months ago)
- Language: Python
- Size: 4.24 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Test](https://github.com/developer239/cv2-pytest-example/actions/workflows/python-app.yml/badge.svg)](https://github.com/developer239/cv2-pytest-example/actions/workflows/python-app.yml)
# Webcam Application with Face Detection
This application utilizes a webcam to display a live feed, draw a rectangle in the center, detect faces, and draw rectangles around detected faces. Additionally, it draws an arrow from the center rectangle to each detected face.
![Webcam Application Preview](preview.gif)
## Setup
### Prerequisites
- Ensure you have Conda installed on your system. If not, install it from [Conda's official site](https://www.conda.io).### Installation
1. Clone the repository or download the source code.
2. Navigate to the project directory.
3. Create the Conda environment with the required dependencies:
```
conda env create -f environment.yml
```
4. Activate the newly created environment:
```
conda activate webcam-app
```
5. **(optional)** Configure PyCharm to use the Conda environment:
- Search for current interpreter in the bottom right corner of the IDE and click the button name.
- Select 'Add Interpreter' and 'Add Local Interpreter'.
- Choose 'Conda Environment' and 'Use Existing' and select the newly created 'webcam-app' environment.## Running the Application
To start the application, execute the following command in your terminal:
```
python src/main.py
```
The application window will open displaying the webcam feed. Press 'q' to quit the application.## Running Tests
To ensure the functions are working as expected, run the unit tests with Pytest:
```
pytest tests/
```## Running Linter
To check the code for any linting errors, run the following command:
```
ruff check src/ tests/
```