Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
def detect_text(path): """Detects text in the file.""" import io, os from google.cloud import vision import json os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = './GoogleVisionKeys.json' # Autentykacja klienta client = vision.ImageAnnotatorClient() with io.open(path, 'rb') as image_file: content = image_file.read() image = vision.Image(content=content) response = client.text_detection(image=image) texts = response.text_annotations print(float(texts[0].description)) if response.error.message: raise Exception('{}\nFor more info on error messages, check: ' 'https://cloud.google.com/apis/design/errors'.format(response.error.message)) return float(texts[0].description) detect_text('meter_digits_only.png') # obrazek do detekcji cyferek
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)