代码拉取完成,页面将自动刷新
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# SETUP CONFIGURATION. #
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "anomalib"
dynamic = ["version"]
readme = "README.md"
description = "anomalib - Anomaly Detection Library"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [{ name = "Intel OpenVINO" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# REQUIREMENTS #
dependencies = [
"omegaconf>=2.1.1",
"rich>=13.5.2",
"jsonargparse[signatures]>=4.27.7",
"docstring_parser", # CLI help-formatter
"rich_argparse", # CLI help-formatter
]
[project.optional-dependencies]
core = [
"av>=10.0.0",
"einops>=0.3.2",
"freia>=0.2",
"imgaug==0.4.0",
"kornia>=0.6.6",
"matplotlib>=3.4.3",
"opencv-python>=4.5.3.56",
"pandas>=1.1.0",
"timm<=1.0.7,>=1.0.7",
"lightning>=2.2",
"torch>=2",
"torchmetrics>=1.3.2",
# NOTE: open-clip-torch throws the following error on v2.26.1
# torch.onnx.errors.UnsupportedOperatorError: Exporting the operator
# 'aten::_native_multi_head_attention' to ONNX opset version 14 is not supported
"open-clip-torch>=2.23.0,<2.26.1",
]
openvino = ["openvino>=2024.0", "nncf>=2.10.0", "onnx>=1.16.0"]
loggers = [
"comet-ml>=3.31.7",
"gradio>=4",
"tensorboard",
"wandb>=0.12.17,<=0.15.9",
"mlflow >=1.0.0",
]
notebooks = ["gitpython", "ipykernel", "ipywidgets", "notebook"]
docs = [
"myst-parser",
"nbsphinx",
"pandoc",
"sphinx<8.0", # 7.0 breaks readthedocs builds.
"sphinx_autodoc_typehints",
"sphinx_book_theme",
"sphinx-copybutton",
"sphinx_design",
]
test = [
"pre-commit",
"pytest",
"pytest-cov",
"pytest-xdist",
"pytest-mock",
"pytest-sugar",
"coverage[toml]",
"tox",
]
full = ["anomalib[core,openvino,loggers,notebooks]"]
dev = ["anomalib[full,docs,test]"]
[project.scripts]
anomalib = "anomalib.cli.cli:main"
[tool.setuptools.dynamic]
version = { attr = "anomalib.__version__" }
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# RUFF CONFIGURATION #
[tool.ruff]
# Enable rules
select = [
"F", # Pyflakes (`F`)
"E", # pycodestyle error (`E`)
"W", # pycodestyle warning (`W`)
"C90", # mccabe (`C90`)
"I", # isort (`I`)
"N", # pep8-naming (`N`)
"D", # pydocstyle (`D`)
"UP", # pyupgrade (`UP`)
"YTT", # flake8-2020 (`YTT`)
"ANN", # flake8-annotations (`ANN`)
"S", # flake8-bandit (`S`)
"BLE", # flake8-blind-except (`BLE`)
"FBT", # flake8-boolean-trap (`FBT`)
"B", # flake8-bugbear (`B`)
"A", # flake8-builtins (`A`)
"COM", # flake8-commas (`COM`)
"CPY", # flake8-copyright (`CPY`)
"C4", # flake8-comprehensions (`C4`)
"DTZ", # flake8-datatimez (`DTZ`)
"T10", # flake8-debugger (`T10`)
"EM", # flake8-errmsg (`EM`)
"FA", # flake8-future-annotations (`FA`)
"ISC", # flake8-implicit-str-concat (`ISC`)
"ICN", # flake8-import-conventions (`ICN`)
"PIE", # flake8-pie (`PIE`)
"PT", # flake8-pytest-style (`PT`)
"RSE", # flake8-raise (`RSE`)
"RET", # flake8-return (`RET`)
"SLF", # flake8-self (`SLF`)
"SIM", # flake8-simplify (`SIM`)
"TID", # flake8-tidy-imports (`TID`)
"TCH", # flake8-type-checking (`TCH`)
"INT", # flake8-gettext (`INT`)
"ARG", # flake8-unsused-arguments (`ARG`)
"PTH", # flake8-use-pathlib (`PTH`)
"TD", # flake8-todos (`TD`)
"FIX", # flake8-fixme (`FIX`)
"ERA", # eradicate (`ERA`)
"PD", # pandas-vet (`PD`)
"PGH", # pygrep-hooks (`PGH`)
"PL", # pylint (`PL`)
"TRY", # tryceratos (`TRY`)
"FLY", # flynt (`FLY`)
"NPY", # NumPy-specific rules (`NPY`)
"PERF", # Perflint (`PERF`)
"RUF", # Ruff-specific rules (`RUF`)
# "FURB", # refurb (`FURB`) - ERROR: Unknown rule selector: `FURB`
# "LOG", # flake8-logging (`LOG`) - ERROR: Unknown rule selector: `LOG`
]
ignore = [
# pydocstyle
"D107", # Missing docstring in __init__
# pylint
"PLR0913", # Too many arguments to function call
"PLR2004", # consider replacing with a constant variable
"PLR0912", # Too many branches
"PLR0915", # Too many statements
# flake8-annotations
"ANN101", # Missing-type-self
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
# flake8-bandit (`S`)
"S101", # Use of assert detected.
# flake8-boolean-trap (`FBT`)
"FBT001", # Boolean positional arg in function definition
"FBT002", # Boolean default value in function definition
# flake8-datatimez (`DTZ`)
"DTZ005", # The use of `datetime.datetime.now()` without `tz` argument is not allowed
# flake8-fixme (`FIX`)
"FIX002", # Line contains TODO, consider resolving the issue
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Same as Black.
line-length = 120
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Assume Python 3.10.
target-version = "py310"
# Allow imports relative to the "src" and "tests" directories.
src = ["src", "tests"]
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 15
[tool.ruff.pydocstyle]
convention = "google"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# MYPY CONFIGURATION. #
[tool.mypy]
ignore_missing_imports = true
show_error_codes = true
[[tool.mypy.overrides]]
module = ["torch.*", "wandb.*"]
follow_imports = "skip"
follow_imports_for_stubs = true
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# BANDIT CONFIGURATION #
[tool.bandit]
skips = ["B101"]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# PYTEST CONFIGURATION #
[tool.pytest.ini_options]
addopts = ["--strict-markers", "--strict-config", "--showlocals", "-ra"]
testpaths = "tests"
pythonpath = "src"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# COVERAGE CONFIGURATION #
[tool.coverage.report]
exclude_lines = [
"except ImportError",
"raise ImportError",
"except ApiException",
"raise ApiException",
"raise ValueError",
]
[tool.coverage.paths]
source = ["src", ".tox/*/site-packages"]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# NBQA CONFIGURATION #
[tool.nbqa.addopts]
ruff = ["--ignore=E402"]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# LINK CHECKER CONFIGURATION #
[tool.md_dead_link_check]
exclude_links = [
"https://github.com/openvinotoolkit/anomalib/settings/actions/runners/new",
"https://openvinotoolkit.github.io/anomalib/*", # Remove it after publish documentation
]
exclude_files = ["docs/*"]
force_get_requests_for_links = ["https://secure.ethicspoint.com/*"]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。