Add core functionality for API client, CDN management, and data augmentation

- Introduced `ApiClient` for handling API interactions, including file uploads and downloads.
- Implemented `CDNManager` for managing CDN operations with AWS S3.
- Added `Augmentator` class for image augmentation, including bounding box corrections and transformations.
- Created utility functions for annotation conversion and dataset visualization.
- Established a new rules file for sound notifications during human input requests.

These additions enhance the system's capabilities for data handling and user interaction, laying the groundwork for future features.

Simplify autopilot state file to minimal current-step pointer; add execution safety rule to cursor-meta; remove Completed Steps/Key Decisions/Retry Log/Blockers from state template and all references.
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-03-28 00:12:54 +02:00
parent 142c6c4de8
commit c20018745b
31 changed files with 0 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
import pycuda.driver as cuda
import yaml
import constants
from api_client import ApiClient, ApiCredentials
from cdn_manager import CDNManager, CDNCredentials
from inference.inference import Inference
from inference.tensorrt_engine import TensorRTEngine
from security import Security
from utils import Dotdict
def get_engine_filename(device_id=0):
try:
device = cuda.Device(device_id)
sm_count = device.multiprocessor_count
cc_major, cc_minor = device.compute_capability()
return f"azaion.cc_{cc_major}.{cc_minor}_sm_{sm_count}.engine"
except Exception:
return None
if __name__ == "__main__":
# Inference(OnnxEngine('azaion-2025-03-10.onnx', batch_size=4),
# confidence_threshold=0.5, iou_threshold=0.3).process('ForAI_test.mp4')
# detection for the first 200sec of video:
# onnxInference: 81 sec, 6.3Gb VRAM
# tensorrt: 54 sec, 3.7Gb VRAM
# Inference(TensorRTEngine('azaion-2025-03-10_int8.engine', batch_size=16),
# confidence_threshold=0.5, iou_threshold=0.3).process('ForAI_test.mp4')
# INT8 for 200sec: 54 sec 3.7Gb
# Inference(TensorRTEngine('azaion-2025-03-10_batch8.engine', batch_size=8),
# confidence_threshold=0.5, iou_threshold=0.3).process('ForAI_test.mp4')
api_client = ApiClient()
key = Security.get_model_encryption_key()
engine_filename = TensorRTEngine.get_engine_filename()
model_bytes = api_client.load_big_small_resource(engine_filename, 'models', key)
Inference(TensorRTEngine(model_bytes),
confidence_threshold=0.5, iou_threshold=0.3).process('tests/ForAI_test.mp4')
# cdn_manager.download(cdn_c.bucket, constants.AI_TENSOR_MODEL_FILE_BIG)
# tensor_model_bytes = api_client.load_resource(constants.AI_TENSOR_MODEL_FILE_BIG, constants.AI_TENSOR_MODEL_FILE_SMALL)
# Inference(OnnxEngine(onxx_model_bytes, batch_size=4),
# confidence_threshold=0.5, iou_threshold=0.3).process('tests/ForAI_test.mp4')