Skip to content

Commit 8285068

Browse files
Add headless install options (#35)
1 parent 004a999 commit 8285068

File tree

7 files changed

+19
-7
lines changed

7 files changed

+19
-7
lines changed

.conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %}
22
{% set project = pyproject.get('project') %}
33
{% set urls = pyproject.get('project', {}).get('urls') %}
4-
{% set version = environ.get('BUILD_VERSION', '0.4.2a0') %}
4+
{% set version = environ.get('BUILD_VERSION', '0.5.0a0') %}
55

66
package:
77
name: onnxtr

.github/workflows/builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install package
3131
run: |
3232
python -m pip install --upgrade pip
33-
pip install -e .[cpu,viz] --upgrade
33+
pip install -e .[cpu-headless,viz] --upgrade
3434
- name: Import package
3535
run: python -c "import onnxtr; print(onnxtr.__version__)"
3636

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
matrix:
2424
# Must match version at https://www.python.org/ftp/python/
2525
python: ["3.10.13"]
26-
system: ["cpu", "gpu"]
26+
system: ["cpu-headless", "gpu-headless"]
2727

2828
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
2929
permissions:

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip
31-
pip install -e .[cpu,viz,html,testing] --upgrade
31+
pip install -e .[cpu-headless,viz,html,testing] --upgrade
3232
- name: Run unittests
3333
run: |
3434
coverage run -m pytest tests/common/ -rs

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![codecov](https://codecov.io/gh/felixdittrich92/OnnxTR/graph/badge.svg?token=WVFRCQBOLI)](https://codecov.io/gh/felixdittrich92/OnnxTR)
88
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/4fff4d764bb14fb8b4f4afeb9587231b)](https://app.codacy.com/gh/felixdittrich92/OnnxTR/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
99
[![CodeFactor](https://www.codefactor.io/repository/github/felixdittrich92/onnxtr/badge)](https://www.codefactor.io/repository/github/felixdittrich92/onnxtr)
10-
[![Pypi](https://img.shields.io/badge/pypi-v0.4.1-blue.svg)](https://pypi.org/project/OnnxTR/)
10+
[![Pypi](https://img.shields.io/badge/pypi-v0.5.0-blue.svg)](https://pypi.org/project/OnnxTR/)
1111

1212
> :warning: Please note that this is a wrapper around the [doctr](https://github.com/mindee/doctr) library to provide a Onnx pipeline for docTR. For feature requests, which are not directly related to the Onnx pipeline, please refer to the base project.
1313
@@ -40,8 +40,10 @@ For GPU support please take a look at: [ONNX Runtime](https://onnxruntime.ai/get
4040

4141
```shell
4242
pip install "onnxtr[cpu]"
43+
pip install "onnxtr[cpu-headless]" # same as cpu but with opencv-headless
4344
# with gpu support
4445
pip install "onnxtr[gpu]"
46+
pip install "onnxtr[gpu-headless]" # same as gpu but with opencv-headless
4547
# with HTML support
4648
pip install "onnxtr[html]"
4749
# with support for visualization

pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ dependencies = [
3333
# Additional typing support is brought by numpy>=1.22.4, but core build sticks to >=1.16.0
3434
"numpy>=1.16.0,<3.0.0",
3535
"scipy>=1.4.0,<2.0.0",
36-
"opencv-python>=4.5.0,<5.0.0",
3736
"pypdfium2>=4.11.0,<5.0.0",
3837
"pyclipper>=1.2.0,<2.0.0",
3938
"shapely>=1.6.0,<3.0.0",
@@ -49,9 +48,19 @@ dependencies = [
4948
[project.optional-dependencies]
5049
cpu = [
5150
"onnxruntime>=1.11.0",
51+
"opencv-python>=4.5.0,<5.0.0",
5252
]
5353
gpu = [
5454
"onnxruntime-gpu>=1.11.0",
55+
"opencv-python>=4.5.0,<5.0.0",
56+
]
57+
cpu-headless = [
58+
"onnxruntime>=1.11.0",
59+
"opencv-python-headless>=4.5.0,<5.0.0",
60+
]
61+
gpu-headless = [
62+
"onnxruntime-gpu>=1.11.0",
63+
"opencv-python-headless>=4.5.0,<5.0.0",
5564
]
5665
html = [
5766
"weasyprint>=55.0",
@@ -73,6 +82,7 @@ quality = [
7382
dev = [
7483
# Runtime
7584
"onnxruntime>=1.11.0",
85+
"opencv-python>=4.5.0,<5.0.0",
7686
# HTML
7787
"weasyprint>=55.0",
7888
# Visualization

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from setuptools import setup
1010

1111
PKG_NAME = "onnxtr"
12-
VERSION = os.getenv("BUILD_VERSION", "0.4.2a0")
12+
VERSION = os.getenv("BUILD_VERSION", "0.5.0a0")
1313

1414

1515
if __name__ == "__main__":

0 commit comments

Comments
 (0)