Files
detections/setup.py
T
Oleksandr Bezdieniezhnykh fc57d677b4 Refactor type casting in Cython files for improved clarity and consistency
- Updated various Cython files to explicitly cast types, enhancing type safety and readability.
- Adjusted the `engine_name` property in `InferenceEngine` and its subclasses to be set directly in the constructor.
- Modified the `request` method in `_SessionWithBase` to accept `*args` for better flexibility.
- Ensured proper type casting for return values in methods across multiple classes, including `Inference`, `CoreMLEngine`, and `TensorRTEngine`.

These changes aim to streamline the codebase and improve maintainability by enforcing consistent type usage.
2026-03-30 06:17:16 +03:00

39 lines
1.3 KiB
Python

from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy as np
extensions = [
Extension('constants_inf', ['constants_inf.pyx']),
Extension('ai_availability_status', ['ai_availability_status.pyx']),
Extension('annotation', ['annotation.pyx']),
Extension('ai_config', ['ai_config.pyx']),
Extension('loader_http_client', ['loader_http_client.pyx']),
Extension('engines.inference_engine', ['engines/inference_engine.pyx'], include_dirs=[np.get_include()]),
Extension('engines.onnx_engine', ['engines/onnx_engine.pyx'], include_dirs=[np.get_include()]),
Extension('engines.coreml_engine', ['engines/coreml_engine.pyx'], include_dirs=[np.get_include()]),
Extension('inference', ['inference.pyx'], include_dirs=[np.get_include()]),
]
try:
import tensorrt # pyright: ignore[reportMissingImports]
extensions.append(
Extension('engines.tensorrt_engine', ['engines/tensorrt_engine.pyx'], include_dirs=[np.get_include()])
)
except ImportError:
pass
setup(
name="azaion.detections",
ext_modules=cythonize(
extensions,
compiler_directives={
"language_level": 3,
"emit_code_comments": False,
"binding": True,
'boundscheck': False,
'wraparound': False,
}
),
zip_safe=False
)