Reminder: We will be carrying out upgrades to AppGallery Connect from 16:00 UTC to 21:00 UTC on September 21, 2020. The development, distribution, operations, and analytics services may be temporarily unavailable during the process. We would like to apologize for any inconvenience this may cause you.
Bitmap bitmap = BitmapFactory.decodeFile(filePath); // Get Bitmap (Note that bitmap type here must be ARGB8888, conversion is needed if necessary)
Frame frame = new Frame();// Construct FrameObject
TxtImageSuperResolution tsr = new TxtImageSuperResolution (context);
//Text super-resolution in process
ImageSRResult srresult = tsr.doSuperResolution(frame, null);
Bitmap bmp = srresult.getBitmap();
Get the processed bitmap from the result
The image after super-resolution
Yes. In detect() method engine startup is in default. The engine will not start up again if started, please use with confidence.
The release() method will uninstall a model that has been loaded to the NPU chip. If the app is no longer using face detection, uninstall the model in a timely manner to free up resources.
The HiAi Engine does not allow an app to call multiple threads for a single API. This is because if one thread finishes first, it will call the release() method and uninstall the model, resulting in errors in all of the other threads. In the NPU, the back end service also executes tasks in order, so it is unable to run multiple threads through one function at the same time. However, multiple threads can be enabled at the same time if they are calling different APIs. For example, it is possible to enable one thread for Aesthetic Scoring, and another one for Scene Detection.