Skip to content

Commit 8a384e2

Browse files
authored
Merge pull request #6 from ankandrew/ankandrew/0.3.0
Make ONNX variants optional
2 parents 69007bb + c5405eb commit 8a384e2

File tree

8 files changed

+553
-550
lines changed

8 files changed

+553
-550
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
cache: 'poetry'
3030

3131
- name: Install dependencies
32-
run: poetry install --all-extras
32+
run: make install
3333

3434
- name: Check format
3535
run: make check_format

.github/workflows/secret-scanning.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ jobs:
1717
fetch-depth: 0
1818
- name: Secret Scanning
1919
uses: trufflesecurity/trufflehog@main
20+
with:
21+
extra_args: --results=verified,unknown

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SRC_PATHS := open_image_models/ test/
66
help:
77
@echo "Available targets:"
88
@echo " help : Show this help message"
9+
@echo " install : Install project with all dev/test/docs/train dependencies"
910
@echo " format : Format code using Ruff format"
1011
@echo " check_format : Check code formatting with Ruff format"
1112
@echo " ruff : Run Ruff linter"
@@ -16,6 +17,10 @@ help:
1617
@echo " checks : Check format, lint, and test"
1718
@echo " clean : Clean up caches and build artifacts"
1819

20+
install:
21+
@echo "==> Installing project with dev/test/docs/train dependencies..."
22+
poetry install --with dev,test,docs
23+
1924
.PHONY: format
2025
format:
2126
@echo "==> Sorting imports..."

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ To install open-image-models via pip, use the following command:
5757
pip install open-image-models
5858
```
5959

60+
> [!NOTE]
61+
> To install with GPU or hardware acceleration support, use: `pip install open-image-models[gpu]`. The following
62+
> optional extras are available: `gpu`, `openvino`, `directml`, and `qnn`.
63+
6064
## Available Models
6165

6266
### Object Detection
@@ -124,7 +128,7 @@ To start contributing or to begin development, you can follow these steps:
124128
```
125129
2. Install all dependencies using [Poetry](https://python-poetry.org/docs/#installation):
126130
```shell
127-
poetry install --all-extras
131+
make install
128132
```
129133
3. To ensure your changes pass linting and tests before submitting a PR:
130134
```shell

docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To start contributing or to begin development, you can follow these steps:
99
```
1010
2. Install all dependencies using [Poetry](https://python-poetry.org/docs/#installation):
1111
```shell
12-
poetry install --all-extras
12+
make install
1313
```
1414
3. To ensure your changes pass linting and tests before submitting a PR:
1515
```shell

docs/installation.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ pip install open-image-models
55
```
66

77
???+ info
8-
Currently, **ONNX** framework is used to run the models. When installing `open-image-models`, the corresponding
9-
version **GPU**/**CPU** should be installed based on your machine architecture.
8+
The models currently run using the ONNX framework. Depending on your system, you may want to install support for GPU
9+
or other hardware accelerators. Use optional extras like `gpu`, `openvino`, `directml`, or `qnn` to tailor the
10+
installation to your machine. For example: `pip install open-image-models[gpu]`.

poetry.lock

Lines changed: 519 additions & 533 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "open-image-models"
3-
version = "0.2.2"
3+
version = "0.3.0"
44
description = "Pre-trained image models using ONNX for fast, out-of-the-box inference."
55
authors = ["ankandrew <[email protected]>"]
66
readme = "README.md"
@@ -31,23 +31,23 @@ classifiers = [
3131

3232
[tool.poetry.dependencies]
3333
python = "^3.10"
34-
numpy = ">=1.20"
35-
# Install onnxruntime-gpu only on systems other than macOS or Raspberry Pi
36-
onnxruntime-gpu = { version = ">=1.19.2", markers = "sys_platform != 'darwin' and platform_machine != 'armv7l' and platform_machine != 'aarch64' and (platform_system == 'Linux' or platform_system == 'Windows')" }
37-
# Fallback to onnxruntime for macOS, Raspberry Pi, and other unsupported platforms
38-
onnxruntime = { version = ">=1.19.2", markers = "sys_platform == 'darwin' or platform_machine == 'armv7l' or platform_machine == 'aarch64'" }
34+
numpy = "*"
35+
onnxruntime = { version = ">=1.19.2" }
3936
opencv-python = "*"
4037
tqdm = "*"
4138
rich = "*"
4239

43-
44-
# Optional packages for creating the docs
45-
mkdocs-material = { version = "*", optional = true }
46-
mkdocstrings = { version = "*", extras = ["python"], optional = true }
47-
mike = { version = "*", optional = true }
40+
# ONNX package variants (for different hardware accelerator)
41+
onnxruntime-gpu = { version = "*", optional = true }
42+
onnxruntime-openvino = { version = "*", optional = true }
43+
onnxruntime-directml = { version = "*", optional = true }
44+
onnxruntime-qnn = { version = "*", optional = true }
4845

4946
[tool.poetry.extras]
50-
docs = ["mkdocs-material", "mkdocstrings", "mike"]
47+
gpu = ["onnxruntime-gpu"]
48+
openvino = ["onnxruntime-openvino"]
49+
directml = ["onnxruntime-directml"]
50+
qnn = ["onnxruntime-qnn"]
5151

5252
[tool.poetry.group.test.dependencies]
5353
pytest = "*"
@@ -58,6 +58,11 @@ mypy = "*"
5858
ruff = "*"
5959
pylint = "*"
6060

61+
[tool.poetry.group.docs.dependencies]
62+
mkdocs-material = "*"
63+
mkdocstrings = { version = "*", extras = ["python"] }
64+
mike = "*"
65+
6166
[tool.ruff]
6267
line-length = 120
6368
target-version = "py310"

0 commit comments

Comments
 (0)