Deploying Baidu Wenxin 4.5 Open-Source Large Model on AiStudio for Android Call
In the previous article "Deploying theERNIE 4.5 Open-Source Model for Android Device Calls", the blogger introduced how to deploy the ERNIE 4.5 open-source large language model on one's own server. However, for students without GPU servers, this approach is out of reach. Therefore, this article will introduce how to leverage the computing power on AiStudio for free to deploy the ERNIE 4.5 open-source large model for personal use.
Read MoreDeploying Custom Gesture Recognition Models with MediaPipe on Android
This project implements a high-performance real-time gesture recognition Android application based on the Google MediaPipe and Android CameraX technology stacks. It adopts MediaPipe's latest Gesture Recognition API, supporting the recognition of various gesture types, including common gestures such as thumb-up, victory sign, and open palm. Additionally, it features real-time hand key point detection and drawing functionality.
Read MoreCustom Gesture Recognition Training Model with MediaPipe
MediaPipe is an open-source framework developed by Google for building perception pipelines to process time-series data such as video and audio. Among its components, MediaPipe Hands is a high-performance hand key-point detection solution capable of real-time hand key-point detection on mobile devices.
Read MoreImplementing Image Classification on Android Phones Based on TNN
This project is mainly an image classifier based on TensorFlow Lite, which can achieve real-time image recognition on Android devices. Its main functions and implementation steps are as follows: ### Project Structure - **MainActivity.java**: Implements gallery image selection and real-time camera prediction on the main interface. - **MNNClassification.java**: Integrates and encapsulates MNN model-related operations. ### Implementation Ideas 1. **Initialization**:
Read MoreImage Classification on Android Phones Based on MNN
This is a detailed guide on how to implement image classification in an Android application. You have successfully used TensorFlow Lite for image classification and demonstrated how to obtain input data through two methods: calling the camera and selecting images, and then passing this data to the model for prediction. ### Summary of Main Content 1. **Model Initialization**: First, load the pre-trained `mobilenet_v2_1.0_224.tflite` model and create a classifier instance. 2. **Reading Images and Pro
Read MoreFace Detection, Key Point Detection, and Mask Detection on Android with One Line of Code
This paper introduces the method of implementing face detection, key point detection, and mask detection in Android applications using Paddle Lite. The core code is only one line: calling `FaceDetectionUtil.getInstance().predictImage(bitmap)` can complete multiple functions. Behind this line of code, it involves model training and compilation, including face detection (`pyramidbox.nb`), face key point detection (`facekeypoints.nb`), and mask classification (
Read MorePerson Background Replacement on Android Based on Image Semantic Segmentation
Your project has already implemented basic human image recognition and background replacement functions. To further improve and optimize your code, I will provide some improvement suggestions and sample code. ### 1. Improve the processing flow of predicted images During the conversion of prediction results to images, you can consider using the constructor of `Bitmap.createBitmap` to create a bitmap directly from the array, which can reduce the creation of unnecessary temporary objects. Additionally, when drawing a transparent background, you can directly use `Canvas` and `Paint` to set the background transparency.
Read MoreImplementing Image Classification on Android Phones Based on Paddle Lite
Thank you for sharing this Android application development example for image classification based on Paddle Lite. Your project not only covers how to obtain categories from images but also introduces methods for real-time image recognition through the camera, enabling users to quickly understand information about the captured object in practical application scenarios. Below, I will further optimize and supplement the content you provided and offer some suggestions to improve the user experience or enhance code efficiency: ### 1. Project Structure and Resource Management Ensure the project has a clear file structure (e.g., `assets/image
Read MoreImplementation of Image Classification on Android Phones Based on TensorFlow Lite
This project mainly implements an image classification application based on TensorFlow Lite, which can perform object recognition using images from the camera or photo album on an Android device and provide real-time prediction functionality. The following is a detailed analysis of the core steps and key code of this project: ### Project Structure - **TFLiteModel**: Contains model-related configurations. - **MainActivity**: The main interface for launching the camera or selecting images for classification. - **RunClassifier** (Note: The original text seems to be incomplete here, so the translation preserves the placeholder as is.)
Read MoreUsing Mediapipe Framework on Android
Your implementation is very close to completion, but to ensure everything works properly, I will provide a more complete code example with some improvements and optimizations. Additionally, I will explain the role of each part in detail. ### Complete Code First, we need to import the necessary libraries: ```java import android.content.pm.PackageManager; import android.os.Bundle; import android.view.Surfa ``` (Note: The original code snippet appears to be incomplete here, as the `Surfa` import is likely cut off, probably intended to be `SurfaceView` or similar view-related class. The translation assumes the code continues with standard Android view setup and functionality.)
Read MoreImplementing Binocular Range Measurement on Android
This tutorial provides a detailed introduction to using the dual-camera of an Android device for object distance measurement. Below are the summaries and further optimization suggestions: ### Project Overview 1. **Background**: This document introduces an Android-based binocular vision system designed to calculate and display the specific 3D coordinates of objects in images. 2. **Purpose**: To obtain left and right eye perspective data through the camera and utilize Stereopsis technology (i.e., stereoscopic disparity method) to compute depth information. ### Project Structure 1. **Image Processing and Segmentation**
Read MoreBuilding a Smart Assistant Quickly with AIUI on Android
This article introduces how to quickly build a smart assistant similar to Xiaomi's AI Assistant. First, create an application using AIUI (a full-stack human-computer interaction voice solution launched by iFlytek), select the Android platform, and enable the semantic understanding function. Then, add a personalized character and various skills in the skills, and configure fallback responses and text-to-speech. Next, develop an Android application: download the AIUI SDK and copy the dynamic library to the corresponding folder. Modify the APPID in `aiui_phone.json`, run the project for testing, and finally demonstrate a case implemented through this method.
Read MoreDetecting if a User is Speaking Using WebRTC in Android
This article introduces how to implement voice activity detection (VAD) using WebRTC in an Android application. First, an Android project is created, and the `local.properties` file is modified to add the NDK path. A `CMakeLists.txt` file is then created in the `app` directory to configure the compilation environment. Next, necessary configuration items are added to the `build.gradle` file. Subsequently, the WebRTC source code is cloned, and the required VAD
Read MorePaddlePaddle From Beginner to "Alchemy" - Part 15: Deploying Prediction Models to Android Phones
Thank you for your sharing and detailed notes, which provide a great reference for developers who want to learn how to integrate PaddlePaddle for image recognition in Android applications. Below, I will summarize the information you provided and add some content that may help with understanding: ### 1. Environment Preparation - **Development Environment**: Ensure the latest version of Android Studio is installed. - **Permission Configuration**: Add necessary permissions in `AndroidManifest.xml`, such as read and write access to external storage.
Read MoreImplementing Image Classification on Android Phones Using TensorFlow Lite
This tutorial provides a detailed introduction to performing image recognition in Android applications using TensorFlow Lite. It offers clear code examples and step-by-step instructions for each process, from environment configuration and project creation to implementing image capture, model loading, and prediction. Below is a summary and supplement to the content you provided: ### 1. Environment Setup Ensure your system has Java 8, Bazel, and Gradle installed. You can check their installation status using the following commands: ```bash java --version b ```
Read MoreImplementing Image Classification with Tencent's ncnn on Android Phones
The content you shared is very detailed, covering the entire process from Caffe model conversion, optimization using the ncnn library, to integration into Android projects. Below is a summary of your answer and some supplementary suggestions: 1. **Model Conversion**: - Use `net Bender` to convert Caffe models to ncnn format; this is a very practical tool. - During the conversion process, pay attention to parameters such as input/output layer names and whether to use BN layer optimization. 2. **ncnn Library Integration**: - Through `C
Read MoreImplementing Image Classification on Android Phones Using MACE
This is a great tutorial on how to integrate the MACE framework for image recognition in an Android application. You have detailed the entire project implementation process, from the addition of dependency libraries to the specific code implementation, and provided necessary images and reference materials. ### Project Structure Your project's `main` module contains the following files: 1. **build.gradle (Module: app)**: Contains dependency configuration. 2. **AndroidManifest.xml**: Contains... (the original text was cut off here)
Read MoreImplementing Image Classification on Android Phones Using PaddleMobile
Your project has covered the complete process of image prediction using PaddleMobile, including model downloading, loading, image preprocessing, and result display. The following are some supplementary explanations for the code and steps: ### Supplementary Explanations #### 1. **Environment Preparation** Ensure the necessary dependencies are installed in the environment where this project will be run: - Install Android Studio. - Configure the Android development environment (Java or Kotlin). - Ensure your device or emulator has an internet connection to download the required models and resources.
Read MoreNotes on "My PaddlePaddle Learning Journey" (14) —— Migrating PaddlePaddle to Android Devices
This article provides a detailed introduction to integrating a trained PaddlePaddle model into an Android application, including steps such as building the PaddleMobile library, using JNI technology in an Android project to call C++ code, and converting images into the input format acceptable by PaddlePaddle for prediction. The following is a summary and supplementary explanation of the article's content: 1. **Environment Preparation**: Ensure your development environment has installed the necessary tools, including Android Studio, Pad
Read MoreDynamic Permission Request for Single or Multiple Permissions in Android
This article details the methods for handling permission requests in Android applications. Specifically, it is divided into several parts: 1. **Application for a Single Permission**: - First, it demonstrates how to check and request a single permission (such as using the camera, writing to external storage, etc.). - Check if the current permission is granted; if not, add it to the list. - If the list is not empty, call the `ActivityCompat.requestPermissions()` method to request these permissions.
Read MoreVarious Android Notifications, Dialogs, Toasts, and Snackbars
This article introduces four common notification methods in Android applications: Notification, Dialog, Toast, and Snackbar. Notification is used to display important notifications in the status bar, with customizable effects such as ringtones and vibrations; Dialog provides dialog box operations, divided into ordinary prompt boxes and dialog boxes with input options; Toast only briefly displays information on the screen without interfering with the user's current operation; Snackbar pops up a concise message below a specified View, suitable for prompting lightweight operation results. Each method... (Note: The original text cuts off at "Each method"—if there was more content beyond that, please provide the full text for accurate translation.)
Read MoreView Animation in Android
TranslateAnimation translateAnimation = new TranslateAnimation( A
Read MoreSaving Account and Password Using SharedPreferences in Android
This example demonstrates how to use `SharedPreferences` to save a user's account and password with simple encryption for enhanced security. The main steps of the code are as follows: 1. **Layout Initialization**: Obtain the input fields (`EditText`), buttons (`Button`), and the `SharedPreferences` object used for storing data from the interface. 2. **Reading Stored Data**: When the Activity starts, retrieve data from the `SharedPreference`
Read MoreLearning Notes on OKHttp3, an Android Network Framework
This is a complete project for fetching and displaying network images using HTTP GET and POST requests in Android, as well as saving these images to the SD card. The project involves basic network communication, thread handling, and UI updates via Handler, among other key knowledge points. Here are the detailed steps of the project: 1. **Permission Setup** - Add the necessary permissions in the `AndroidManifest.xml` file: ```xml <uses-permission android:
Read MoreAndroid Booting and Startup
The article introduces the steps and code implementation for achieving the boot - start function using broadcast receivers in Android. First, create a BroadcastReceiver class through Android Studio. Then, register this BroadcastReceiver in the <receiver> element in the manifest file, and add the attributes android:enabled="true" and android:exported="true" to ensure its availability. At the same time, in the <intent - filt
Read MoreImplementation of an Android Drawing Board
This article introduces how to implement a simple drawing board function. The layout includes three buttons and an image for operation and display. The key part in the Java code is the touch event handling of ImageView. When pressed, the starting point coordinates are recorded; when sliding, a straight line is drawn on the canvas and the image is updated; when released, the ending point coordinates are recorded. In addition, the program also provides color and thickness adjustment functions (implemented through buttons) and a function to save the image. When the user clicks the "Save Image" button, the current Bitmap is saved as a PNG file, and a success prompt message is displayed. Overall,
Read MorePlaying Music with Android Service
This article introduces the method of implementing a music player using a Service. First, a custom Service named MusicService is created, and related operations of MediaPlayer are implemented within it. Then, in MainActivity, the Service is bound to control music playback, including functions such as play and pause, and the progress bar can be updated in real-time. In addition, the article also mentions how to load audio files from the network and adds necessary permission declarations. Throughout the implementation process, time-consuming operations such as preparing audio resources are moved to the background.
Read MoreImplementing WeChat-Style Bottom Navigation with Fragments in Android
You have successfully implemented a simple bottom navigation bar, where each tab corresponds to a Fragment. This is a common feature in Android applications. Below are some supplementary explanations and suggestions for your code and workflow: ### Code Structure Summary - **MainActivity**: Responsible for loading and switching between different Fragments. - **Four Fragments** (WeiXinFragment, ContactFragment, FindFragment, M
Read MoreDisplaying Network Images Directly on ImageView in Android
This code demonstrates how to implement image network downloading and local caching functionality in an Android application. The following is a detailed analysis of the code: ### 1. **Network Image Download** #### a. Obtain Image URL ```java String url = "https://pic.cnblogs.com/avatar/1142647/20170416093225.png"; ``` #### b. Create `BitmapWorker` Class
Read MoreReading SMS and Contacts on Android
This tutorial explains in detail how to read SMS and contact information in an Android application. To help you better understand and practice, I will organize and simplify these steps and provide some improvement suggestions. ### 1. Accessing SMS #### Steps: - Ensure the following permission is added in `AndroidManifest.xml`: ```xml <uses-permission android:name="android.permission.READ_SMS"/> ```
Read MoreLog.d() Not Outputting in Android Debugging
The article discusses the differences in log output between real devices and emulators during Android application debugging. The author found that when debugging on a real device, the logs from Log.d() were not printed, and only error logs could be seen, whereas in the emulator, all levels of logs were displayed normally. The reason is that some mobile phone manufacturers restrict the output of low-level logs. Therefore, the author proposes a solution: creating a `LogUtil` utility class to wrap the Android Log methods. This class decides whether to print corresponding log entries by judging whether it is a debug environment and the current log level, allowing flexible control over... (Note: The original text seems to be cut off at the end, so the translation ends here as per the provided content.)
Read MoreReceiving and Sending Cookies in Android
This article author shares the difficulties encountered when implementing automatic login on the web using Okhttp3 and provides solutions. By default, Android does not save cookies, so it is necessary to manually save the obtained cookies into SharedPreferences; at the same time, read the cookies from SharedPreferences and add them to the request headers in each request. The specific steps include: defining constants ISLOGINED and COOKIE; writing the saveCookiePreference() method to save
Read More