HMS-Core / hms-ml-demo

HMS ML Demo provides an example of integrating Huawei ML Kit service into applications. This example demonstrates how to integrate services provided by ML Kit, such as face detection, text recognition, image segmentation, asr, and tts.
https://developer.huawei.com/consumer/en/hms/huawei-mlkit?ha_source=hms1
Apache License 2.0
357 stars 120 forks source link

ML-Kit Text: Chinese OCR not working #24

Closed minkiapps closed 4 years ago

minkiapps commented 4 years ago

I am trying to use the offline Chinese text recognition on my Google Pixel 2 XL, it is not working. I have HMS Core installed on my device. (Version: 5.0.1.313)

This is the code how I initialise MLTextAnalyser:

private val hmsTextRecognizer : MLTextAnalyzer by lazy {
     val setting = MLLocalTextSetting.Factory()
         .setOCRMode(MLLocalTextSetting.OCR_DETECT_MODE)
         .setLanguage("zh")
         .create()
     MLAnalyzerFactory.getInstance().getLocalTextAnalyzer(setting)
}

The TextAnalyser doesn't recognise any text. I see following error:

E/CountryCodeBean: getVendorCountry=UNKNOWN E/CountryCodeBean: getSimCountryCode by not enableNetwork, countryCode=at E/CountryCodeBean: getVendorCountry=UNKNOWN E/CountryCodeBean: getSimCountryCode by not enableNetwork, countryCode=at E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN E/HaLogProvider: forbiddenHiLog openHa = false E/FocusShootOCREngine: ocr load model failed E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN E/HaLogProvider: forbiddenHiLog openHa = false

On my Huawei Mate 30 Pro it works.

Mike-mei commented 4 years ago

@minkiapps What is the text dependencies that you integrate in build.gradle?

minkiapps commented 4 years ago

Thanks for asking, I just realised I didn't include implementation 'com.huawei.hms:ml-computer-vision-ocr-cn-model:2.0.1.300' I wasn't paying attention because seems like on my Huawei Mate 30 Pro it works without it...

This issue can be closed.

I have another question, I see in the documentation that ML-Kit TTS is only available on Huawei phone, will it be sometime also available on non Huawei phones (but with HMS core installed)?

Mike-mei commented 4 years ago

TTS is only available on Huawei phone now, non Huawei phones are temporarily unavailable, but we will consider your suggestions.