This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # this script is updated in order to support for multi-threaded applications. | |
| # $3 is a random md5 hash or a uuid.uuid4() object that enables gcvocr.sh to be used without having two overlapping files named temp.json | |
| #!/bin/bash | |
| #cd ~ | |
| echo '{"requests":[{"image":{"content":"' > ./$3.json | |
| openssl base64 -in $1 | cat >> ./$3.json | |
| echo '"}, | |
| "features":{"type":"TEXT_DETECTION","maxResults":2048}}]}' >> ./$3.json | |
| curl -k -s -H "Content-Type: application/json" https://vision.googleapis.com/v1/images:annotate?key=$2 --data-binary @./$3.json > "$1.json" |