[AZ-178] Implement streaming video detection endpoint

- Added `/detect/video` endpoint for true streaming video detection, allowing inference to start as upload bytes arrive.
- Introduced `run_detect_video_stream` method in the inference module to handle video processing from a file-like object.
- Updated media hashing to include a new function for computing hashes directly from files with minimal I/O.
- Enhanced documentation to reflect changes in video processing and API behavior.

Made-with: Cursor
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-04-01 03:11:43 +03:00
parent e65d8da6a3
commit be4cab4fcb
42 changed files with 2983 additions and 29 deletions
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
set -euo pipefail
HOST="${HEALTH_CHECK_HOST:-localhost}"
PORT="${HEALTH_CHECK_PORT:-8080}"
MAX_RETRIES=10
RETRY_INTERVAL=3
usage() {
echo "Usage: $0 [--help]"
echo "Check health of Azaion.Detections service."
echo ""
echo "Environment variables:"
echo " HEALTH_CHECK_HOST Target host (default: localhost)"
echo " HEALTH_CHECK_PORT Target port (default: 8080)"
exit 0
}
for arg in "$@"; do
case "$arg" in
--help) usage ;;
esac
done
URL="http://${HOST}:${PORT}/health"
echo "Checking health at $URL ..."
for i in $(seq 1 "$MAX_RETRIES"); do
if curl -sf "$URL" > /dev/null 2>&1; then
RESPONSE="$(curl -sf "$URL")"
echo "Health check passed (attempt $i/$MAX_RETRIES): $RESPONSE"
exit 0
fi
echo "Attempt $i/$MAX_RETRIES failed, retrying in ${RETRY_INTERVAL}s..."
sleep "$RETRY_INTERVAL"
done
echo "ERROR: Health check failed after $MAX_RETRIES attempts."
exit 1