WAI
Status Update
Comments
ab...@google.com <ab...@google.com> #2
Hi,
I did try to reproduce the issue but I did not get the same results.
I used the github detect.py example [1] which is the same as the one in Google documentation that you provided above.
1- I did try to test it locally where the photo is stored in my terminal local file using the following command line :
$ python test_document_detect.py document ./resources/wakeupcat.jpg
Which resulted to :
~~~~
Block confidence: 0.990000009537
Paragraph confidence: 0.990000009537
Word text: Wake (confidence: 0.990000009537)
Symbol: W (confidence: 0.990000009537)
Symbol: a (confidence: 1.0)
Symbol: k (confidence: 0.990000009537)
Symbol: e (confidence: 0.990000009537)
Word text: up (confidence: 1.0)
Symbol: u (confidence: 1.0)
Symbol: p (confidence: 1.0)
Word text: human (confidence: 0.990000009537)
Symbol: h (confidence: 0.990000009537)
Symbol: u (confidence: 0.990000009537)
Symbol: m (confidence: 0.990000009537)
Symbol: a (confidence: 1.0)
Symbol: n (confidence: 1.0)
Word text: ! (confidence: 0.959999978542)
Symbol: ! (confidence: 0.959999978542)
~~~~
2- Then I did try to test with providing a photo URI using the following command line :
$ python detect.py document-urihttps://www.researchgate.net/profile/Yaron_Kanza/publication/221326044/figure/fig1/AS:670048624574476@1536763449601/Labeled-tree-corresponding-to-the-document-fragment.png
Which resulted to :
~~~~
Block confidence: 0.990000009537
Paragraph confidence: 0.990000009537
Word text: inproceedings (confidence: 0.990000009537)
Symbol: i (confidence: 0.990000009537)
Symbol: n (confidence: 1.0)
Symbol: p (confidence: 0.990000009537)
Symbol: r (confidence: 0.990000009537)
Symbol: o (confidence: 1.0)
Symbol: c (confidence: 0.990000009537)
Symbol: e (confidence: 0.930000007153)
Symbol: e (confidence: 0.990000009537)
Symbol: d (confidence: 1.0)
Symbol: i (confidence: 1.0)
Symbol: n (confidence: 1.0)
Symbol: g (confidence: 1.0)
Symbol: s (confidence: 1.0)
Block confidence: 0.990000009537
Paragraph confidence: 0.990000009537
Word text: 2 (confidence: 0.990000009537)
Symbol: 2 (confidence: 0.990000009537)
Block confidence: 0.990000009537
Paragraph confidence: 0.990000009537
Word text: booktitle (confidence: 0.990000009537)
.
.
.
~~~~
For both cases we can have the level of confidence calculated with no issues, thank you.
[1]https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/vision/cloud-client/detect/detect.py
I did try to reproduce the issue but I did not get the same results.
I used the github detect.py example [1] which is the same as the one in Google documentation that you provided above.
1- I did try to test it locally where the photo is stored in my terminal local file using the following command line :
$ python test_document_detect.py document ./resources/wakeupcat.jpg
Which resulted to :
~~~~
Block confidence: 0.990000009537
Paragraph confidence: 0.990000009537
Word text: Wake (confidence: 0.990000009537)
Symbol: W (confidence: 0.990000009537)
Symbol: a (confidence: 1.0)
Symbol: k (confidence: 0.990000009537)
Symbol: e (confidence: 0.990000009537)
Word text: up (confidence: 1.0)
Symbol: u (confidence: 1.0)
Symbol: p (confidence: 1.0)
Word text: human (confidence: 0.990000009537)
Symbol: h (confidence: 0.990000009537)
Symbol: u (confidence: 0.990000009537)
Symbol: m (confidence: 0.990000009537)
Symbol: a (confidence: 1.0)
Symbol: n (confidence: 1.0)
Word text: ! (confidence: 0.959999978542)
Symbol: ! (confidence: 0.959999978542)
~~~~
2- Then I did try to test with providing a photo URI using the following command line :
$ python detect.py document-uri
Which resulted to :
~~~~
Block confidence: 0.990000009537
Paragraph confidence: 0.990000009537
Word text: inproceedings (confidence: 0.990000009537)
Symbol: i (confidence: 0.990000009537)
Symbol: n (confidence: 1.0)
Symbol: p (confidence: 0.990000009537)
Symbol: r (confidence: 0.990000009537)
Symbol: o (confidence: 1.0)
Symbol: c (confidence: 0.990000009537)
Symbol: e (confidence: 0.930000007153)
Symbol: e (confidence: 0.990000009537)
Symbol: d (confidence: 1.0)
Symbol: i (confidence: 1.0)
Symbol: n (confidence: 1.0)
Symbol: g (confidence: 1.0)
Symbol: s (confidence: 1.0)
Block confidence: 0.990000009537
Paragraph confidence: 0.990000009537
Word text: 2 (confidence: 0.990000009537)
Symbol: 2 (confidence: 0.990000009537)
Block confidence: 0.990000009537
Paragraph confidence: 0.990000009537
Word text: booktitle (confidence: 0.990000009537)
.
.
.
~~~~
For both cases we can have the level of confidence calculated with no issues, thank you.
[1]
ab...@google.com <ab...@google.com> #3
Hi,
This issue will be closed due to inactivity for last 7 days. If you face the same issue again please create a new case.
Thanks.
This issue will be closed due to inactivity for last 7 days. If you face the same issue again please create a new case.
Thanks.
li...@gmail.com <li...@gmail.com> #4
I actually ran into the same issue. I think the question asked about the API 'text_detection', while the answer was based on 'document_text_detection'.
Can you verify the issue with the 'text_detection' one?
Can you verify the issue with the 'text_detection' one?
zi...@gmail.com <zi...@gmail.com> #5
Hi, I'm having the same issue with text_detection
method. The python client gives confidence of 0 everywhere.
google-cloud-vision==1.0.0
python 3
pages = response.full_text_annotation.pages
for page in pages:
for block in page.blocks:
print('block confidence', block.confidence)
for paragraph in block.paragraphs:
print('paragraph confidence', paragraph.confidence)
for word in paragraph.words:
word_text = ''.join([symbol.text for symbol in word.symbols])
print('Word text : {0} (confidence: {1})'.format(word_text, word.confidence))
for symbol in word.symbols:
print('\tSymbol: {0} (confidence: {1})'.format(symbol.text, symbol.confidence))
hu...@gmail.com <hu...@gmail.com> #6
Hi, I'm having the same issue with text_detection on google-cloud-vision (2.0.0). Please check the issues
sh...@gmail.com <sh...@gmail.com> #7
Same issue for me as well. I am using the nodejs library:
const vision = require('@google-cloud/vision');
const client = new vision.ImageAnnotatorClient();
const [ocrResult] = await client.textDetection("/path/to/file.jpg");
The only confidence values returned correctly are the language detection ones.
fe...@old.stilingue.com.br <fe...@old.stilingue.com.br> #8
Same issue for me, using python.
from google.cloud import vision
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
for text in texts:
print(text.confidence) # always 0.0
ma...@outlook.be <ma...@outlook.be> #9
Can confirm that issue is still active
Python 3.8.5, google-cloud-vision==2.0.0
Since the scanned files are not clean documents, I suppose implementing the code with the 'document_text_detection' function is not the best idea? Will test anyway
Python 3.8.5, google-cloud-vision==2.0.0
Since the scanned files are not clean documents, I suppose implementing the code with the 'document_text_detection' function is not the best idea? Will test anyway
mi...@super.ai <mi...@super.ai> #10
I still have the same issue as well. document_text_detection gives confidences but text_detection doesn't.
google-cloud-vision 2.4.2
python 3.7.11
google-cloud-vision 2.4.2
python 3.7.11
sa...@gmail.com <sa...@gmail.com> #11
I also have the same problem. Because this issue was closed and there were instructions to open a new one if necessary, I did that: https://issuetracker.google.com/issues/200069044 - it has not been replied to yet, but I am leaving this comment here for others stumbling at this page with the same bug.
Description
Problem you have encountered: When using OCR to detect text in images [1], with Python client library, the confidence field is not set properly.
What you expected to happen: Confidence field should have the same value in the "Try the API" option and when performing the recognition with the python client library.
Steps to reproduce:
You can check this easily with any image. Run the following function with any image url:
You will see that confidences are 0.0. Then, use "Try the API" in [2] for the same image. You will see non zero confidences.
I have also checked that the same happens with a local image.
[1]https://cloud.google.com/vision/docs/ocr https://cloud.google.com/vision
[2]