mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 06:46:32 +00:00
8baa96978b
- Updated the detection image endpoint to require a channel ID for event streaming. - Introduced a new endpoint for streaming detection events, allowing clients to receive real-time updates. - Enhanced the internal buffering mechanism for detection events to manage multiple channels. - Refactored the inference module to support the new event handling structure. Made-with: Cursor
48 lines
1.7 KiB
Python
48 lines
1.7 KiB
Python
from setuptools import setup, Extension
|
|
from Cython.Build import cythonize
|
|
import numpy as np
|
|
|
|
SRC = "src"
|
|
np_inc = [np.get_include(), SRC]
|
|
|
|
extensions = [
|
|
Extension('constants_inf', [f'{SRC}/constants_inf.pyx'], include_dirs=[SRC]),
|
|
Extension('ai_availability_status', [f'{SRC}/ai_availability_status.pyx'], include_dirs=[SRC]),
|
|
Extension('annotation', [f'{SRC}/annotation.pyx'], include_dirs=[SRC]),
|
|
Extension('ai_config', [f'{SRC}/ai_config.pyx'], include_dirs=[SRC]),
|
|
Extension('loader_http_client', [f'{SRC}/loader_http_client.pyx'], include_dirs=[SRC]),
|
|
Extension('engines.inference_engine', [f'{SRC}/engines/inference_engine.pyx'], include_dirs=np_inc),
|
|
Extension('engines.onnx_engine', [f'{SRC}/engines/onnx_engine.pyx'], include_dirs=np_inc),
|
|
Extension('engines.coreml_engine', [f'{SRC}/engines/coreml_engine.pyx'], include_dirs=np_inc),
|
|
Extension('inference', [f'{SRC}/inference.pyx'], include_dirs=np_inc),
|
|
]
|
|
|
|
try:
|
|
import tensorrt # pyright: ignore[reportMissingImports]
|
|
extensions.append(
|
|
Extension('engines.tensorrt_engine', [f'{SRC}/engines/tensorrt_engine.pyx'], include_dirs=np_inc)
|
|
)
|
|
extensions.append(
|
|
Extension('engines.jetson_tensorrt_engine', [f'{SRC}/engines/jetson_tensorrt_engine.pyx'], include_dirs=np_inc)
|
|
)
|
|
except ImportError:
|
|
pass
|
|
|
|
setup(
|
|
name="azaion.detections",
|
|
package_dir={"": SRC},
|
|
packages=["engines"],
|
|
ext_modules=cythonize(
|
|
extensions,
|
|
include_path=[SRC],
|
|
compiler_directives={
|
|
"language_level": 3,
|
|
"emit_code_comments": False,
|
|
"binding": True,
|
|
'boundscheck': False,
|
|
'wraparound': False,
|
|
}
|
|
),
|
|
zip_safe=False
|
|
)
|