Files
annotations/Azaion.Inference/setup.py
T
Oleksandr Bezdieniezhnykh ad782bcbaa splitting python complete
2025-08-12 14:48:56 +03:00

50 lines
1.7 KiB
Python

from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy as np
debug_args = {}
trace_line = False
# debug_args = {
# 'extra_compile_args': ['-O0', '-g'],
# 'extra_link_args': ['-g'],
# 'define_macros': [('CYTHON_TRACE_NOGIL', '1')]
# }
# trace_line = True
extensions = [
Extension('constants_inf', ['constants_inf.pyx'], **debug_args),
Extension('file_data', ['file_data.pyx'], **debug_args),
Extension('remote_command_inf', ['remote_command_inf.pyx'], **debug_args),
Extension('remote_command_handler_inf', ['remote_command_handler_inf.pyx'], **debug_args),
Extension('annotation', ['annotation.pyx'], **debug_args),
Extension('loader_client', ['loader_client.pyx'], **debug_args),
Extension('ai_config', ['ai_config.pyx'], **debug_args),
Extension('tensorrt_engine', ['tensorrt_engine.pyx'], include_dirs=[np.get_include()], **debug_args),
Extension('onnx_engine', ['onnx_engine.pyx'], include_dirs=[np.get_include()], **debug_args),
Extension('inference_engine', ['inference_engine.pyx'], include_dirs=[np.get_include()], **debug_args),
Extension('inference', ['inference.pyx'], include_dirs=[np.get_include()], **debug_args),
Extension('main_inference', ['main_inference.pyx'], **debug_args),
]
setup(
name="azaion.ai",
ext_modules=cythonize(
extensions,
compiler_directives={
"language_level": 3,
"emit_code_comments": False,
"binding": True,
'boundscheck': False,
'wraparound': False,
'linetrace': trace_line
}
),
install_requires=[
'ultralytics>=8.0.0',
'pywin32; platform_system=="Windows"'
],
zip_safe=False
)