This project aims to implment the OCR 'zigmac' parser (pypi link) to tag Azure Blobs with backbone easyOcr
Python 3.10.12 machine to run script (preferably vm with gpu.. This implementation will be ported to Databricks for compute resources there) Docker
pip install azure-storage-blob azure-identity python-dotenv easyocr- https://ats-iiot.imgix.net/6058fb8b03e0890006150140/63ff7f2dc73e7f1780c08500/9b704292-fe1a-437d-824f-b21f41abe258?s=18fde89132ad6c9529ce3b79e7cffb0f
- https://ats-iiot.imgix.net/67f80bf132043c0cb14fafaf/4e7441c7-83a1-47f1-a0a6-fb8e5e40f1de?s=9b5f706ce6b520df3d9b83709faa23ae
- https://ats-iiot.imgix.net/6058fb8b03e0890006150140/6400ae6613a3f8453eacc49d/acc00b7f-a180-4bb6-a008-2af837089a4b?s=df896ad6902d62f39b3bc81480d2e358
- https://ats-iiot.imgix.net/6058fb8b03e0890006150140/67dc69b4c20c19ef1d985c7e/447f0a00-5e3a-4545-b6b0-e8c00486ebbb?s=9c51d70f147c70e4d838293014c51215
- https://ats-iiot.imgix.net/6058fb8b03e0890006150140/65822b0be14f05170500476f/c24150af-49a0-4730-924f-de1535387aea?s=d00497b3e075dfa35fa4522861fca1ed
- https://ats-iiot.imgix.net/67fe8319fc60303b1d04b7f7/6ba37b6b-8be4-4334-bc7c-d775b4c87dbf?s=4e24ed82c22560c6159d77623ec2026e
- https://ats-iiot.imgix.net/6058fb8b03e0890006150140/67116d16446cdec19abffb2c/297ce36a-ca43-4b6f-b0bf-ae7580440466?s=582da5864cb3f2e9b68a7ea5eca0678b
from util.blobClient import BlobClient
blob_client = BlobClient(
storage_account_name="your_storage_account_name",
storage_account_key="your_storage_account_key",
container_name="your_container_name"
)tags = {"env": "dev", "project": "example"}
blob_client.tag_blob(folder_path="path/to/blob.txt", tags=tags)cat home/24c.ocr/log.txt | grep "{'mac': '00"gen ssh ed25519 credentials add pub key to run pod
tmux
ssh r5hnl6wc2nzzdi-6441195a@ssh.runpod.io -i ~/.ssh/id_ed25519As of 4/30/25 11:16 (UTC Central) 128440 including direcotres
cat log.txt | grep "Failed processing blob at index" log.txt | tail -1 | awk -F'index ' '{print $2}' | awk -F' ' '{print $1}'
grep -c "{'mac': '00" log.txt
# reading tape on a motor but parsing out what what it actially says. I could parse this reading out. it usualy happens on readings that are only seril.
# if (!mac && serial) echo readings > logtxt
#
Processed Results for 6058fb8b03e0890006150140/6489a711604db235c3f8d1a6/14d158d2-d7a5-458d-952a-a2cb12e852bc: {'mac': None, 'serial': 'S577'}
Processed Results for 6058fb8b03e0890006150140/648cdc8362be0caea63da393/12cb7fc8-e6db-4c43-834b-3881bf4ccaaa: {'mac': None, 'serial': 'S0106'}ii
- outputs both labled but only serial is valid. This usualy happenens on old sensor labels with big S# but small mac. logic to read a qr code from an image would be another good ai capabiliy. Not sure how to as its not a charchter
Readings:[('19735', 0.9928094162216953), ('00,1342 00', 0.7659641401321924), ('42 35 Da 98', 0.3699840879092524)]
Processed Results for 66b4fb566772daaac2b1a448/92dbc06f-6526-459a-be5f-dde2960d0dd5: {'mac': '00:13:42:00:42:35:da:98', 'serial': None}
# this image( 1st and second) is a duplicate we could auto delete duplicates
Processed Results for 6058fb8b03e0890006150140/648b4b15158ff8a022346b2a/e1409eab-cd55-4f52-a7a0-3212a3ff5fc0: {'mac': None, 'serial': 's510'}
Processed Results for 6058fb8b03e0890006150140/648b4b3d480c928f97999f06/01806ed1-59e2-444b-b5a9-a8d569d0b6c8: {'mac': None, 'serial': 's510'}
Processed Results for 6058fb8b03e0890006150140/648b6656158ff8a02234a8c5/1b7c2dd2-b51f-4b50-bce7-8f9f018a0cca: {'mac': None, 'serial': 's115'}# This image I read wrong at first.
Processed Results for 6058fb8b03e0890006150140/648cdc8362be0caea63da393/8563b4dd-52e9-4253-ae9a-ecf403ab72dd: {'mac': '00:13:a2:00:42:29:e1:b9', 'serial': None}
Processed Results for 6058fb8b03e0890006150140/648b3189158ff8a022342e5e/ef400b1e-830d-49ef-9718-861db17a02f2: {'mac': '00:13:a2:00:41:f5:8c:97', 'serial': 'S2763'}
Processed Results for 6058fb8b03e0890006150140/648cdbef2f4ef3ba6a88e7b0/a5358f06-acbf-4a7b-8cf9-459cad7cfdfb: {'mac': '00:13:a2:00:42:2d:fe:1c', 'serial': 'S_10268'}
Processed Results for 6058fb8b03e0890006150140/648b39ab2f4ef3ba6a8485c5/2d24bfc5-6fcc-4471-9471-cd52300c4859: {'mac': '00:13:a2:00:41:f6:fa:31', 'serial': None}
Processed Results for 6058fb8b03e0890006150140/648b39412f4ef3ba6a848484/8b240400-4dc7-46ea-b4ce-d9cd2c47ac64: {'mac': '00:13:a2:00:41:f6:fa:d4', 'serial': 'S_2770'}
Processed Results for 6058fb8b03e0890006150140/648b385308194cb84fbc3249/a1d9efba-5b12-43b5-a13a-17f5fc927d55: {'mac': '00:13:42:00:42:2d:fd:7b', 'serial': None}
Processed Results for 6058fb8b03e0890006150140/648b43adf96af772a4c45c12/f86e5121-5079-4966-b323-9993e6270e1c: {'mac': '00:13:a2:00:42:2d:68:56', 'serial': 'S_10290'}
Processed Results for 6058fb8b03e0890006150140/648dda572f4ef3ba6a8b9536/87ea616e-010b-47b3-87a7-129e854fa229: {'mac': '00:13:a2:00:42:11:40:84', 'serial': 'S_7007'}
Processed Results for 6058fb8b03e0890006150140/648dedf362be0caea640898d/93e996b8-adfe-4b64-b150-86cee60c84f3: {'mac': '00:13:42:00:42:29:e7:be', 'serial': 'S_8211'}# the acutal s# of this sensor is s_5721. I need to log the readings in the future to infer more. But I bet the S_ was a seperate reading from a number 5721. 5 for swapped as.
Processed Results for 6058fb8b03e0890006150140/648cce3af96af772a4c87a0a/87379f78-9b93-484c-9401-66e6d7e475c5: {'mac': '00:13:a2:00:41:f6:b1:66', 'serial': 'S712'}
- pull duplicate readings and delete one of the duplicated blob
- for every result that has mac & serial - cross reffrence with sql to validate .. if valid tag 'varified: true'