Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/developer239/cv2-pytest-example


https://github.com/developer239/cv2-pytest-example

Last synced: 11 days ago
JSON representation

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/
```