Metadata-Version: 2.2
Name: nextcv
Version: 1.0.2
Summary: Python-first computer vision library with C++ bindings for speed.
Keywords: computer-vision,cpp,pybind11,scikit-build-core
Author-Email: Kevin Serrano <kserranov@gmail.com>
License: Apache-2.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C++
Classifier: Operating System :: OS Independent
Project-URL: Repository, https://github.com/kevinconka/nextcv.git
Project-URL: Issues, https://github.com/kevinconka/nextcv/issues
Requires-Python: >=3.9
Requires-Dist: numpy>=1.19.0
Requires-Dist: opencv-python>=4.4.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: pydantic<2.0.0
Requires-Dist: ensemble-boxes>=1.0.9
Provides-Extra: docs
Requires-Dist: mkdocs-material[git]>=9.6.9; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.29.0; extra == "docs"
Requires-Dist: mkdocs-gen-files>=0.5.0; extra == "docs"
Requires-Dist: mkdocs-literate-nav>=0.6.2; extra == "docs"
Requires-Dist: mkdocs-section-index>=0.3.9; extra == "docs"
Requires-Dist: mkdocs-minify-plugin>=0.8.0; extra == "docs"
Requires-Dist: griffe-fieldz>=0.2.1; extra == "docs"
Requires-Dist: griffe-pydantic>=1.1.3; extra == "docs"
Description-Content-Type: text/markdown

<div align="center">

# NextCV

**Python's ease, C++'s speed. Finally.** ⚡

</div>

<div align="center">

[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![C++17](https://img.shields.io/badge/C++-17-blue.svg)](https://en.cppreference.com/w/cpp/17)
[![Build Status](https://github.com/kevinconka/nextcv/workflows/CI/badge.svg)](https://github.com/kevinconka/nextcv/actions)

</div>

---

<div align="center">

**For those who want the full story, [read the docs](https://kevinconka.github.io/nextcv/). For everyone else, here's the gist.**

</div>

---

## What is this? 🤔

It's a computer vision library. You write Python, because you're not a masochist. But when your code inevitably becomes a bottleneck, you need speed. That's where this library can help.

**The philosophy is simple:**

> Write Python. When it's slow, make it fast with C++.

---

## Does it actually work? 🚀

Yes. Here's a Non-Maximum Suppression (NMS) benchmark. We pitted our C++ implementation against a standard NumPy version.

```python
import time
import numpy as np
from nextcv.postprocessing import nms_cpp, nms_np

# A respectable amount of data
N = 10000
rng = np.random.default_rng(42)
bboxes = rng.uniform(0, 100, (N, 4)).astype(np.float32)
scores = rng.uniform(0.1, 1, N).astype(np.float32)

# Time the C++ version
start_time = time.perf_counter()
result_cpp = nms_cpp(bboxes, scores, 0.5)
cpp_time = time.perf_counter() - start_time

# Time the NumPy version
start_time = time.perf_counter()
result_np = nms_np(bboxes, scores, 0.5)
np_time = time.perf_counter() - start_time

print("NMS Timing Comparison:")
print(f"   Dataset: {len(bboxes)} bounding boxes")
print(f"   nms_cpp(): {len(result_cpp)} boxes kept in {cpp_time * 1000:.2f}ms")
print(f"   nms_np(): {len(result_np)} boxes kept in {np_time * 1000:.2f}ms")
```

Fingers' crossed, the C++ version is significantly faster. 🎯

---

## How do I use it? 🛠️

### Prerequisites

```bash
# Ubuntu/Debian
sudo apt-get install libeigen3-dev cmake

# MacOS
brew install eigen cmake
```

### Installation 📦

```bash
pip install nextcv

# or from git
pip install git+https://github.com/kevinconka/nextcv.git

# uv
uv add nextcv
```

### Check it's working ✅

```bash
uv run python -c "import nextcv; print(nextcv.__version__)"
```

### Building from source 🔨

This project uses a dual-configuration approach to support both modern development and legacy compatibility:

- **Modern builds** (Python 3.9+): Uses `scikit-build-core` with `pyproject.toml`
- **Legacy builds** (Python 3.6...3.8): Uses `scikit-build` with `pyproject.legacy.toml` + `setup.py`

**For development:**

```bash
# create a virtual environment
python -m venv .venv
source .venv/bin/activate
pip install -e .

# or let uv handle it for you
uv sync
```

**For legacy builds (Python 3.6...3.8):**

```bash
# Copy legacy config and build
cp pyproject.legacy.toml pyproject.toml
pip install -e .
```

### Contributing 🤝

If you think you can make this better, feel free. Just don't break anything.

1.  **Fork it.**
2.  **Create a branch.** (`git checkout -b my-brilliant-idea`)
3.  **Install UV (if you don't have it yet).**

    ```bash
    curl -LsSf https://astral.sh/uv/install.sh | sh
    ```

4.  **Install C++ tools.**

    ```bash
    # macOS
    brew install clang-format llvm
    # Add LLVM to PATH (add to ~/.zshrc or ~/.bash_profile)
    echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.zshrc

    # Ubuntu/Debian
    sudo apt-get install clang-format clang-tidy
    ```

5.  **Set up the environment.**
    ```bash
    uv sync
    uvx pre-commit install
    ```
6.  **Write code.** And tests. Don't forget the tests.
7.  **Run the checks.**
    ```bash
    uv run pytest
    uvx pre-commit run --all-files
    ```
8.  **Open a pull request.** Make it a good one.

---

<div align="center">

**That's it. Now you know.** 🎉

</div>
