Closed artemsivcev closed 4 years ago
For tests, I compressed the image to 1280px, but still have different result, for different iPhones...
Now I took image from example and there is still different result for iPhone 8 and X. | Prop | iPhone 8 | iPhone X |
---|---|---|---|
Height | 1536.0 | 1536.0 | |
Width | 1024.0 | 1024.0 | |
Scale | 1.0 | 1.0 | |
Wege der | [(410, 666) - (631, 643)][(414, 710) - (636, 688)] | [(410, 667) - (631, 644)][(414, 713) - (636, 691)] | |
parlamentarischen | [(287, 738) - (743, 686)][(292, 785) - (748, 733)] | [(287, 738) - (742, 685)][(292, 785) - (747, 733)] | |
Demokratie | [(372, 786) - (651, 754)][(376, 825) - (655, 794)] | [(372, 785) - (650, 754)][(376, 825) - (654, 794)] |
As you can see there is some mismatch for text coordinates for same image on different devices. And if you try to proceed this image several times you have got same result per device. But why and how to avoid this?
Sorry missclick...
@artemsivcev Thanks for the report. We're tracking internally at b/156483920
@paulb777 is there any chance for hotfix to this issue?
Now I tested version 0.12.0 and 0.18.0 for this bug and there it is, but with different coordinates. In ver.12 there is more accuracy between devices: | Prop | iPhone 8 | iPhone X |
---|---|---|---|
Height | 1536.0 | 1536.0 | |
Width | 1024.0 | 1024.0 | |
sclae | 1.0 | 1.0 | |
Wege der | [(412, 665) - (633, 645)][(416, 713) - (637, 694)] | [(410, 665) - (633, 645)][(414, 713) - (637, 694)] | |
parlamentarischen | [(287, 739) - (743, 688)][(292, 784) - (748, 734)] | [(287, 739) - (743, 688)][(292, 784) - (748, 734)] | |
Demokratie | [(372, 785) - (650, 754)][(376, 824) - (654, 794)] | [(372, 785) - (651, 754)][(376, 824) - (655, 794)] |
And in ver.18 same result as ver.19
@paulb777 Hi! Any progress?
@artemsivcev Sorry, not yet. I repinged the MLKit team.
@paulb777 sorry for trying, but... Still nothing? We are used this solution on production and this is really major issue...
@paulb777 Hi! Any progress?) I can help if you need it.
@morganchen12 ok, I can ping you instead)) I'm really want to resolve this issue and help!
Hey, sorry for the delay @artemsivcev. I'll take a look at this today. Are you receiving different results on different devices if you use the exact same image (not just two separate images downscaled to the same size)?
@morganchen12 yes, I sent on 2 iPhones 1 image via AirDrop. Then I open it with UIImage and compare all meta info and it was exactly the same. Where can I check downscaled info?
Your approach should be sufficient. I'll investigate.
I haven't been able to identify a root cause yet. I'll try reproducing this issue in the quickstart and continue from there.
Ok, if you need any info or help let me know
@morganchen12 Some update, on all simulators same result for coordinates, problem only on real devices
Thanks @artemsivcev, I was also unable to reproduce the issue on simulator. Due to the work from home situation, I'm not immediately able to acquire another iOS device to test this on, so I'm going to have to ask for your help for on-device testing.
ML Kit's text recognition uses GoogleMobileVision under the hood. Can you try running text detection directly through GMV via the instructions in this doc and letting us know if the results differ per-device?
@morganchen12 yeah of course, I'll try it right now
Same test image, same test devices. Same different result. But please, don't redirect me to GoogleMobileVision repo) Prop | iPhone 8 | iPhone X |
---|---|---|
Height | 1536.0 | 1536.0 |
Width | 1024.0 | 1024.0 |
scale | 1.0 | 1.0 |
Wege der | [410.0, 644.0, 229.0, 68.0] | [410.0, 645.0, 229.0, 67.0] |
parlamentarischen\nDemokratie | [287.0, 688.0, 467.0, 147.0] | [288.0, 688.0, 465.0, 146.0] |
Thanks, I'll pass this info on to the GMV team. In the meantime, what version of GMV are you using? Does the behavior change if you switch to an older version?
@morganchen12 I get GMV from CocoaPods, think that was last one. Without issue in GMV repo(there is one?) it's dead end... Whom I suppose to ping? =D Need a solution for this...
You can manually pin an older version of a CocoaPod by explicitly listing it in your Podfile with the =
operator. Don't worry about pinging the GMV team, I've done that for you (their issue tracker is Google-internal).
pod 'GoogleMobileVision', `= 1.5.0`
Only 1.5.0 need to check? And how to see all a available version on pods?
You should hopefully only need to check 1.5.0. You can check which versions of a pod are available by looking at the podspecs on GitHub: https://github.com/CocoaPods/Specs/tree/master/Specs/0/4/2/GoogleMobileVision
@morganchen12 GMV 1.5.0 test. There is only one line for iPhoneX... Still different result, but something new!
Prop | iPhone 8 | iPhone X |
---|---|---|
Height | 1536.0 | 1536.0 |
Width | 1024.0 | 1024.0 |
scale | 1.0 | 1.0 |
Wege der | [414.0, 643.0, 233.0, 69.0] | [-] |
parlamentarischen\nDemokratie | [290.0, 687.0, 468.0, 155.0] | [-] |
Wege der parlamentarischen Demokratie | [-] | [284.0, 635.0, 471.0, 205.0] |
Thanks, looks like this behavior has been broken for some time now. I'll keep this updated with the GMV team's response, which may take a week or two. In the meantime let's try to find a workaround for your use case.
What are you using text recognition for and why is it important that text recognition is consistent across different devices?
I'm using it for detect table data. Some photo contains problems with degree angle for text. I try to use angle of bottom line of each block to detect average angle and create a straight line between blocks. And I create the best solution and it works, but only on iPhone 8. Now I found some workaround and used only longest blocks for detect angle. It's pretty close, but still have some issues...
@morganchen12 hey there! Any progress?
I have not been able to pin down why GMV returns different results on different devices. I'll let you know if I'm able to find a root cause.
@morganchen12 Hello! Still nothing? GMV team keep silent?
Nothing yet. I've pinged the internal bug for you.
That would be nice) And what they say?
They have yet to respond.
The Firebase ML Kit text recognition API has been deprecated since all on-device ML Kit features are no longer a part of Firebase. You should move to using the Google standalone ML Kit instead by following the migration guide here.
Sorry for the bad news.
[REQUIRED] Step 1: Describe your environment
CocoaPods
(and cinterop, kotlin multiplatform)[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
Hey there! I have 2 same images and 2 iPhones: 8 and X. UIImage have scale set to 1 and cropped width and height by app. Then I send this image in onDeviceTextRecognizer() and get 2 different maps with all different results. Why so? Is there some scale dependence in ML KIT library? Images is not too small. height = 2048, width = 1383. I have same result without cropping image.