This document describe the configuration parameters of the application and description of the same.
Once Azure Infrastructure is deployed, the application configuration can be updated using the deployment script deployment.sh
with -c
option. The script will create a .env
file in the label-reader directory. The .env
file contains the following configuration parameters of the application. They can be updated as required, before application build (deployment.sh
with -b
) and deployment (deployment.sh
with -d
) steps.
Parameter | Default | Description |
---|---|---|
FRAME_RATE_UI | "15" | frames per second to be emitted into UI for live video stream |
FRAME_RATE_CAMERA | "40" | frame per second to be read from camera |
FRAME_SIZE_UI | "(640,480)" | frame size to be send into UI for live video stream |
FRAME_SIZE_EDGE_MODEL | "(960,960)" | frame size for edge model inference |
FRAME_SIZE_QUEUE | "(640,480)" | frame size used for transmitting frames inside internal processes |
FRAME_SIZE_OCR | "(640,480)" | frame size to be send for OCR |
CAMERA_PATH | '/app/local_data/order_label_test_video.mp4' | default value contains a video file containing test data to experience the application functionality, the value cane be updated with 'rtsp://localhost:8554/stream' to integrate a live camera |
VID_STREAM_INTERNAL_URL | "ws://localhost:7001/ws/vid_stream_internal" | web app API for transmitting video stream |
ORDER_INFO_INTERNAL_URL | "ws://localhost:7001/ws/order_info_internal" | web app API for transmitting order information |
STATUS_INTERNAL_URL | "ws://localhost:7001/ws/status_internal" | web app API for transmitting status |
ADMIN_INTERNAL_URL | "ws://localhost:7001/ws/admin_internal" | web app API for handling admin requests (start/stop) |
EDGE_MODEL_LOCAL_PATH | "/app/local_data/en_PP_OCRv3_det_infer.onnx" | edge model ONNX file path inside docker container |
EDGE_MODEL_DB_THRESHOLD | 0.3 | threshold for performing segmentation (to differentiate between text and background), do not recommend to change |
EDGE_MODEL_DB_BOX_THRESHOLD | 0.5 | threshold for polygons that considered as a valid bounding box, higher means more strict criteria of being considered |
EDGE_MODEL_DB_MAX_CANDIDATE | 1000 | maximum candidate contours to consider, a higher value results in longer iteration time, do not recommend to increase |
EDGE_MODEL_DB_UNCLIP_RATIO | 2 | defines the distance to be considered as two separate polygons (bounding box), a larger value means bounding boxes that have a larger distance are considered separate |
EDGE_MODEL_DB_USE_DILATION | 0 | whether to apply dilation, reference |
EDGE_MODEL_DB_SCORE_MODE | "fast" | score mode of computing polygon score for a text area (polygon/bounding box) "fast" uses bounding box mean, and "slow" uses polygon mean, do not recommend to change |
TEXT_DETECTION_VALIDATION_BOUNDING_BOX_THRESHOLD_LOW | 3 | number of text bounding boxes to consider presence of a order label |
TEXT_DETECTION_VALIDATION_BOUNDING_BOX_THRESHOLD_LABEL | 7 | number of text bounding boxes to consider presence of a valid order label, that will be send |
TEXT_DETECTION_VALIDATION_SKIP_FRAME_COUNT | 1 | number of frames to be skipped after detecting a valid order label (helps to reduce errors with hand movement while placing the order in front of camera, however adds additional latency of 0.3 sec per count) |
SPEECH_SYNTHESIS_VOICE_NAME | "en-US-SaraNeural" | voice profile name |
SPEECH_SYNTHESIS_LANGUAGE | "en-US" | text language |
SPEECH_SYNTHESIS_STYLE | "cheerful" | speaking style |
SPEECH_SYNTHESIS_PROFILE_RATE | "10%" | speaking speed |
SPEECH_SYNTHESIS_PROFILE_PITCH | "-5%" | voice pitch |
OCR_CONFIDENCE_THRESHOLD | "0.5" | The OCR confidence threshold o value, if any extracted text OCR confidence value is beyond the threshold, the order label will me marked as error and will not get voiced out |
FEATURE_SKIP_FRAME | 1 | enable (1) or disable (0) skipping initial frames after detecting a valid order label |
DUPLICATE_ORDER_CACHE_MAX_LENGTH | 1000 | maximum items to be kept in in-memory cache for duplicate order detection |
DUPLICATE_ORDER_CACHE_MAX_AGE_IN_SECONDS | 60 | duration in second till an order number will be marked as duplicate and will not get voiced out |
AZURE_COGNITIVE_SERVICE_FORMRECOG_KEY | will be filed by deployment script | Azure Cognitive Services key for form recognizer |
AZURE_COGNITIVE_SERVICE_FORMRECOG_ENDPOINT | will be filed by deployment script | Azure Cognitive Services endpoint for form recognizer |
AZURE_COGNITIVE_SERVICE_FORMRECOG_MODEL_ID | will be filed by deployment script | Azure Form Recognizer custom model id |
AZURE_COGNITIVE_SERVICE_SPEECH_KEY | will be filed by deployment script> | Azure Cognitive Services key for speech |
AZURE_COGNITIVE_SERVICE_SPEECH_ENDPOINT | will be filed by deployment script | Azure Cognitive Services endpoint for speech |
AZURE_COGNITIVE_SERVICE_SPEECH_TIMEOUT | "6.05" | Timeout in second for Azure TTS API Call |
ACR_USERNAME | will be filed by deployment script | Azure container registry admin user name |
ACR_PASSWORD | will be filed by deployment script | Azure container registry admin password |
ACR_ADDRESS | will be filed by deployment script | Azure container registry login server |
LOG_ANALYTICS_WORKSPACE_ID | will be filed by deployment script | Azure Log Analytics workspace id for azureiotedge-metrics-collector |
LOG_ANALYTICS_SHARED_KEY | will be filed by deployment script | Azure Log Analytics workspace key for azureiotedge-metrics-collector |
LOG_ANALYTICS_RESOURCE_ID | will be filed by deployment script | Azure Log Analytics resource id for azureiotedge-metrics-collector |
LOG_ANALYTICS_AZURE_DOMAIN | "azure.com" | Azure Log domain id for azureiotedge-metrics-collector |
IOT_HUB_RESOURCE_ID | will be filed by deployment script | Azure IoT Hub resource id for azureiotedge-metrics-collector |
APPINSIGHTS_CONNECTION_STRING | will be filed by deployment script | Azure Application Insights Connection string |
APPLICATIONINSIGHTS_STATSBEAT_DISABLED_ALL | "True" | Disabled Azure Application Insights start collection |
BLOB_STORAGE_CONN_STRING | will be filed by deployment script | Azure Blob Storage Connection string |
AZURE_BLOB_STORAGE_CONTAINER_NAME | "ocrcupimages" | Azure Blob Storage container name for uploading failed images |
STORE_ID | will be filed by deployment script | store unique id, that can be used later to fetch logs/metrics/failures atc. |
NUM_IMAGES_CAP_PER_HOUR | "10" | number of ocr failures frames (identified by system) that will be uploaded to Azure Blob Storage per hour for further analysis |
LOG_LEVEL | "INFO" | Set the log level to "DEBUG", "CRITICAL", "ERROR", "WARN" |
LC_ALL | "en_US.UTF-8" | Language settings for displaying Chinese characters |