Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Bug report
description: Something doesn't work the way it should.
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to file a bug report. Please fill in
everything you can — concrete repro steps + traceback make the
difference between a 10-minute fix and a 3-day investigation.
- type: input
id: version
attributes:
label: anpr-pipeline version
description: Output of `anpr version` (or `pip show anpr-pipeline`).
placeholder: "0.2.3"
validations:
required: true
- type: input
id: python
attributes:
label: Python version
placeholder: "3.13.1"
validations:
required: true
- type: input
id: os
attributes:
label: OS / arch
placeholder: "Ubuntu 24.04 x86_64 / macOS 14.6 arm64 / Docker"
validations:
required: true
- type: dropdown
id: install
attributes:
label: Install method
options:
- pip install anpr-pipeline
- docker compose
- uv sync from source
- other
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual behavior
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce
placeholder: |
1. ...
2. ...
3. ...
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs / traceback
description: Full traceback if applicable. Set ANPR_LOG_LEVEL=DEBUG if you can.
render: shell
- type: checkboxes
id: confirmations
attributes:
label: Confirmations
options:
- label: I searched existing issues for duplicates.
required: true
- label: I'm on the latest released version (or HEAD).
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Security advisory
url: https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/security/advisories/new
about: For security issues use a private advisory (see SECURITY.md).
- name: PyPI project page
url: https://pypi.org/project/anpr-pipeline/
about: Latest released version, install instructions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Feature request
description: Suggest a new capability or enhancement.
labels: ["enhancement"]
body:
- type: textarea
id: problem
attributes:
label: Problem
description: What problem are you trying to solve? What's currently missing or painful?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed solution
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
- type: checkboxes
id: privacy
attributes:
label: Privacy check (KVKK / GDPR)
description: Plates are personal data; new features must respect the existing hash-only persistence model.
options:
- label: My proposal doesn't require persisting raw plate text.
30 changes: 30 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Summary

<!-- 1-3 sentences: what does this PR change, and why? -->

## Type

- [ ] Bug fix
- [ ] New feature
- [ ] Refactor (no behavior change)
- [ ] Docs
- [ ] CI / build
- [ ] Test only

## Test plan

<!-- How did you verify this works? -->

- [ ] `make lint` clean
- [ ] `make type` clean
- [ ] `make test` green
- [ ] (if API changed) manual smoke against `anpr serve` / `/api/v1/infer`

## Related

<!-- Issues, prior PRs, RFCs -->

## Privacy / KVKK check

- [ ] No code path persists raw plate text (only `hash_plate(...)` output).
- [ ] N/A — this PR doesn't touch storage.
28 changes: 28 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CodeQL

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "32 4 * * 1" # Monday 04:32 UTC

permissions:
security-events: write
actions: read
contents: read

jobs:
analyze:
name: Analyze Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v3
with:
languages: python
queries: security-and-quality
- uses: github/codeql-action/analyze@v3
with:
category: "/language:python"
48 changes: 44 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to PyPI
name: Publish

on:
push:
Expand All @@ -7,8 +7,8 @@ on:
workflow_dispatch:

jobs:
build:
name: Build distribution
build-python:
name: Build Python distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -28,7 +28,7 @@ jobs:

publish-pypi:
name: Publish to PyPI
needs: build
needs: build-python
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
environment:
Expand All @@ -43,3 +43,43 @@ jobs:
path: dist/
- name: Publish via OIDC trusted publishing
uses: pypa/gh-action-pypi-publish@release/v1

publish-docker:
name: Publish Docker image to GHCR
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Image metadata + tags
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/anpr-pipeline
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
labels: |
org.opencontainers.image.title=anpr-pipeline
org.opencontainers.image.description=Automatic Number Plate Recognition pipeline (fast-alpr + fast-plate-ocr + FastAPI)
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.licenses=MIT
- name: Build + push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
93 changes: 93 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Changelog

