feat: add Gradio app for ONNX model
Browse files- .gitignore +335 -0
- BEN2_Base.onnx +3 -0
- app.py +140 -0
- pyproject.toml +1 -1
- requirements.txt +2 -0
- uv.lock +88 -36
.gitignore
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Created by https://www.toptal.com/developers/gitignore/api/python,pycharm,pythonvanilla,visualstudiocode
|
| 2 |
+
# Edit at https://www.toptal.com/developers/gitignore?templates=python,pycharm,pythonvanilla,visualstudiocode
|
| 3 |
+
|
| 4 |
+
### PyCharm ###
|
| 5 |
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
| 6 |
+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
| 7 |
+
|
| 8 |
+
# User-specific stuff
|
| 9 |
+
.idea/**/workspace.xml
|
| 10 |
+
.idea/**/tasks.xml
|
| 11 |
+
.idea/**/usage.statistics.xml
|
| 12 |
+
.idea/**/dictionaries
|
| 13 |
+
.idea/**/shelf
|
| 14 |
+
|
| 15 |
+
# AWS User-specific
|
| 16 |
+
.idea/**/aws.xml
|
| 17 |
+
|
| 18 |
+
# Generated files
|
| 19 |
+
.idea/**/contentModel.xml
|
| 20 |
+
|
| 21 |
+
# Sensitive or high-churn files
|
| 22 |
+
.idea/**/dataSources/
|
| 23 |
+
.idea/**/dataSources.ids
|
| 24 |
+
.idea/**/dataSources.local.xml
|
| 25 |
+
.idea/**/sqlDataSources.xml
|
| 26 |
+
.idea/**/dynamic.xml
|
| 27 |
+
.idea/**/uiDesigner.xml
|
| 28 |
+
.idea/**/dbnavigator.xml
|
| 29 |
+
|
| 30 |
+
# Gradle
|
| 31 |
+
.idea/**/gradle.xml
|
| 32 |
+
.idea/**/libraries
|
| 33 |
+
|
| 34 |
+
# Gradle and Maven with auto-import
|
| 35 |
+
# When using Gradle or Maven with auto-import, you should exclude module files,
|
| 36 |
+
# since they will be recreated, and may cause churn. Uncomment if using
|
| 37 |
+
# auto-import.
|
| 38 |
+
# .idea/artifacts
|
| 39 |
+
# .idea/compiler.xml
|
| 40 |
+
# .idea/jarRepositories.xml
|
| 41 |
+
# .idea/modules.xml
|
| 42 |
+
# .idea/*.iml
|
| 43 |
+
# .idea/modules
|
| 44 |
+
# *.iml
|
| 45 |
+
# *.ipr
|
| 46 |
+
|
| 47 |
+
# CMake
|
| 48 |
+
cmake-build-*/
|
| 49 |
+
|
| 50 |
+
# Mongo Explorer plugin
|
| 51 |
+
.idea/**/mongoSettings.xml
|
| 52 |
+
|
| 53 |
+
# File-based project format
|
| 54 |
+
*.iws
|
| 55 |
+
|
| 56 |
+
# IntelliJ
|
| 57 |
+
out/
|
| 58 |
+
|
| 59 |
+
# mpeltonen/sbt-idea plugin
|
| 60 |
+
.idea_modules/
|
| 61 |
+
|
| 62 |
+
# JIRA plugin
|
| 63 |
+
atlassian-ide-plugin.xml
|
| 64 |
+
|
| 65 |
+
# Cursive Clojure plugin
|
| 66 |
+
.idea/replstate.xml
|
| 67 |
+
|
| 68 |
+
# SonarLint plugin
|
| 69 |
+
.idea/sonarlint/
|
| 70 |
+
|
| 71 |
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
| 72 |
+
com_crashlytics_export_strings.xml
|
| 73 |
+
crashlytics.properties
|
| 74 |
+
crashlytics-build.properties
|
| 75 |
+
fabric.properties
|
| 76 |
+
|
| 77 |
+
# Editor-based Rest Client
|
| 78 |
+
.idea/httpRequests
|
| 79 |
+
|
| 80 |
+
# Android studio 3.1+ serialized cache file
|
| 81 |
+
.idea/caches/build_file_checksums.ser
|
| 82 |
+
|
| 83 |
+
### PyCharm Patch ###
|
| 84 |
+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
| 85 |
+
|
| 86 |
+
# *.iml
|
| 87 |
+
# modules.xml
|
| 88 |
+
# .idea/misc.xml
|
| 89 |
+
# *.ipr
|
| 90 |
+
|
| 91 |
+
# Sonarlint plugin
|
| 92 |
+
# https://plugins.jetbrains.com/plugin/7973-sonarlint
|
| 93 |
+
.idea/**/sonarlint/
|
| 94 |
+
|
| 95 |
+
# SonarQube Plugin
|
| 96 |
+
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
|
| 97 |
+
.idea/**/sonarIssues.xml
|
| 98 |
+
|
| 99 |
+
# Markdown Navigator plugin
|
| 100 |
+
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
|
| 101 |
+
.idea/**/markdown-navigator.xml
|
| 102 |
+
.idea/**/markdown-navigator-enh.xml
|
| 103 |
+
.idea/**/markdown-navigator/
|
| 104 |
+
|
| 105 |
+
# Cache file creation bug
|
| 106 |
+
# See https://youtrack.jetbrains.com/issue/JBR-2257
|
| 107 |
+
.idea/$CACHE_FILE$
|
| 108 |
+
|
| 109 |
+
# CodeStream plugin
|
| 110 |
+
# https://plugins.jetbrains.com/plugin/12206-codestream
|
| 111 |
+
.idea/codestream.xml
|
| 112 |
+
|
| 113 |
+
# Azure Toolkit for IntelliJ plugin
|
| 114 |
+
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
|
| 115 |
+
.idea/**/azureSettings.xml
|
| 116 |
+
|
| 117 |
+
### Python ###
|
| 118 |
+
# Byte-compiled / optimized / DLL files
|
| 119 |
+
__pycache__/
|
| 120 |
+
*.py[cod]
|
| 121 |
+
*$py.class
|
| 122 |
+
|
| 123 |
+
# C extensions
|
| 124 |
+
*.so
|
| 125 |
+
|
| 126 |
+
# Distribution / packaging
|
| 127 |
+
.Python
|
| 128 |
+
build/
|
| 129 |
+
develop-eggs/
|
| 130 |
+
dist/
|
| 131 |
+
downloads/
|
| 132 |
+
eggs/
|
| 133 |
+
.eggs/
|
| 134 |
+
lib/
|
| 135 |
+
lib64/
|
| 136 |
+
parts/
|
| 137 |
+
sdist/
|
| 138 |
+
var/
|
| 139 |
+
wheels/
|
| 140 |
+
share/python-wheels/
|
| 141 |
+
*.egg-info/
|
| 142 |
+
.installed.cfg
|
| 143 |
+
*.egg
|
| 144 |
+
MANIFEST
|
| 145 |
+
|
| 146 |
+
# PyInstaller
|
| 147 |
+
# Usually these files are written by a python script from a template
|
| 148 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 149 |
+
*.manifest
|
| 150 |
+
*.spec
|
| 151 |
+
|
| 152 |
+
# Installer logs
|
| 153 |
+
pip-log.txt
|
| 154 |
+
pip-delete-this-directory.txt
|
| 155 |
+
|
| 156 |
+
# Unit test / coverage reports
|
| 157 |
+
htmlcov/
|
| 158 |
+
.tox/
|
| 159 |
+
.nox/
|
| 160 |
+
.coverage
|
| 161 |
+
.coverage.*
|
| 162 |
+
.cache
|
| 163 |
+
nosetests.xml
|
| 164 |
+
coverage.xml
|
| 165 |
+
*.cover
|
| 166 |
+
*.py,cover
|
| 167 |
+
.hypothesis/
|
| 168 |
+
.pytest_cache/
|
| 169 |
+
cover/
|
| 170 |
+
|
| 171 |
+
# Translations
|
| 172 |
+
*.mo
|
| 173 |
+
*.pot
|
| 174 |
+
|
| 175 |
+
# Django stuff:
|
| 176 |
+
*.log
|
| 177 |
+
local_settings.py
|
| 178 |
+
db.sqlite3
|
| 179 |
+
db.sqlite3-journal
|
| 180 |
+
|
| 181 |
+
# Flask stuff:
|
| 182 |
+
instance/
|
| 183 |
+
.webassets-cache
|
| 184 |
+
|
| 185 |
+
# Scrapy stuff:
|
| 186 |
+
.scrapy
|
| 187 |
+
|
| 188 |
+
# Sphinx documentation
|
| 189 |
+
docs/_build/
|
| 190 |
+
|
| 191 |
+
# PyBuilder
|
| 192 |
+
.pybuilder/
|
| 193 |
+
target/
|
| 194 |
+
|
| 195 |
+
# Jupyter Notebook
|
| 196 |
+
.ipynb_checkpoints
|
| 197 |
+
|
| 198 |
+
# IPython
|
| 199 |
+
profile_default/
|
| 200 |
+
ipython_config.py
|
| 201 |
+
|
| 202 |
+
# pyenv
|
| 203 |
+
# For a library or package, you might want to ignore these files since the code is
|
| 204 |
+
# intended to run in multiple environments; otherwise, check them in:
|
| 205 |
+
# .python-version
|
| 206 |
+
|
| 207 |
+
# pipenv
|
| 208 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 209 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 210 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 211 |
+
# install all needed dependencies.
|
| 212 |
+
#Pipfile.lock
|
| 213 |
+
|
| 214 |
+
# poetry
|
| 215 |
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
| 216 |
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
| 217 |
+
# commonly ignored for libraries.
|
| 218 |
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
| 219 |
+
#poetry.lock
|
| 220 |
+
|
| 221 |
+
# pdm
|
| 222 |
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
| 223 |
+
#pdm.lock
|
| 224 |
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
| 225 |
+
# in version control.
|
| 226 |
+
# https://pdm.fming.dev/#use-with-ide
|
| 227 |
+
.pdm.toml
|
| 228 |
+
|
| 229 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
| 230 |
+
__pypackages__/
|
| 231 |
+
|
| 232 |
+
# Celery stuff
|
| 233 |
+
celerybeat-schedule
|
| 234 |
+
celerybeat.pid
|
| 235 |
+
|
| 236 |
+
# SageMath parsed files
|
| 237 |
+
*.sage.py
|
| 238 |
+
|
| 239 |
+
# Environments
|
| 240 |
+
.env
|
| 241 |
+
.venv
|
| 242 |
+
env/
|
| 243 |
+
venv/
|
| 244 |
+
ENV/
|
| 245 |
+
env.bak/
|
| 246 |
+
venv.bak/
|
| 247 |
+
|
| 248 |
+
# Spyder project settings
|
| 249 |
+
.spyderproject
|
| 250 |
+
.spyproject
|
| 251 |
+
|
| 252 |
+
# Rope project settings
|
| 253 |
+
.ropeproject
|
| 254 |
+
|
| 255 |
+
# mkdocs documentation
|
| 256 |
+
/site
|
| 257 |
+
|
| 258 |
+
# mypy
|
| 259 |
+
.mypy_cache/
|
| 260 |
+
.dmypy.json
|
| 261 |
+
dmypy.json
|
| 262 |
+
|
| 263 |
+
# Pyre type checker
|
| 264 |
+
.pyre/
|
| 265 |
+
|
| 266 |
+
# pytype static type analyzer
|
| 267 |
+
.pytype/
|
| 268 |
+
|
| 269 |
+
# Cython debug symbols
|
| 270 |
+
cython_debug/
|
| 271 |
+
|
| 272 |
+
# PyCharm
|
| 273 |
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
| 274 |
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
| 275 |
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
| 276 |
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
| 277 |
+
#.idea/
|
| 278 |
+
|
| 279 |
+
### Python Patch ###
|
| 280 |
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
| 281 |
+
poetry.toml
|
| 282 |
+
|
| 283 |
+
# ruff
|
| 284 |
+
.ruff_cache/
|
| 285 |
+
|
| 286 |
+
# LSP config files
|
| 287 |
+
pyrightconfig.json
|
| 288 |
+
|
| 289 |
+
### PythonVanilla ###
|
| 290 |
+
# Byte-compiled / optimized / DLL files
|
| 291 |
+
|
| 292 |
+
# C extensions
|
| 293 |
+
|
| 294 |
+
# Distribution / packaging
|
| 295 |
+
|
| 296 |
+
# Installer logs
|
| 297 |
+
|
| 298 |
+
# Unit test / coverage reports
|
| 299 |
+
|
| 300 |
+
# Translations
|
| 301 |
+
|
| 302 |
+
# pyenv
|
| 303 |
+
# For a library or package, you might want to ignore these files since the code is
|
| 304 |
+
# intended to run in multiple environments; otherwise, check them in:
|
| 305 |
+
# .python-version
|
| 306 |
+
|
| 307 |
+
# pipenv
|
| 308 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 309 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 310 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 311 |
+
# install all needed dependencies.
|
| 312 |
+
|
| 313 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
| 314 |
+
|
| 315 |
+
|
| 316 |
+
### VisualStudioCode ###
|
| 317 |
+
.vscode/*
|
| 318 |
+
!.vscode/settings.json
|
| 319 |
+
!.vscode/tasks.json
|
| 320 |
+
!.vscode/launch.json
|
| 321 |
+
!.vscode/extensions.json
|
| 322 |
+
!.vscode/*.code-snippets
|
| 323 |
+
|
| 324 |
+
# Local History for Visual Studio Code
|
| 325 |
+
.history/
|
| 326 |
+
|
| 327 |
+
# Built Visual Studio Code Extensions
|
| 328 |
+
*.vsix
|
| 329 |
+
|
| 330 |
+
### VisualStudioCode Patch ###
|
| 331 |
+
# Ignore all local history of files
|
| 332 |
+
.history
|
| 333 |
+
.ionide
|
| 334 |
+
|
| 335 |
+
# End of https://www.toptal.com/developers/gitignore/api/python,pycharm,pythonvanilla,visualstudiocode
|
BEN2_Base.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:22cea62108ff53b7ccc20f7a008bf30494228d84b1687f29ecbe76936a998101
|
| 3 |
+
size 222932053
|
app.py
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import functools
|
| 2 |
+
import re
|
| 3 |
+
import tempfile
|
| 4 |
+
from dataclasses import dataclass
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
from typing import Final, cast
|
| 7 |
+
|
| 8 |
+
import cv2
|
| 9 |
+
import gradio as gr
|
| 10 |
+
import numpy as np
|
| 11 |
+
import onnx
|
| 12 |
+
import onnxruntime as ort
|
| 13 |
+
|
| 14 |
+
SCRIPT_DIR = Path(__file__).resolve().parent
|
| 15 |
+
ONNX_MODEL_PATH = SCRIPT_DIR / "BEN2_Base.onnx"
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
@dataclass(frozen=True)
|
| 19 |
+
class PreallocatedBuffers:
|
| 20 |
+
resized_image: np.ndarray
|
| 21 |
+
input_batch: np.ndarray
|
| 22 |
+
|
| 23 |
+
def __init__(self, input_node: ort.NodeArg):
|
| 24 |
+
b, c, h, w = input_node.shape
|
| 25 |
+
object.__setattr__(self, "resized_image", np.empty([h, w, c], dtype=np.uint8))
|
| 26 |
+
object.__setattr__(
|
| 27 |
+
self, "input_batch", np.empty([b, c, h, w], dtype=np.float32)
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def is_unified_memory(device_type: str):
|
| 32 |
+
return device_type in ("cpu", "coreml")
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def get_ort_session_device_type(session: ort.InferenceSession) -> str:
|
| 36 |
+
# get_providers() returns e.g. ["CUDAExecutionProvider", "CPUExecutionProvider"]
|
| 37 |
+
provider = session.get_providers()[0]
|
| 38 |
+
# strip the common suffix and lower-case
|
| 39 |
+
return provider[: provider.index("ExecutionProvider")].lower()
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def nodearg_to_numpy_dtype(node: ort.NodeArg):
|
| 43 |
+
match = cast(re.Match[str], re.match(r"tensor\((\w+)\)", node.type))
|
| 44 |
+
elem_name = match.group(1).upper()
|
| 45 |
+
enum_val = getattr(onnx.TensorProto.DataType, elem_name)
|
| 46 |
+
np_dtype = onnx.helper.tensor_dtype_to_np_dtype(enum_val)
|
| 47 |
+
return np_dtype
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
ort_session = ort.InferenceSession(
|
| 51 |
+
ONNX_MODEL_PATH,
|
| 52 |
+
providers=[
|
| 53 |
+
"CUDAExecutionProvider",
|
| 54 |
+
(
|
| 55 |
+
"CoreMLExecutionProvider",
|
| 56 |
+
{
|
| 57 |
+
"ModelFormat": "MLProgram",
|
| 58 |
+
"RequireStaticInputShapes": "1",
|
| 59 |
+
"AllowLowPrecisionAccumulationOnGPU": "1",
|
| 60 |
+
},
|
| 61 |
+
),
|
| 62 |
+
"CPUExecutionProvider",
|
| 63 |
+
],
|
| 64 |
+
)
|
| 65 |
+
input_node = ort_session.get_inputs()[0]
|
| 66 |
+
output_node = ort_session.get_outputs()[0]
|
| 67 |
+
|
| 68 |
+
buffers = PreallocatedBuffers(input_node=input_node)
|
| 69 |
+
device_type = get_ort_session_device_type(ort_session)
|
| 70 |
+
if device_type == "coreml":
|
| 71 |
+
device_type = "cpu"
|
| 72 |
+
|
| 73 |
+
io_binding = ort_session.io_binding()
|
| 74 |
+
if device_type != "cpu":
|
| 75 |
+
input_ortvalue = ort.OrtValue.ortvalue_from_shape_and_type(
|
| 76 |
+
input_node.shape, nodearg_to_numpy_dtype(input_node), device_type
|
| 77 |
+
)
|
| 78 |
+
io_binding.bind_ortvalue_input(input_node.name, input_ortvalue)
|
| 79 |
+
else:
|
| 80 |
+
io_binding.bind_cpu_input(input_node.name, buffers.input_batch)
|
| 81 |
+
output_ortvalue = ort.OrtValue.ortvalue_from_shape_and_type(
|
| 82 |
+
output_node.shape, nodearg_to_numpy_dtype(output_node), device_type
|
| 83 |
+
)
|
| 84 |
+
io_binding.bind_ortvalue_output(output_node.name, output_ortvalue)
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
def remove_background(rgb_image: np.ndarray, output_path_str: str):
|
| 88 |
+
input_batch: Final[np.ndarray] = buffers.input_batch
|
| 89 |
+
resized_image: Final[np.ndarray] = buffers.resized_image
|
| 90 |
+
|
| 91 |
+
# Preprocess
|
| 92 |
+
cv2.resize(
|
| 93 |
+
src=rgb_image,
|
| 94 |
+
dst=resized_image,
|
| 95 |
+
dsize=(resized_image.shape[1], resized_image.shape[0]),
|
| 96 |
+
interpolation=cv2.INTER_LANCZOS4,
|
| 97 |
+
)
|
| 98 |
+
chw_image = resized_image.transpose(2, 0, 1)
|
| 99 |
+
np.divide(chw_image, np.iinfo(np.uint8).max, out=input_batch[0])
|
| 100 |
+
|
| 101 |
+
# Inference
|
| 102 |
+
if device_type != "cpu":
|
| 103 |
+
# Update existing OrtValue's memory in-place (no re-alloc)
|
| 104 |
+
input_ortvalue.update_inplace(input_batch)
|
| 105 |
+
ort_session.run_with_iobinding(io_binding)
|
| 106 |
+
outputs = output_ortvalue.numpy()
|
| 107 |
+
|
| 108 |
+
# Postprocess
|
| 109 |
+
raw_mask = outputs.squeeze()
|
| 110 |
+
min_val = raw_mask.min()
|
| 111 |
+
max_val = raw_mask.max()
|
| 112 |
+
normalized_mask = (
|
| 113 |
+
(raw_mask - min_val)
|
| 114 |
+
/ (max_val - min_val + np.finfo(np.float32).eps)
|
| 115 |
+
* np.iinfo(np.uint8).max
|
| 116 |
+
)
|
| 117 |
+
|
| 118 |
+
resized_mask = cv2.resize(
|
| 119 |
+
normalized_mask.astype(np.uint8),
|
| 120 |
+
dsize=(rgb_image.shape[1], rgb_image.shape[0]),
|
| 121 |
+
interpolation=cv2.INTER_LANCZOS4,
|
| 122 |
+
)
|
| 123 |
+
bgra_image = cv2.cvtColor(rgb_image, cv2.COLOR_RGB2BGRA)
|
| 124 |
+
bgra_image[:, :, 3] = resized_mask
|
| 125 |
+
cv2.imwrite(output_path_str, bgra_image, [cv2.IMWRITE_WEBP_QUALITY, 100])
|
| 126 |
+
return output_path_str
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
if __name__ == "__main__":
|
| 130 |
+
with tempfile.NamedTemporaryFile(suffix=".webp") as webp_tmp:
|
| 131 |
+
demo = gr.Interface(
|
| 132 |
+
fn=functools.partial(remove_background, output_path_str=webp_tmp.name),
|
| 133 |
+
inputs=gr.Image(type="numpy", label="Upload Image"),
|
| 134 |
+
outputs=[
|
| 135 |
+
gr.Image(type="filepath", label="Result Image"),
|
| 136 |
+
],
|
| 137 |
+
title="BGone 💕🍒",
|
| 138 |
+
description=("Upload an image to get a background-free, lossless WebP."),
|
| 139 |
+
)
|
| 140 |
+
demo.launch()
|
pyproject.toml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
[project]
|
| 2 |
authors = [{ name = "Ky Anh" }]
|
|
|
|
| 3 |
name = "bgone"
|
| 4 |
requires-python = ">= 3.12"
|
| 5 |
version = "0.1.0"
|
| 6 |
-
dynamic = ["dependencies"]
|
| 7 |
|
| 8 |
[tool.setuptools.dynamic]
|
| 9 |
dependencies = { file = ["requirements.txt"] }
|
|
|
|
| 1 |
[project]
|
| 2 |
authors = [{ name = "Ky Anh" }]
|
| 3 |
+
dynamic = ["dependencies"]
|
| 4 |
name = "bgone"
|
| 5 |
requires-python = ">= 3.12"
|
| 6 |
version = "0.1.0"
|
|
|
|
| 7 |
|
| 8 |
[tool.setuptools.dynamic]
|
| 9 |
dependencies = { file = ["requirements.txt"] }
|
requirements.txt
CHANGED
|
@@ -1,3 +1,5 @@
|
|
| 1 |
gradio
|
| 2 |
numpy
|
|
|
|
| 3 |
onnxruntime
|
|
|
|
|
|
| 1 |
gradio
|
| 2 |
numpy
|
| 3 |
+
onnx
|
| 4 |
onnxruntime
|
| 5 |
+
opencv-python-headless
|
uv.lock
CHANGED
|
@@ -2,8 +2,12 @@ version = 1
|
|
| 2 |
revision = 2
|
| 3 |
requires-python = ">=3.12"
|
| 4 |
resolution-markers = [
|
| 5 |
-
"python_full_version >= '3.13'",
|
| 6 |
-
"python_full_version
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
]
|
| 8 |
|
| 9 |
[[package]]
|
|
@@ -85,14 +89,18 @@ source = { virtual = "." }
|
|
| 85 |
dependencies = [
|
| 86 |
{ name = "gradio" },
|
| 87 |
{ name = "numpy" },
|
|
|
|
| 88 |
{ name = "onnxruntime" },
|
|
|
|
| 89 |
]
|
| 90 |
|
| 91 |
[package.metadata]
|
| 92 |
requires-dist = [
|
| 93 |
{ name = "gradio" },
|
| 94 |
{ name = "numpy" },
|
|
|
|
| 95 |
{ name = "onnxruntime" },
|
|
|
|
| 96 |
]
|
| 97 |
|
| 98 |
[[package]]
|
|
@@ -446,40 +454,67 @@ wheels = [
|
|
| 446 |
|
| 447 |
[[package]]
|
| 448 |
name = "numpy"
|
| 449 |
-
version = "2.2.
|
| 450 |
-
source = { registry = "https://pypi.org/simple" }
|
| 451 |
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
| 452 |
-
wheels = [
|
| 453 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 454 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 455 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 456 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 457 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 458 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 459 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 460 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 461 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 462 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 463 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 464 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 465 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 466 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 467 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 468 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 469 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 470 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 471 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 472 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 473 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 474 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 475 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 476 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 477 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 478 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 479 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 480 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 481 |
-
{ url = "https://files.pythonhosted.org/packages/
|
| 482 |
-
{ url = "https://files.pythonhosted.org/packages/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 483 |
]
|
| 484 |
|
| 485 |
[[package]]
|
|
@@ -507,6 +542,23 @@ wheels = [
|
|
| 507 |
{ url = "https://files.pythonhosted.org/packages/c3/16/873b955beda7bada5b0d798d3a601b2ff210e44ad5169f6d405b93892103/onnxruntime-1.22.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:64845709f9e8a2809e8e009bc4c8f73b788cee9c6619b7d9930344eae4c9cd36", size = 16427482, upload-time = "2025-05-09T20:26:20.376Z" },
|
| 508 |
]
|
| 509 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 510 |
[[package]]
|
| 511 |
name = "orjson"
|
| 512 |
version = "3.10.18"
|
|
|
|
| 2 |
revision = 2
|
| 3 |
requires-python = ">=3.12"
|
| 4 |
resolution-markers = [
|
| 5 |
+
"python_full_version >= '3.13' and sys_platform == 'darwin'",
|
| 6 |
+
"python_full_version >= '3.13' and platform_machine == 'aarch64' and sys_platform == 'linux'",
|
| 7 |
+
"(python_full_version >= '3.13' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version >= '3.13' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
| 8 |
+
"python_full_version < '3.13' and sys_platform == 'darwin'",
|
| 9 |
+
"python_full_version < '3.13' and platform_machine == 'aarch64' and sys_platform == 'linux'",
|
| 10 |
+
"(python_full_version < '3.13' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version < '3.13' and sys_platform != 'darwin' and sys_platform != 'linux')",
|
| 11 |
]
|
| 12 |
|
| 13 |
[[package]]
|
|
|
|
| 89 |
dependencies = [
|
| 90 |
{ name = "gradio" },
|
| 91 |
{ name = "numpy" },
|
| 92 |
+
{ name = "onnx" },
|
| 93 |
{ name = "onnxruntime" },
|
| 94 |
+
{ name = "opencv-python-headless" },
|
| 95 |
]
|
| 96 |
|
| 97 |
[package.metadata]
|
| 98 |
requires-dist = [
|
| 99 |
{ name = "gradio" },
|
| 100 |
{ name = "numpy" },
|
| 101 |
+
{ name = "onnx" },
|
| 102 |
{ name = "onnxruntime" },
|
| 103 |
+
{ name = "opencv-python-headless" },
|
| 104 |
]
|
| 105 |
|
| 106 |
[[package]]
|
|
|
|
| 454 |
|
| 455 |
[[package]]
|
| 456 |
name = "numpy"
|
| 457 |
+
version = "2.2.6"
|
| 458 |
+
source = { registry = "https://pypi.org/simple" }
|
| 459 |
+
sdist = { url = "https://files.pythonhosted.org/packages/76/21/7d2a95e4bba9dc13d043ee156a356c0a8f0c6309dff6b21b4d71a073b8a8/numpy-2.2.6.tar.gz", hash = "sha256:e29554e2bef54a90aa5cc07da6ce955accb83f21ab5de01a62c8478897b264fd", size = 20276440, upload-time = "2025-05-17T22:38:04.611Z" }
|
| 460 |
+
wheels = [
|
| 461 |
+
{ url = "https://files.pythonhosted.org/packages/82/5d/c00588b6cf18e1da539b45d3598d3557084990dcc4331960c15ee776ee41/numpy-2.2.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:41c5a21f4a04fa86436124d388f6ed60a9343a6f767fced1a8a71c3fbca038ff", size = 20875348, upload-time = "2025-05-17T21:34:39.648Z" },
|
| 462 |
+
{ url = "https://files.pythonhosted.org/packages/66/ee/560deadcdde6c2f90200450d5938f63a34b37e27ebff162810f716f6a230/numpy-2.2.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de749064336d37e340f640b05f24e9e3dd678c57318c7289d222a8a2f543e90c", size = 14119362, upload-time = "2025-05-17T21:35:01.241Z" },
|
| 463 |
+
{ url = "https://files.pythonhosted.org/packages/3c/65/4baa99f1c53b30adf0acd9a5519078871ddde8d2339dc5a7fde80d9d87da/numpy-2.2.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:894b3a42502226a1cac872f840030665f33326fc3dac8e57c607905773cdcde3", size = 5084103, upload-time = "2025-05-17T21:35:10.622Z" },
|
| 464 |
+
{ url = "https://files.pythonhosted.org/packages/cc/89/e5a34c071a0570cc40c9a54eb472d113eea6d002e9ae12bb3a8407fb912e/numpy-2.2.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:71594f7c51a18e728451bb50cc60a3ce4e6538822731b2933209a1f3614e9282", size = 6625382, upload-time = "2025-05-17T21:35:21.414Z" },
|
| 465 |
+
{ url = "https://files.pythonhosted.org/packages/f8/35/8c80729f1ff76b3921d5c9487c7ac3de9b2a103b1cd05e905b3090513510/numpy-2.2.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2618db89be1b4e05f7a1a847a9c1c0abd63e63a1607d892dd54668dd92faf87", size = 14018462, upload-time = "2025-05-17T21:35:42.174Z" },
|
| 466 |
+
{ url = "https://files.pythonhosted.org/packages/8c/3d/1e1db36cfd41f895d266b103df00ca5b3cbe965184df824dec5c08c6b803/numpy-2.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd83c01228a688733f1ded5201c678f0c53ecc1006ffbc404db9f7a899ac6249", size = 16527618, upload-time = "2025-05-17T21:36:06.711Z" },
|
| 467 |
+
{ url = "https://files.pythonhosted.org/packages/61/c6/03ed30992602c85aa3cd95b9070a514f8b3c33e31124694438d88809ae36/numpy-2.2.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:37c0ca431f82cd5fa716eca9506aefcabc247fb27ba69c5062a6d3ade8cf8f49", size = 15505511, upload-time = "2025-05-17T21:36:29.965Z" },
|
| 468 |
+
{ url = "https://files.pythonhosted.org/packages/b7/25/5761d832a81df431e260719ec45de696414266613c9ee268394dd5ad8236/numpy-2.2.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fe27749d33bb772c80dcd84ae7e8df2adc920ae8297400dabec45f0dedb3f6de", size = 18313783, upload-time = "2025-05-17T21:36:56.883Z" },
|
| 469 |
+
{ url = "https://files.pythonhosted.org/packages/57/0a/72d5a3527c5ebffcd47bde9162c39fae1f90138c961e5296491ce778e682/numpy-2.2.6-cp312-cp312-win32.whl", hash = "sha256:4eeaae00d789f66c7a25ac5f34b71a7035bb474e679f410e5e1a94deb24cf2d4", size = 6246506, upload-time = "2025-05-17T21:37:07.368Z" },
|
| 470 |
+
{ url = "https://files.pythonhosted.org/packages/36/fa/8c9210162ca1b88529ab76b41ba02d433fd54fecaf6feb70ef9f124683f1/numpy-2.2.6-cp312-cp312-win_amd64.whl", hash = "sha256:c1f9540be57940698ed329904db803cf7a402f3fc200bfe599334c9bd84a40b2", size = 12614190, upload-time = "2025-05-17T21:37:26.213Z" },
|
| 471 |
+
{ url = "https://files.pythonhosted.org/packages/f9/5c/6657823f4f594f72b5471f1db1ab12e26e890bb2e41897522d134d2a3e81/numpy-2.2.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0811bb762109d9708cca4d0b13c4f67146e3c3b7cf8d34018c722adb2d957c84", size = 20867828, upload-time = "2025-05-17T21:37:56.699Z" },
|
| 472 |
+
{ url = "https://files.pythonhosted.org/packages/dc/9e/14520dc3dadf3c803473bd07e9b2bd1b69bc583cb2497b47000fed2fa92f/numpy-2.2.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:287cc3162b6f01463ccd86be154f284d0893d2b3ed7292439ea97eafa8170e0b", size = 14143006, upload-time = "2025-05-17T21:38:18.291Z" },
|
| 473 |
+
{ url = "https://files.pythonhosted.org/packages/4f/06/7e96c57d90bebdce9918412087fc22ca9851cceaf5567a45c1f404480e9e/numpy-2.2.6-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:f1372f041402e37e5e633e586f62aa53de2eac8d98cbfb822806ce4bbefcb74d", size = 5076765, upload-time = "2025-05-17T21:38:27.319Z" },
|
| 474 |
+
{ url = "https://files.pythonhosted.org/packages/73/ed/63d920c23b4289fdac96ddbdd6132e9427790977d5457cd132f18e76eae0/numpy-2.2.6-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:55a4d33fa519660d69614a9fad433be87e5252f4b03850642f88993f7b2ca566", size = 6617736, upload-time = "2025-05-17T21:38:38.141Z" },
|
| 475 |
+
{ url = "https://files.pythonhosted.org/packages/85/c5/e19c8f99d83fd377ec8c7e0cf627a8049746da54afc24ef0a0cb73d5dfb5/numpy-2.2.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f92729c95468a2f4f15e9bb94c432a9229d0d50de67304399627a943201baa2f", size = 14010719, upload-time = "2025-05-17T21:38:58.433Z" },
|
| 476 |
+
{ url = "https://files.pythonhosted.org/packages/19/49/4df9123aafa7b539317bf6d342cb6d227e49f7a35b99c287a6109b13dd93/numpy-2.2.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1bc23a79bfabc5d056d106f9befb8d50c31ced2fbc70eedb8155aec74a45798f", size = 16526072, upload-time = "2025-05-17T21:39:22.638Z" },
|
| 477 |
+
{ url = "https://files.pythonhosted.org/packages/b2/6c/04b5f47f4f32f7c2b0e7260442a8cbcf8168b0e1a41ff1495da42f42a14f/numpy-2.2.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e3143e4451880bed956e706a3220b4e5cf6172ef05fcc397f6f36a550b1dd868", size = 15503213, upload-time = "2025-05-17T21:39:45.865Z" },
|
| 478 |
+
{ url = "https://files.pythonhosted.org/packages/17/0a/5cd92e352c1307640d5b6fec1b2ffb06cd0dabe7d7b8227f97933d378422/numpy-2.2.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b4f13750ce79751586ae2eb824ba7e1e8dba64784086c98cdbbcc6a42112ce0d", size = 18316632, upload-time = "2025-05-17T21:40:13.331Z" },
|
| 479 |
+
{ url = "https://files.pythonhosted.org/packages/f0/3b/5cba2b1d88760ef86596ad0f3d484b1cbff7c115ae2429678465057c5155/numpy-2.2.6-cp313-cp313-win32.whl", hash = "sha256:5beb72339d9d4fa36522fc63802f469b13cdbe4fdab4a288f0c441b74272ebfd", size = 6244532, upload-time = "2025-05-17T21:43:46.099Z" },
|
| 480 |
+
{ url = "https://files.pythonhosted.org/packages/cb/3b/d58c12eafcb298d4e6d0d40216866ab15f59e55d148a5658bb3132311fcf/numpy-2.2.6-cp313-cp313-win_amd64.whl", hash = "sha256:b0544343a702fa80c95ad5d3d608ea3599dd54d4632df855e4c8d24eb6ecfa1c", size = 12610885, upload-time = "2025-05-17T21:44:05.145Z" },
|
| 481 |
+
{ url = "https://files.pythonhosted.org/packages/6b/9e/4bf918b818e516322db999ac25d00c75788ddfd2d2ade4fa66f1f38097e1/numpy-2.2.6-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0bca768cd85ae743b2affdc762d617eddf3bcf8724435498a1e80132d04879e6", size = 20963467, upload-time = "2025-05-17T21:40:44Z" },
|
| 482 |
+
{ url = "https://files.pythonhosted.org/packages/61/66/d2de6b291507517ff2e438e13ff7b1e2cdbdb7cb40b3ed475377aece69f9/numpy-2.2.6-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:fc0c5673685c508a142ca65209b4e79ed6740a4ed6b2267dbba90f34b0b3cfda", size = 14225144, upload-time = "2025-05-17T21:41:05.695Z" },
|
| 483 |
+
{ url = "https://files.pythonhosted.org/packages/e4/25/480387655407ead912e28ba3a820bc69af9adf13bcbe40b299d454ec011f/numpy-2.2.6-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5bd4fc3ac8926b3819797a7c0e2631eb889b4118a9898c84f585a54d475b7e40", size = 5200217, upload-time = "2025-05-17T21:41:15.903Z" },
|
| 484 |
+
{ url = "https://files.pythonhosted.org/packages/aa/4a/6e313b5108f53dcbf3aca0c0f3e9c92f4c10ce57a0a721851f9785872895/numpy-2.2.6-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:fee4236c876c4e8369388054d02d0e9bb84821feb1a64dd59e137e6511a551f8", size = 6712014, upload-time = "2025-05-17T21:41:27.321Z" },
|
| 485 |
+
{ url = "https://files.pythonhosted.org/packages/b7/30/172c2d5c4be71fdf476e9de553443cf8e25feddbe185e0bd88b096915bcc/numpy-2.2.6-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e1dda9c7e08dc141e0247a5b8f49cf05984955246a327d4c48bda16821947b2f", size = 14077935, upload-time = "2025-05-17T21:41:49.738Z" },
|
| 486 |
+
{ url = "https://files.pythonhosted.org/packages/12/fb/9e743f8d4e4d3c710902cf87af3512082ae3d43b945d5d16563f26ec251d/numpy-2.2.6-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f447e6acb680fd307f40d3da4852208af94afdfab89cf850986c3ca00562f4fa", size = 16600122, upload-time = "2025-05-17T21:42:14.046Z" },
|
| 487 |
+
{ url = "https://files.pythonhosted.org/packages/12/75/ee20da0e58d3a66f204f38916757e01e33a9737d0b22373b3eb5a27358f9/numpy-2.2.6-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:389d771b1623ec92636b0786bc4ae56abafad4a4c513d36a55dce14bd9ce8571", size = 15586143, upload-time = "2025-05-17T21:42:37.464Z" },
|
| 488 |
+
{ url = "https://files.pythonhosted.org/packages/76/95/bef5b37f29fc5e739947e9ce5179ad402875633308504a52d188302319c8/numpy-2.2.6-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8e9ace4a37db23421249ed236fdcdd457d671e25146786dfc96835cd951aa7c1", size = 18385260, upload-time = "2025-05-17T21:43:05.189Z" },
|
| 489 |
+
{ url = "https://files.pythonhosted.org/packages/09/04/f2f83279d287407cf36a7a8053a5abe7be3622a4363337338f2585e4afda/numpy-2.2.6-cp313-cp313t-win32.whl", hash = "sha256:038613e9fb8c72b0a41f025a7e4c3f0b7a1b5d768ece4796b674c8f3fe13efff", size = 6377225, upload-time = "2025-05-17T21:43:16.254Z" },
|
| 490 |
+
{ url = "https://files.pythonhosted.org/packages/67/0e/35082d13c09c02c011cf21570543d202ad929d961c02a147493cb0c2bdf5/numpy-2.2.6-cp313-cp313t-win_amd64.whl", hash = "sha256:6031dd6dfecc0cf9f668681a37648373bddd6421fff6c66ec1624eed0180ee06", size = 12771374, upload-time = "2025-05-17T21:43:35.479Z" },
|
| 491 |
+
]
|
| 492 |
+
|
| 493 |
+
[[package]]
|
| 494 |
+
name = "onnx"
|
| 495 |
+
version = "1.18.0"
|
| 496 |
+
source = { registry = "https://pypi.org/simple" }
|
| 497 |
+
dependencies = [
|
| 498 |
+
{ name = "numpy" },
|
| 499 |
+
{ name = "protobuf" },
|
| 500 |
+
{ name = "typing-extensions" },
|
| 501 |
+
]
|
| 502 |
+
sdist = { url = "https://files.pythonhosted.org/packages/3d/60/e56e8ec44ed34006e6d4a73c92a04d9eea6163cc12440e35045aec069175/onnx-1.18.0.tar.gz", hash = "sha256:3d8dbf9e996629131ba3aa1afd1d8239b660d1f830c6688dd7e03157cccd6b9c", size = 12563009, upload-time = "2025-05-12T22:03:09.626Z" }
|
| 503 |
+
wheels = [
|
| 504 |
+
{ url = "https://files.pythonhosted.org/packages/a7/fe/16228aca685392a7114625b89aae98b2dc4058a47f0f467a376745efe8d0/onnx-1.18.0-cp312-cp312-macosx_12_0_universal2.whl", hash = "sha256:521bac578448667cbb37c50bf05b53c301243ede8233029555239930996a625b", size = 18285770, upload-time = "2025-05-12T22:02:26.116Z" },
|
| 505 |
+
{ url = "https://files.pythonhosted.org/packages/1e/77/ba50a903a9b5e6f9be0fa50f59eb2fca4a26ee653375408fbc72c3acbf9f/onnx-1.18.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e4da451bf1c5ae381f32d430004a89f0405bc57a8471b0bddb6325a5b334aa40", size = 17421291, upload-time = "2025-05-12T22:02:29.645Z" },
|
| 506 |
+
{ url = "https://files.pythonhosted.org/packages/11/23/25ec2ba723ac62b99e8fed6d7b59094dadb15e38d4c007331cc9ae3dfa5f/onnx-1.18.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99afac90b4cdb1471432203c3c1f74e16549c526df27056d39f41a9a47cfb4af", size = 17584084, upload-time = "2025-05-12T22:02:32.789Z" },
|
| 507 |
+
{ url = "https://files.pythonhosted.org/packages/6a/4d/2c253a36070fb43f340ff1d2c450df6a9ef50b938adcd105693fee43c4ee/onnx-1.18.0-cp312-cp312-win32.whl", hash = "sha256:ee159b41a3ae58d9c7341cf432fc74b96aaf50bd7bb1160029f657b40dc69715", size = 15734892, upload-time = "2025-05-12T22:02:35.527Z" },
|
| 508 |
+
{ url = "https://files.pythonhosted.org/packages/e8/92/048ba8fafe6b2b9a268ec2fb80def7e66c0b32ab2cae74de886981f05a27/onnx-1.18.0-cp312-cp312-win_amd64.whl", hash = "sha256:102c04edc76b16e9dfeda5a64c1fccd7d3d2913b1544750c01d38f1ac3c04e05", size = 15850336, upload-time = "2025-05-12T22:02:38.545Z" },
|
| 509 |
+
{ url = "https://files.pythonhosted.org/packages/a1/66/bbc4ffedd44165dcc407a51ea4c592802a5391ce3dc94aa5045350f64635/onnx-1.18.0-cp312-cp312-win_arm64.whl", hash = "sha256:911b37d724a5d97396f3c2ef9ea25361c55cbc9aa18d75b12a52b620b67145af", size = 15823802, upload-time = "2025-05-12T22:02:42.037Z" },
|
| 510 |
+
{ url = "https://files.pythonhosted.org/packages/45/da/9fb8824513fae836239276870bfcc433fa2298d34ed282c3a47d3962561b/onnx-1.18.0-cp313-cp313-macosx_12_0_universal2.whl", hash = "sha256:030d9f5f878c5f4c0ff70a4545b90d7812cd6bfe511de2f3e469d3669c8cff95", size = 18285906, upload-time = "2025-05-12T22:02:45.01Z" },
|
| 511 |
+
{ url = "https://files.pythonhosted.org/packages/05/e8/762b5fb5ed1a2b8e9a4bc5e668c82723b1b789c23b74e6b5a3356731ae4e/onnx-1.18.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8521544987d713941ee1e591520044d35e702f73dc87e91e6d4b15a064ae813d", size = 17421486, upload-time = "2025-05-12T22:02:48.467Z" },
|
| 512 |
+
{ url = "https://files.pythonhosted.org/packages/12/bb/471da68df0364f22296456c7f6becebe0a3da1ba435cdb371099f516da6e/onnx-1.18.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c137eecf6bc618c2f9398bcc381474b55c817237992b169dfe728e169549e8f", size = 17583581, upload-time = "2025-05-12T22:02:51.784Z" },
|
| 513 |
+
{ url = "https://files.pythonhosted.org/packages/76/0d/01a95edc2cef6ad916e04e8e1267a9286f15b55c90cce5d3cdeb359d75d6/onnx-1.18.0-cp313-cp313-win32.whl", hash = "sha256:6c093ffc593e07f7e33862824eab9225f86aa189c048dd43ffde207d7041a55f", size = 15734621, upload-time = "2025-05-12T22:02:54.62Z" },
|
| 514 |
+
{ url = "https://files.pythonhosted.org/packages/64/95/253451a751be32b6173a648b68f407188009afa45cd6388780c330ff5d5d/onnx-1.18.0-cp313-cp313-win_amd64.whl", hash = "sha256:230b0fb615e5b798dc4a3718999ec1828360bc71274abd14f915135eab0255f1", size = 15850472, upload-time = "2025-05-12T22:02:57.54Z" },
|
| 515 |
+
{ url = "https://files.pythonhosted.org/packages/0a/b1/6fd41b026836df480a21687076e0f559bc3ceeac90f2be8c64b4a7a1f332/onnx-1.18.0-cp313-cp313-win_arm64.whl", hash = "sha256:6f91930c1a284135db0f891695a263fc876466bf2afbd2215834ac08f600cfca", size = 15823808, upload-time = "2025-05-12T22:03:00.305Z" },
|
| 516 |
+
{ url = "https://files.pythonhosted.org/packages/70/f3/499e53dd41fa7302f914dd18543da01e0786a58b9a9d347497231192001f/onnx-1.18.0-cp313-cp313t-macosx_12_0_universal2.whl", hash = "sha256:2f4d37b0b5c96a873887652d1cbf3f3c70821b8c66302d84b0f0d89dd6e47653", size = 18316526, upload-time = "2025-05-12T22:03:03.691Z" },
|
| 517 |
+
{ url = "https://files.pythonhosted.org/packages/84/dd/6abe5d7bd23f5ed3ade8352abf30dff1c7a9e97fc1b0a17b5d7c726e98a9/onnx-1.18.0-cp313-cp313t-win_amd64.whl", hash = "sha256:a69afd0baa372162948b52c13f3aa2730123381edf926d7ef3f68ca7cec6d0d0", size = 15865055, upload-time = "2025-05-12T22:03:06.663Z" },
|
| 518 |
]
|
| 519 |
|
| 520 |
[[package]]
|
|
|
|
| 542 |
{ url = "https://files.pythonhosted.org/packages/c3/16/873b955beda7bada5b0d798d3a601b2ff210e44ad5169f6d405b93892103/onnxruntime-1.22.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:64845709f9e8a2809e8e009bc4c8f73b788cee9c6619b7d9930344eae4c9cd36", size = 16427482, upload-time = "2025-05-09T20:26:20.376Z" },
|
| 543 |
]
|
| 544 |
|
| 545 |
+
[[package]]
|
| 546 |
+
name = "opencv-python-headless"
|
| 547 |
+
version = "4.11.0.86"
|
| 548 |
+
source = { registry = "https://pypi.org/simple" }
|
| 549 |
+
dependencies = [
|
| 550 |
+
{ name = "numpy" },
|
| 551 |
+
]
|
| 552 |
+
sdist = { url = "https://files.pythonhosted.org/packages/36/2f/5b2b3ba52c864848885ba988f24b7f105052f68da9ab0e693cc7c25b0b30/opencv-python-headless-4.11.0.86.tar.gz", hash = "sha256:996eb282ca4b43ec6a3972414de0e2331f5d9cda2b41091a49739c19fb843798", size = 95177929, upload-time = "2025-01-16T13:53:40.22Z" }
|
| 553 |
+
wheels = [
|
| 554 |
+
{ url = "https://files.pythonhosted.org/packages/dc/53/2c50afa0b1e05ecdb4603818e85f7d174e683d874ef63a6abe3ac92220c8/opencv_python_headless-4.11.0.86-cp37-abi3-macosx_13_0_arm64.whl", hash = "sha256:48128188ade4a7e517237c8e1e11a9cdf5c282761473383e77beb875bb1e61ca", size = 37326460, upload-time = "2025-01-16T13:52:57.015Z" },
|
| 555 |
+
{ url = "https://files.pythonhosted.org/packages/3b/43/68555327df94bb9b59a1fd645f63fafb0762515344d2046698762fc19d58/opencv_python_headless-4.11.0.86-cp37-abi3-macosx_13_0_x86_64.whl", hash = "sha256:a66c1b286a9de872c343ee7c3553b084244299714ebb50fbdcd76f07ebbe6c81", size = 56723330, upload-time = "2025-01-16T13:55:45.731Z" },
|
| 556 |
+
{ url = "https://files.pythonhosted.org/packages/45/be/1438ce43ebe65317344a87e4b150865c5585f4c0db880a34cdae5ac46881/opencv_python_headless-4.11.0.86-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6efabcaa9df731f29e5ea9051776715b1bdd1845d7c9530065c7951d2a2899eb", size = 29487060, upload-time = "2025-01-16T13:51:59.625Z" },
|
| 557 |
+
{ url = "https://files.pythonhosted.org/packages/dd/5c/c139a7876099916879609372bfa513b7f1257f7f1a908b0bdc1c2328241b/opencv_python_headless-4.11.0.86-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e0a27c19dd1f40ddff94976cfe43066fbbe9dfbb2ec1907d66c19caef42a57b", size = 49969856, upload-time = "2025-01-16T13:53:29.654Z" },
|
| 558 |
+
{ url = "https://files.pythonhosted.org/packages/95/dd/ed1191c9dc91abcc9f752b499b7928aacabf10567bb2c2535944d848af18/opencv_python_headless-4.11.0.86-cp37-abi3-win32.whl", hash = "sha256:f447d8acbb0b6f2808da71fddd29c1cdd448d2bc98f72d9bb78a7a898fc9621b", size = 29324425, upload-time = "2025-01-16T13:52:49.048Z" },
|
| 559 |
+
{ url = "https://files.pythonhosted.org/packages/86/8a/69176a64335aed183529207ba8bc3d329c2999d852b4f3818027203f50e6/opencv_python_headless-4.11.0.86-cp37-abi3-win_amd64.whl", hash = "sha256:6c304df9caa7a6a5710b91709dd4786bf20a74d57672b3c31f7033cc638174ca", size = 39402386, upload-time = "2025-01-16T13:52:56.418Z" },
|
| 560 |
+
]
|
| 561 |
+
|
| 562 |
[[package]]
|
| 563 |
name = "orjson"
|
| 564 |
version = "3.10.18"
|