Skip to content

Commit

Permalink
feat: update onnxruntime to 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
CuriousDolphin committed Nov 29, 2024
1 parent 6903082 commit f948ec8
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 228 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ jobs:
file_pattern: pyproject.toml
# Step 4: Attendere che il commit sia sincronizzato su GitHub
- name: Wait for commit sync
run: sleep 15
run: sleep 10
- uses: actions/checkout@v4
# Step 5: Creare e taggare la nuova versione
- name: Tag version

id: tag_version
uses: mathieudutour/[email protected]
with:
Expand All @@ -49,4 +48,4 @@ jobs:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
generateReleaseNotes: true
generateReleaseNotes: true
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: make install-dev
run: pip install .[dev]
- name: Run test
run: make test
- name: Pytest coverage comment
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ ipython_config.py
notebooks/.data
.venv
/data
tests/junit.xml
tests/junit.xml
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true
}
}
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
install:
@pip install . --no-cache-dir
install-dev:
@pip install -e ".[inference,dev]" --no-cache-dir
@pip install -e ".[dev]" --no-cache-dir

install-pre-commit:
@pre-commit install


lint:
@isort . --profile=black
@black .
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,29 @@

# Focoos SDK


## Requirements
For **local inference**, ensure that you have CUDA 12 and cuDNN 9 installed, as they are required for onnxruntime version 1.20.1.

To install cuDNN 9:
```bash
apt-get -y install cudnn9-cuda-12
```

To perform inference using TensorRT, ensure you have TensorRT version 10.5 installed.

# Install

```bash
pip install .
```

- local inference (CPU, COREML): `pip install .[inference]`
- local inference with GPU (CUDA): `pip install .[inference-gpu]`
- local inference (CPU, COREML): `pip install .`
- local inference with GPU (CUDA): `pip install .[gpu]`


## 🤖 Cloud Inference

```python
from focoos import Focoos

Expand Down
1 change: 0 additions & 1 deletion focoos/ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ class LatencyMetrics:

class RuntimeTypes(str, Enum):
ONNX_CUDA32 = "onnx_cuda32"
ONNX_CUDA16 = "onnx_cuda16"
ONNX_TRT32 = "onnx_trt32"
ONNX_TRT16 = "onnx_trt16"
ONNX_CPU = "onnx_cpu"
Expand Down
4 changes: 0 additions & 4 deletions focoos/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,6 @@ def get_runtime(
opts = OnnxEngineOpts(
cuda=True, verbose=False, fp16=False, warmup_iter=warmup_iter
)
elif runtime_type == RuntimeTypes.ONNX_CUDA16:
opts = OnnxEngineOpts(
cuda=True, verbose=False, fp16=True, warmup_iter=warmup_iter
)
elif runtime_type == RuntimeTypes.ONNX_TRT32:
opts = OnnxEngineOpts(
cuda=False, verbose=False, trt=True, fp16=False, warmup_iter=warmup_iter
Expand Down
4 changes: 1 addition & 3 deletions gradio/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
focoos_models = []
focoos = Focoos(api_key=os.getenv("FOCOOS_API_KEY"))
focoos_models = [
model["ref"]
for model in focoos.list_focoos_models()
if model["status"] == "DEPLOYED"
model.ref for model in focoos.list_focoos_models() if model.status == "DEPLOYED"
]
loaded_models = {}
image_examples = [
Expand Down
243 changes: 37 additions & 206 deletions notebooks/playground.ipynb

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies = [
"tqdm~=4.67.1",
"numpy~=1.26.4",
"scipy~=1.14.1",
"onnxruntime==1.20.1"
]

authors = [{ name = "focoos.ai", email = "[email protected]" }]
Expand All @@ -42,6 +43,4 @@ dev = [
"gradio~=5.3.0",
"sniffio~=1.2.0",
]

inference = ["onnxruntime==1.18.0"]
inference-gpu = ["onnxruntime-gpu==1.18.0"]
gpu = ["onnxruntime-gpu==1.20.1"]

0 comments on commit f948ec8

Please sign in to comment.