All notable changes are documented here. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: [SemVer](https://semver.org/).

## [Unreleased]

## [0.2.3] — 2026-05-10

### Fixed

- `anpr.__version__` was returning `0.0.0+unknown` for installed users — the
package queried `importlib.metadata.version("anpr")` while the distribution
name on PyPI is `anpr-pipeline`. Now correctly reports the installed
version. ([#25](https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/pull/25))

## [0.2.2] — 2026-05-10

### Fixed

- Source distribution size: hatchling's default file sweep was including the
150MB `legacy/` tree, blowing past PyPI's 100MB project limit. An explicit
`[tool.hatch.build.targets.sdist].include` allow-list now produces a 36 KB
sdist. ([#24](https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/pull/24))

## [0.2.1] — 2026-05-10 [YANKED]

First PyPI publish attempt. The sdist exceeded PyPI's size limit; only the
wheel uploaded before the sdist upload failed. Yanked — use 0.2.2+.

### Added

- Distribution renamed `anpr` → `anpr-pipeline` (the import name remains
`anpr`).
- GitHub Actions publish workflow via OIDC trusted publishing.
- README PyPI badge + `pip install anpr-pipeline` quickstart. ([#19](https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/pull/19))

## [0.2.0] — 2026-05-10

Initial release of the 2026 modernization. Full rewrite of the 2022 YOLOv5 +
EasyOCR + Flask 1.1 pipeline. The original code is preserved verbatim under
[`legacy/`](legacy/) and tagged [`v0.1.0-legacy`](https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/releases/tag/v0.1.0-legacy).

### Added

- `fast-alpr` 0.4 / YOLOv9-t-384 ONNX plate detector (MIT, 65+ countries).
- `fast-plate-ocr` 1.1 / `cct-s-v2-global-model` OCR (MIT, sub-millisecond GPU
with per-character confidences).
- Dependency-free IoU greedy tracker (`Tracker` Protocol allows swap to
ByteTrack / BoT-SORT).
- Position-aware OCR confusion-pair correction (0/O, 1/I/L, 5/S, 8/B, 2/Z,
6/G, 0/D/Q) keyed on the Turkish plate format.
- Per-track temporal majority voting (top-K confidence-weighted, per-character
position).
- Turkish-plate parser covering all 81 province codes.
- FastAPI 0.115 + uvicorn HTTP/WebSocket API with async streaming pipeline,
bounded queue + drop-on-full backpressure.
- SQLModel storage with HMAC-SHA256 plate hashing (KVKK + GDPR aware; raw
plate text is never persisted). Background retention worker.
- `structlog` + Prometheus `/metrics` + opt-in OpenTelemetry instrumentation.
- Multi-stage Dockerfile + `docker-compose.yml`.
- GitHub Actions CI: matrix on Python 3.11 / 3.12 / 3.13 + ruff + pyright +
pytest + Docker smoke.
- 60+ tests (unit + integration + Hypothesis property tests).
- `pydantic-settings`-driven config (`.env` + `ANPR_*` env vars).
- typer CLI: `anpr serve | infer | dump-config | generate-pepper | version`.
- Modernized README + KVKK Aydınlatma Metni şablonu.

### Removed

- Vendored YOLOv5 fork (~7900 LOC under `utils/` + `models/`).
- EasyOCR 1.4 + PaddleOCR + Tesseract triple-OCR layer.
- Flask 1.1.2 + Werkzeug stack (CVE-laden).
- `helper/params.py` ≡ `utils/params.py` byte-identical duplicates.
- Hardcoded `/home/mef/Documents/plate_detection_project/best.pt`.
- CSV plate-text persistence (replaced by hashed SQLite via SQLModel).

### Migration

- Entry points changed: `python main.py` → `anpr serve`; `python app.py`
removed in favor of the FastAPI app.
- Pinning to the 2022 pipeline: `git checkout v0.1.0-legacy`.

### Merged in this release

- [#16](https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/pull/16) — F0–F7 (scaffold + pipeline + API + storage + tests)
- [#17](https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/pull/17) — F8 (Docker + CI matrix)
- [#18](https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/pull/18) — F9 (README + KVKK template)

[Unreleased]: https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/compare/v0.2.3...HEAD
[0.2.3]: https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/compare/v0.2.2...v0.2.3
[0.2.2]: https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/compare/v0.2.1...v0.2.2
[0.2.1]: https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/mftnakrsu/Automatic_Number_Plate_Recognition_YOLO_OCR/releases/tag/v0.2.0
Loading
Loading