{"id":390108,"date":"2024-06-29T09:02:11","date_gmt":"2024-06-29T09:02:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=390108"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T09:02:11","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=390108","title":{"rendered":"<span>\u041a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HUAWEI ML Kit \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043f\u043f\u043b\u0435\u0442 \u0434\u043b\u044f \u0444\u043e\u0442\u043e \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443 \u0434\u043b\u044f \u0443\u043b\u044b\u0431\u043e\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HUAWEI ML Kit. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e HUAWEI ML Kit. <\/p>\n<p>  \u0412\u0430\u0441 \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043d\u0430 \u0443\u0447\u0435\u0431\u0435 \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0441 \u0446\u0432\u0435\u0442\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432? \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438. \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u0432 \u0438\u043d\u0441\u0442\u0438\u0442\u0443\u0442\u0435 \u043d\u0430\u043c \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430, \u043d\u043e \u0444\u043e\u0442\u043e\u0441\u0442\u0443\u0434\u0438\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u0430. \u0422\u043e\u0433\u0434\u0430 \u044f \u0441\u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u043d\u0430. \u0418 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0432\u044b\u0433\u043e\u0432\u043e\u0440 \u043e\u0442 \u043f\u0440\u0435\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u0435\u043b\u044f. \u041d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 HUAWEI ML Kit \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c SDK \u0434\u043b\u044f \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u043f\u043f\u043b\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u043e\u0442\u043e \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439.<\/p>\n<p>  \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 SDK \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430\u0445 \u043d\u0430 \u0431\u0430\u0437\u0435 Android.<\/p>\n<h2>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0430\u043f\u043f\u043b\u0435\u0442\u0430 \u0434\u043b\u044f \u0444\u043e\u0442\u043e \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e<\/h2>\n<p>  <\/p>\n<h3>1. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>  <\/p>\n<h4>1.1 \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Maven Huawei \u0432 \u0444\u0430\u0439\u043b \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 build.gradle<\/h4>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <b>build.gradle<\/b> \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Android Studio.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/hm\/vj\/gg\/hmvjgg_pq2f6dcquh5nu95hnhjq.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/hm\/vj\/gg\/hmvjgg_pq2f6dcquh5nu95hnhjq.png\"\/><\/p>\n<p>  <a name=\"habracut\"><\/a>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f Maven.<\/p>\n<pre><code class=\"java\">buildscript {     repositories {                 maven {url 'http:\/\/developer.huawei.com\/repo\/'}     }     } allprojects {     repositories {                maven { url 'http:\/\/developer.huawei.com\/repo\/'}     } } <\/code><\/pre>\n<p>  <\/p>\n<h4>1.2 \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 SDK \u0432 \u0444\u0430\u0439\u043b \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f build.gradle<\/h4>\n<p>  \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 SDK \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u0446 \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 SDK.<\/p>\n<pre><code class=\"java\">dependencies{    implementation 'com.huawei.hms:ml-computer-vision:1.0.2.300'    implementation 'com.huawei.hms:ml-computer-vision-image-segmentation-body-model:1.0.2.301'    }<\/code><\/pre>\n<p>  <\/p>\n<h4>1.3 \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b AndroidManifest.xml<\/h4>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u043b\u0430\u0441\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437 HUAWEI AppGallery \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u0430\u0439\u043b <b>AndroidManifest.xml<\/b>:<\/p>\n<pre><code class=\"javascript\">&lt;manifest        &lt;application          &lt;meta-data                                 android:name=\"com.huawei.hms.ml.DEPENDENCY\"                      android:value= \"imgseg \"\/>                    &lt;\/application> &lt;\/manifest>  <\/code><\/pre>\n<p>  <\/p>\n<h4>1.4 \u0417\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u0435 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u041a\u0430\u043c\u0435\u0440\u0435 \u0438 \u041f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 AndroidManifest.xml<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\"> &lt;uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" \/> <\/code><\/pre>\n<p>  <\/p>\n<h3>2. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043e\u0434\u0430<\/h3>\n<p>  <\/p>\n<h4>2.1 \u041e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u0437\u0430\u044f\u0432\u043a\u0443 \u043d\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0430\u0432<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\">@Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);     if (!allPermissionsGranted()) {         getRuntimePermissions();     } }  @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,                                        @NonNull int[] grantResults) {     super.onRequestPermissionsResult(requestCode, permissions, grantResults);      if (requestCode != PERMISSION_REQUESTS) {         return;     }     boolean isNeedShowDiag = false;     for (int i = 0; i &lt; permissions.length; i++) {         if (permissions[i].equals(Manifest.permission.READ_EXTERNAL_STORAGE) &amp;&amp; grantResults[i] != PackageManager.PERMISSION_GRANTED) {             isNeedShowDiag = true;         }     }     if (isNeedShowDiag &amp;&amp; !ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CALL_PHONE)) {         AlertDialog dialog = new AlertDialog.Builder(this)                 .setMessage(getString(R.string.camera_permission_rationale))                 .setPositiveButton(getString(R.string.settings), new DialogInterface.OnClickListener() {                     @Override                     public void onClick(DialogInterface dialog, int which) {                         Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);                         intent.setData(Uri.parse(\"package:\" + getPackageName()));                          startActivityForResult(intent, 200);                         startActivity(intent);                     }                 })                 .setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {                     @Override                     public void onClick(DialogInterface dialog, int which) {                         finish();                     }                 }).create();         dialog.show();     } } <\/code><\/pre>\n<p>  <\/p>\n<h4>2.2 \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h4>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>MLImageSegmentationSetting<\/b>.<\/p>\n<pre><code class=\"java\">MLImageSegmentationSetting setting = new MLImageSegmentationSetting.Factory()                 .setAnalyzerType(MLImageSegmentationSetting.BODY_SEG)                 .setExact(true)                 .create();         this.analyzer = MLAnalyzerFactory.getInstance().getImageSegmentationAnalyzer(setting); <\/code><\/pre>\n<p>  <\/p>\n<h4>2.3 \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 MLFrame \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e android.graphics.Bitmap, \u0447\u0442\u043e\u0431\u044b \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043c\u043e\u0433 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\">MLFrame mlFrame = new MLFrame.Creator().setBitmap(this.originBitmap).create(); <\/code><\/pre>\n<p>  <\/p>\n<h4>2.4 \u0412\u044b\u0437\u043e\u0432\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 asyncAnalyseFrame \u0434\u043b\u044f \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\"> Task&lt;MLImageSegmentation> task = analyzer.asyncAnalyseFrame(frame);  Task&lt;MLImageSegmentation> task = this.analyzer.asyncAnalyseFrame(mlFrame);             task.addOnSuccessListener(new OnSuccessListener&lt;MLImageSegmentation>() {                 @Override                 public void onSuccess(MLImageSegmentation mlImageSegmentationResults) {                     \/\/ Transacting logic for segment success.                     if (mlImageSegmentationResults != null) {                         StillCutPhotoActivity.this.foreground = mlImageSegmentationResults.getForeground();                         StillCutPhotoActivity.this.preview.setImageBitmap(StillCutPhotoActivity.this.foreground);                         StillCutPhotoActivity.this.processedImage = ((BitmapDrawable) ((ImageView) StillCutPhotoActivity.this.preview).getDrawable()).getBitmap();                         StillCutPhotoActivity.this.changeBackground();                     } else {                         StillCutPhotoActivity.this.displayFailure();                     }                 }             }).addOnFailureListener(new OnFailureListener() {                 @Override                 public void onFailure(Exception e) {                     \/\/ Transacting logic for segment failure.                     StillCutPhotoActivity.this.displayFailure();                     return;                 }             }); <\/code><\/pre>\n<p>  <\/p>\n<h4>2.5 \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0444\u043e\u043d \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\">this.backgroundBitmap = BitmapUtils.loadFromPath(StillCutPhotoActivity.this, id, targetedSize.first, targetedSize.second); BitmapDrawable drawable = new BitmapDrawable(backgroundBitmap); this.preview.setDrawingCacheEnabled(true); this.preview.setBackground(drawable); this.preview.setImageBitmap(this.foreground); this.processedImage = Bitmap.createBitmap(this.preview.getDrawingCache()); this.preview.setDrawingCacheEnabled(false); <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h4>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c! \u0412\u0430\u0448 \u0430\u043f\u043f\u043b\u0435\u0442 \u0434\u043b\u044f \u0444\u043e\u0442\u043e \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435. \u0422\u0430\u043a \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0435\u0433\u043e \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438!<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/i8\/pk\/aw\/i8pkawuh-izqh2_fit9jh7yt6nw.gif\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/i8\/pk\/aw\/i8pkawuh-izqh2_fit9jh7yt6nw.gif\"\/><\/p>\n<p>  \u041c\u044b \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 GitHub: <a href=\"https:\/\/github.com\/HMS-Core\/hms-ml-demo\/tree\/master\/ID-Photo-DIY\" rel=\"nofollow\">github.com\/HMS-Core\/hms-ml-demo\/tree\/master\/ID-Photo-DIY<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442\u0435 \u043d\u0430\u0432\u044b\u043a\u0430\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0432\u0430\u043c \u043d\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u0441\u0442\u044e\u043c \u043a \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u0443?<\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u044d\u0442\u043e\u0433\u043e \u0430\u043f\u043f\u043b\u0435\u0442\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439: <\/p>\n<ol>\n<li>\u0412\u044b\u0440\u0435\u0437\u0430\u0442\u044c \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u044b \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0444\u043e\u043d, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0444\u043e\u043d\u0430 \u0438\u043b\u0438 \u0440\u0430\u0437\u043c\u044b\u0442\u0438\u0435 \u0444\u043e\u043d\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0448\u0435\u0434\u0435\u0432\u0440\u043e\u0432. <\/li>\n<li>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0435\u0431\u0430, \u0435\u0434\u044b, \u0440\u0430\u0441\u0442\u0435\u043d\u0438\u0439, \u043a\u043e\u0448\u0435\u043a, \u0441\u043e\u0431\u0430\u043a, \u0446\u0432\u0435\u0442\u043e\u0432, \u0432\u043e\u0434\u044b, \u043f\u0435\u0441\u043a\u0430, \u0437\u0434\u0430\u043d\u0438\u0439 \u0438 \u0433\u043e\u0440 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0437\u0430\u0445\u043e\u0442\u044f\u0442 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043d\u0438\u043c\u043a\u0438, \u0441\u0434\u0435\u043b\u0430\u0432 \u043d\u0435\u0431\u043e \u0431\u043e\u043b\u0435\u0435 \u0433\u043e\u043b\u0443\u0431\u044b\u043c, \u0430 \u0432\u043e\u0434\u0443 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0441\u0442\u043e\u0439. <\/li>\n<li>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435\u043e, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0444\u043e\u043d \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u0432\u0438\u0434\u0435\u043e.\n<p>  \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043d\u0430 \u043d\u0430\u0448 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442 <br \/>   <a href=\"https:\/\/developer.huawei.com\/consumer\/en\/doc\/development\/HMS-Guides\/ml-introduction-4\" rel=\"nofollow\">developer.huawei.com\/consumer\/en\/doc\/development\/HMS-Guides\/ml-introduction-4<\/a>.<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u041d\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b<\/h2>\n<p>  \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 HUAWEI ML Kit. \u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438!<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/514722\/\"> https:\/\/habr.com\/ru\/articles\/514722\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u041e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f<\/h2>\n<p>  \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443 \u0434\u043b\u044f \u0443\u043b\u044b\u0431\u043e\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HUAWEI ML Kit. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0441\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e HUAWEI ML Kit. <\/p>\n<p>  \u0412\u0430\u0441 \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u043d\u0430 \u0443\u0447\u0435\u0431\u0435 \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0441 \u0446\u0432\u0435\u0442\u043d\u044b\u043c \u0444\u043e\u043d\u043e\u043c \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432? \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438. \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u0432 \u0438\u043d\u0441\u0442\u0438\u0442\u0443\u0442\u0435 \u043d\u0430\u043c \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430, \u043d\u043e \u0444\u043e\u0442\u043e\u0441\u0442\u0443\u0434\u0438\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u0430. \u0422\u043e\u0433\u0434\u0430 \u044f \u0441\u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u043d\u0430. \u0418 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0432\u044b\u0433\u043e\u0432\u043e\u0440 \u043e\u0442 \u043f\u0440\u0435\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u0435\u043b\u044f. \u041d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 HUAWEI ML Kit \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c SDK \u0434\u043b\u044f \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0430\u043f\u043f\u043b\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u043e\u0442\u043e \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439.<\/p>\n<p>  \u0421\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 SDK \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430\u0445 \u043d\u0430 \u0431\u0430\u0437\u0435 Android.<\/p>\n<h2>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0430\u043f\u043f\u043b\u0435\u0442\u0430 \u0434\u043b\u044f \u0444\u043e\u0442\u043e \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e<\/h2>\n<p>  <\/p>\n<h3>1. \u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>  <\/p>\n<h4>1.1 \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Maven Huawei \u0432 \u0444\u0430\u0439\u043b \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 build.gradle<\/h4>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <b>build.gradle<\/b> \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Android Studio.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/hm\/vj\/gg\/hmvjgg_pq2f6dcquh5nu95hnhjq.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/webt\/hm\/vj\/gg\/hmvjgg_pq2f6dcquh5nu95hnhjq.png\"\/><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-390108","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/390108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=390108"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/390108\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=390108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=390108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=390108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}