Skip to main content

Posts

Showing posts with the label python

Optical Character Recognition OCR for Phone number and email address images to text

Sometime we want to crawling data from a website. First, crawling data is illegal (in most cases?). But I tried anyway, for technical study, apply first. It turned out that there are many good tools for this. So I start to use these tools for current project. It mostly consist of NodeJS Cheerio for read HTML (like jQuery with browser). OCR Tesseract for read some text from images. Install locally or use node package. And obviously Database, I am using MySQL. http://www.leptonica.org/ https://realpython.com/setting-up-a-simple-ocr-server/ https://nanonets.com/blog/ocr-with-tesseract/ Test (training ?) data. https://osdn.net/projects/sfnet_tesseract-ocr-alt/downloads/tesseract-ocr-3.02.eng.tar.gz/ OCR + OpenCV (a lot of example to use ) (English only ?) https://nanonets.com/blog/ocr-with-tesseract/ https://stackoverflow.com/questions/14800730/tesseract-running-error Some Android app I have tried work really well with Vietnamese (tried with printed Shopee invoice). Will try another app an...

Some AWS lambda functions

import json from urllib.request import Request, urlopen def lambda_handler(event, context): #webhookurl webhookurl = "https://hooks.slack.com/services/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" # ec2 detail = event['detail'] instance_id = detail['instance-id'] instance_state = detail['state'] messe = "msg here" if instance_id == "i-000d520e3ec8d6f97" : messe = "STG" elif instance_id == "i-0e2b0157636751cc7" : messe = "sest" elif instance_id == "i-018fcaabe46773e38" : messe = "prod" elif instance_id == "i-06fcd00b94795927c" : messe = "live" elif instance_id == "" : messe = "STG02" # (attachmen if instance_state == "stopped": slack_message = { "attachments": [ { ...

python 2

some interesting topic with python https://stackoverflow.com/questions/50134790/python-ffmpeg-moov-atom-not-found-invalid-data-when-processing-input OP  https://cheatortrick.blogspot.com/2018/03/fix-video-bi-loi.html Another very interesting tool: “We googled 2 days to find a solution to repair some broken .MP4 movie files – we couldn’t find one, so we started to build our own.” But this seem a paid software. Very smart business, many app like uber is born from current lack of similar tool/app. But I think in this case it should/can be free since many opensource tool can handle it (?). http://grauonline.de/cms2/?page_id=5 And it seem this tool write by some chinese developer. Remembering WanDriver and manual virus killer by some talent chinese. some more tar usage https://github.com/ponchio/untrunc Unzip the Libav source code into the Untrunc source directory with either: tar -xJf libav-12.3.tar.xz -C untrunc-master [or:  unzip v12.3.zip -d untrunc-master ]