Deploying Baidu Wenxin 4.5 Open-Source Model for Android Device Calls

In the previous article "Usage and Deployment of the ERNIE 4.5 Open-Source Large Model", we introduced how to use FastDeploy to deploy the ERNIE 4.5 open-source large model and briefly called its interface. This article will describe how Android can call this deployed interface and implement conversations.

Read More
Usage and Deployment of ERNIE 4.5 Open-Source Large Model

The ERNIE 4.5 series open-source models consist of a total of 10 models, covering Mixture-of-Experts (MoE) models with activation parameter scales of 47B and 3B (with the largest model having a total parameter count of 424B), as well as dense parameter models with 0.3B parameters. Below, we will introduce how to quickly use ERNIE 4.5 models for inference and deploy the interface for client-side calls on platforms such as Android and WeChat Mini Programs. Note that only text-type models are accepted here; in reality, ERNIE 4.5 also has multimodal models.

Read More
Quickly Deploy a DeepSeek-R1 Service from Scratch

Here are the simplest commands to introduce how to deploy the DeepSeek-R1 service. Anaconda is assumed to be already installed, and the vllm framework is used, making it easy to deploy even in China.

Read More
Rapid Training of Cat and Dog Sound Classification Model

This paper introduces how to quickly perform sound classification training and inference using PyTorch and the macls library. First, create a Python 3.11 virtual environment via Anaconda and install the PyTorch 2.5.1 GPU version along with the macls library. Next, prepare the dataset, with provided download links or support for custom formats. The training part can be completed with just three lines of code for model training, optimization, and saving. The inference phase loads the pre-trained model for prediction. The framework supports multiple sound classification models, facilitating different scenario requirements.

Read More
Quick Deployment of Speech Recognition Framework Using MASR V3

This framework appears to be very comprehensive and user-friendly, covering multiple stages from data preparation to model training and inference. To help readers better understand and utilize this framework, I will provide detailed explanations for each part along with some sample code. ### 1. Environment Setup First, you need to install the necessary dependency packages. Assuming you have already created and activated a virtual environment: ```sh pip install paddlepaddle==2.4.0 -i https://mirror.baidu.com/pypi/ ```

Read More
Quick Deployment of Speech Recognition Framework Using PPASR V3

This detailed introduction demonstrates the process of developing and deploying speech recognition tasks using the PaddleSpeech framework. Below are some supplements and suggestions to the information you provided: 1. **Installation Environment**: Ensure your environment has installed the necessary dependencies, including libraries such as PaddlePaddle and PaddleSpeech. These libraries can be installed via the pip command. 2. **Data Preprocessing**: - You may need to perform preprocessing steps on the raw audio, such as sample rate adjustment and noise removal.

Read More
Text Endpoint Detection Based on Large Language Models

This paper introduces a method to detect text endpoints using large language models (LLMs) to improve Voice Activity Detection (VAD) in voice conversations. By training a fine-tuned model to predict whether a sentence is complete, the user's intent can be more accurately judged. The specific steps include: 1. **Principle and Data Preparation**: Leverage the text generation capabilities of large language models to fine-tune based on predefined datasets and specific formats. 2. **Fine-tuning the Model**: Use the LLaMA-Factory tool for training, selecting appropriate prompt templates and optimized data formats. 3.

Read More
Speaker Log Implementation Based on PyTorch (Speaker Separation)

This article introduces the speaker diarization feature of the VoiceprintRecognition_Pytorch framework implemented based on PyTorch, which supports various advanced models and data preprocessing methods. By executing the `infer_speaker_diarization.py` script or using the GUI interface program, audio can be speaker-separated and results displayed. The output includes the start and end times of each speaker and their identity information (registration is required first). Additionally, the article provides solutions for Chinese names in the Ubuntu system... (注:原文末尾“解决中文名”表述不完整,已保留原文未尽部分的省略格式,完整内容需参考原文后续章节)

Read More
Easily Identify Long Audio/Video Files with Hours-Long Duration

This article introduces a method to build a long - speech recognition service capable of processing audio or video files that last tens of minutes or even several hours. First, the folder needs to be uploaded to the server, and then commands for compilation, permission modification, and starting the Docker container are executed to deploy the service. After testing that the service is available, the WebSocket interface or HTTP service can be used for interaction. The HTTP service provides a web interface, supporting the upload and recording recognition of audio and video in multiple formats, and returns text results containing the start and end timestamps of each sentence. This service simplifies the long - audio recognition process and improves user...

Read More
Real-time Command Wake-up

This paper introduces the development and usage of a real-time instruction wake-up program, including steps such as installation environment, instruction wake-up, and model fine-tuning. The project runs on Anaconda 3 and Python 3.11, with dependencies on PyTorch 2.1.0 and CUDA 12.1. Users can customize the recording time and length by adjusting parameters `sec_time` and `last_len`, and add instructions in `instruct.txt` for personalized settings. The program can be executed via `infer_pytorch.py` or `infer_on

Read More
Tank Battle Controlled by Voice Commands

This paper introduces the program development process for controlling the Tank Battle game through voice commands, including steps such as environment setup, game startup, and instruction model fine-tuning. First, the project uses Anaconda 3, Windows 11, Python 3.11, and corresponding libraries for development. Users can adjust parameters in `main.py` such as recording time and data length, add new commands in `instruct.txt`, and write processing functions to start the game. Secondly, `record_data.py` is run to record command audio and generate training

Read More
Run Large Language Model Service with One Click and Build a Chat Application

This article introduces a method to build a local large language model chat service based on the Qwen-7B-Int4 model. First, you need to install the GPU version of PyTorch and other dependency libraries. Then, execute `server.py` in the terminal to start the service. The service supports Windows and Linux systems and can run smoothly with a low VRAM requirement (8G graphics card). In addition, an Android application source code is also provided. By modifying the service address and opening the `AndroidClient` file with Android Studio...

Read More
Real-time Speech Recognition Service with Remarkably High Recognition Accuracy

This article introduces the installation, configuration, and application deployment of the FunASR speech recognition framework. First, PyTorch and related dependency libraries need to be installed. For the CPU version, it can be completed using the command `conda install pytorch torchvision torchaudio cpuonly -c pytorch`; for the GPU version, use `conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c p` (Note: The original command may be truncated, and the complete command should be checked for accuracy).

Read More
FunASR Speech Recognition GUI Application

This paper introduces a speech recognition GUI application developed based on FunASR, which supports recognition of local audio and video files as well as audio recording recognition. The application includes short audio recognition, long audio recognition (with and without timestamps), and audio file playback. The installation environment requires dependencies such as PyTorch (CPU/GPU), FFmpeg, and pyaudio. To use the application, execute `main.py`. The interface provides four options: short speech recognition, long speech recognition, recording recognition, and playback functionality. Among them, long speech recognition is divided into two models: one for concatenated output and another for explicit

Read More
Voiceprint Recognition System Implemented Based on PyTorch

This project provides an implementation of voice recognition based on PaddlePaddle, mainly using the EcapaTDNN model, and integrates functions of speech recognition and voiceprint recognition. Below, I will summarize the project structure, functions, and how to use these functions. ## Project Structure ### Directory Structure ``` VoiceprintRecognition-PaddlePaddle/ ├── docs/ # Documentation │ └── README.md # Project description document ```

Read More
Voiceprint Recognition System Based on PaddlePaddle

This project demonstrates how to use PaddlePaddle for speaker recognition (voiceprint recognition), covering the complete workflow from data preparation, model training to practical application. The project has a clear structure and detailed code comments, making it suitable for learning and reference. Below are supplementary explanations for some key points mentioned: ### 1. Environment Configuration Ensure you have installed the necessary dependency libraries. If using the TensorFlow or PyTorch version, please configure the environment according to the corresponding tutorials. ### 2. Data Preparation The `data`

Read More
Segmenting Long Speech into Multiple Short Segments Using Voice Activity Detection (VAD)

This paper introduces YeAudio, a voice activity detection (VAD) tool implemented based on deep learning. The installation command for the library is `python -m pip install yeaudio -i https://pypi.tuna.tsinghua.edu.cn/simple -U`, and the following code snippet can be used for speech segmentation: ```python from yeaaudio.audio import AudioSegment audio_seg ``` (Note: The original code snippet appears incomplete in the user's input; the translation preserves the partial code as provided.)

Read More
Training a Chinese Punctuation Model Based on PaddlePaddle

This project provides a complete process to train and use a model for adding punctuation marks to Chinese text. Below is a summary of the entire process: 1. **Environment Preparation**: - Ensure necessary libraries are installed, such as `paddlepaddle-gpu` and `PaddleNLP`. - Configure the training dataset. 2. **Data Processing and Preprocessing**: - Tokenize the input text and label the punctuation marks. - Create splits for training, validation, and test sets. 3.

Read More
Speech Emotion Recognition Based on PaddlePaddle

The content you provided describes the training and prediction process for a speech classification task based on PaddlePaddle. Next, I will provide a more detailed and complete code example, along with explanations of the functionality of each part. ### 1. Environment Preparation Ensure that the necessary dependency libraries are installed, including `paddle` (specifically the PaddlePickle version). You can install them using the following command: ```bash pip install paddlepaddle==2.4.1 ``` ### 2. Code Implementation

Read More
Easily Implement Speech Synthesis with PaddlePaddle

This paper introduces the implementation method of speech synthesis using PaddlePaddle, including simple code examples, GUI interface operations, and Flask web interfaces. First, a simple program is used to achieve the basic text-to-speech function, utilizing acoustic model and vocoder model to complete the synthesis process and save the result as an audio file. Secondly, the `gui.py` interface program is introduced to simplify the user operation experience. Finally, the Flask web service provided by `server.py` is demonstrated, which can be called by Android applications or mini-programs to achieve remote speech...

Read More
Building an Animal Recognition System with PaddlePaddle to Identify Thousands of Animal Species

This paper introduces a project for animal recognition using PaddlePaddle. Firstly, the animal recognition task can be completed with just a few lines of code. Secondly, a GUI interface is provided to facilitate users in uploading images for recognition. Finally, a Flask web interface is supported for Android calls, enabling cross - platform application. The project includes details such as model path, image reading, and prediction result output, and running screenshots are attached to demonstrate the implementation effect.

Read More
ECAPa-TDNN Voiceprint Recognition Model Implemented with PyTorch

This project demonstrates how to implement speech recognition functionality using PaddlePaddle, specifically including voiceprint comparison and voiceprint registration. Below is a summary of the main content and some improvement suggestions: ### 1. Project Structure and Functions - **Voiceprint Comparison**: Compare the voice features of two audio files to determine if they are from the same person. - **Voiceprint Registration**: Store the voice data of new users in a database and generate corresponding user information. ### 2. Technology Stack - Use PaddlePaddle for model training and prediction.

Read More
ECAPa-TDNN Speaker Recognition Model Implemented Based on PaddlePaddle

This project is a voiceprint recognition system based on PaddlePaddle. It covers application scenarios from data preprocessing, model training to voiceprint recognition and comparison, and is suitable for practical applications such as voiceprint login. Here is a detailed analysis of the project: ### 1. Environment Preparation and Dependency Installation First, ensure that PaddlePaddle and other dependent libraries such as `numpy`, `matplotlib`, etc., have been installed. They can be installed using the following command: ```bash pip install paddlepaddle ```

Read More
PPASR Streaming and Non-Streaming Speech Recognition

This document introduces how to deploy and test a speech recognition model implemented using PaddlePaddle, and provides various methods to execute and demonstrate the model's functionality. The following is a summary and interpretation of the document content: ### 1. Introduction - Provides an overview of PaddlePaddle-based speech recognition models, including recognition for short voice segments and long audio clips. ### 2. Deployment Methods #### 2.1 Command-line Deployment Two commands are provided to implement different deployment methods: - `python infer_server.

Read More
Fast Face Recognition Model Implemented with PaddlePaddle

This project develops a small and efficient face recognition system based on the ArcFace and PP-OCRv2 models. The training dataset is emore (containing 85,742 individuals and 5,822,653 images), and the lfw-align-128 dataset is used for testing. The project provides complete code and preprocessing scripts. The `create_dataset.py` script is executed to organize raw data into binary file format, improving training efficiency. Model training and evaluation are controlled by `train.py` and `eval.py` respectively. The prediction function supports

Read More
A Fast Face Recognition Model Implemented Based on PyTorch

This project aims to develop a face recognition system with small models, high recognition accuracy, and fast inference speed. The training data is sourced from the emore dataset (5.82 million images), and the lfw-align-128 dataset is used for testing. The project combines the ArcFace loss function and MobileNet, implemented through Python scripts. The process of training the model includes data preparation, training, and evaluation, with all code available on GitHub. To start the training process, the `train.py` command is executed; for performance verification, run `ev`

Read More
Sound Classification Based on PyTorch

This code is mainly based on the PaddlePaddle framework and is used to implement a speech recognition system based on acoustic features. The project structure is clear, including functional modules such as training, evaluation, and prediction, and provides detailed command-line parameter configuration files. The following is a detailed analysis and usage instructions for the project: ### 1. Project Structure ``` . ├── configs # Configuration files directory │ └── bi_lstm.yml ├── infer.py # Acoustic model inference code ├── recor ``` (Note: The original Chinese text was cut off at "recor" in the last line, so the translation reflects the visible content.)

Read More
My New Book, "Introduction to and Practical Guide of PaddlePaddle Fluid Deep Learning" Has Been Published!

This book provides a detailed introduction to deep learning development using PaddlePaddle, covering the entire process from environment setup to practical project applications. The content includes environment setup, quick start, linear regression algorithm, practical cases of convolutional neural networks and recurrent neural networks, generative adversarial networks, reinforcement learning, etc. Additionally, it explains model saving and usage, transfer learning, and the application of the mobile framework Paddle-Lite. This book is suitable for beginners to get started and can help solve practical problems such as flower species recognition and news headline classification projects. All the code in the book has been tested, and there are supporting resources.

Read More
CRNN Text Recognition Model Implemented with PaddlePaddle 2.0 Dynamic Graph

This document introduces a CRNN text recognition model implemented using PaddlePaddle 2.0 dynamic graph. The model extracts features through CNN, performs sequence prediction via RNN, and uses CTC Loss for loss calculation, making it suitable for input images of irregular lengths. **Training and Data Preparation:** 1. **Environment Configuration**: PaddlePaddle 2.0.1 and Python 3.7 need to be installed. 2. **Dataset Generation**: - Use the `create_image.py` script to automatically generate validation

Read More
PPASR Chinese Speech Recognition (Beginner Level)

Thank you for your detailed introduction! To further help everyone understand and use this CTC-based end-to-end Chinese-English speech recognition model, I will supplement and improve it from several aspects: ### 1. Dataset and Its Processing #### AISHELL - **Data Volume**: Approximately 20 hours of Mandarin Chinese pronunciation. - **Characteristics**: Contains standard Mandarin Chinese pronunciation and some dialects. #### Free ST Chinese Mandarin Corpus - **Data Volume**: Approximately 65 hours of Mandarin Chinese pronunciation. -

Read More
Face Recognition and Face Registration Based on InsightFace

This code implements a deep learning-based face recognition system using the InsightFace framework. It includes functions for face detection, feature extraction, and face recognition, and also provides a feature to register new users. Below is a detailed explanation of the code: ### 1. Import necessary libraries ```python import cv2 import numpy as np ``` ### 2. Define the `FaceRecognition` class This class contains all functions related to face recognition.

Read More
PP-YOLOE: A Target Detection Model Based on PaddlePaddle

This document provides a detailed introduction to how to implement the training, evaluation, export, and prediction processes of the object detection model PP-YOLOE using PaddlePaddle, along with various deployment methods including the Inference prediction interface, ONNX interface, and prediction on Android devices. Here is a summary of each part: ### 1. Training - **Single-card training**: Use `python train.py --model_type=M --num_classes=8

Read More
Implementing 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 More
Stream and Non-Stream Speech Recognition Implemented with PyTorch

### Project Overview This project is a speech recognition system implemented based on PyTorch. By utilizing pretrained models and custom configurations, it can recognize input audio files and output corresponding text results. ### Install Dependencies First, necessary libraries need to be installed. Run the following command in the terminal or command line: ```bash pip install torch torchaudio numpy librosa ``` If the speech synthesis module is required, additionally install `gTTS` and

Read More
Large-scale Face Detection Based on Pyramidbox

Based on the code and description you provided, this is an implementation of a face detection model using PyTorch. The model employs a custom inference process to load images, perform preprocessing, and conduct face detection through the model. Here are key points summarizing the code: - **Data Preprocessing**: Transpose the input image from `HWC` to `CHW` format, adjust the color space (BGR to RGB), subtract the mean, and scale. This step ensures compatibility with the data format used during training. - **Model Inference**: Uses the PaddlePaddle framework (Note: There appears to be a discrepancy here, as the initial description mentions PyTorch but this part references PaddlePaddle. If this is an error, please clarify.)

Read More
SSD Object Detection Model Implemented Based on PaddlePaddle

### Project Overview This project aims to implement the SSD (Single Shot Multibox Detector) model using PaddlePaddle for object detection tasks. SSD is a single-stage object detection algorithm that enables fast and accurate object detection. The following provides detailed code and configuration file explanations. --- ### Configuration File `config.py` Parsing #### Important Parameters - **image_shape**: The size of the input image, default (

Read More
Distance Measurement Using Binocular Cameras

This code demonstrates how to implement stereo vision depth estimation using the SGBM (Semiglobal Block Matching) algorithm in OpenCV, and then calculate 3D coordinates in the image. The following is a detailed explanation of the key steps and parameters in the code: ### 1. Preparation First, import the necessary libraries: ```python import cv2 import numpy as np ``` ### 2. Reading and Preprocessing Images Load the left and right eye images, and then (the original content was cut off here, so the translation stops at the beginning of the preprocessing step)

Read More
Voiceprint Recognition Based on PaddlePaddle

This project demonstrates how to implement a voiceprint recognition system based on speech recognition using PaddlePaddle. The entire project covers multiple aspects including model training, inference, and user interaction, making it a complete case study. The following are some supplementary explanations for the code and content you provided: ### 1. Environment Setup and Dependencies Ensure the necessary libraries are installed in your environment: ```bash pip install paddlepaddle numpy scipy sounddevice ``` For audio processing

Read More
Implementation of Voiceprint Recognition Using TensorFlow

Your project provides a TensorFlow-based voiceprint recognition framework that covers multiple steps including data preparation, model training, and voiceprint recognition. This is a great practical case demonstrating how to apply deep learning techniques to real-world problems. Below, I will analyze your project from several aspects and offer some suggestions. ### Advantages 1. **Clear Structure**: The project's code organization is relatively reasonable, with multiple modules handling data, model training, and voiceprint recognition respectively. 2. **Data Processing**: Using the `librosa` library to read audio

Read More
Building a Smart Assistant Quickly with AIUI on Android
2020-04-18 193 views Android Artificial Intelligence 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 More
Notes from Baidu Machine Learning Training Camp – Question & Answer

This code uses PaddlePaddle to build a convolutional neural network (CNN) for processing the CIFAR-10 dataset. The network consists of 3 convolutional-pooling layers and 1 fully connected layer, without using Batch Normalization (BN) layers. **Analysis of Network Structure:** 1. The input image size is (128, 3, 32, 32). 2. The first and second layers have convolutional kernels of size 5x5. The first convolutional layer outputs (128, 20, 28, 28), and the second convolutional layer outputs (128, 50, 14, 14). The number of parameters for the convolutional outputs of each layer is 1500 and 25000, respectively.

Read More
Notes from Baidu Machine Learning Training Camp — Mathematical Fundamentals

This content mainly explains the basic concepts of neural networks and some important foundational concepts, including but not limited to algorithms such as linear regression and gradient descent, along with their principles and applications. Additionally, it provides detailed explanations of concepts like backpropagation and activation functions (e.g., Sigmoid, Tanh, and ReLU), and uses code examples for chart visualization. Below is a brief summary of these contents: 1. **Linear Regression**: A simple machine learning method used to predict continuous values. 2. **Gradient Descent**: One of the optimization algorithms, used to solve for parameters that minimize the loss function.

Read More
My New Book Has Been Published!

This book "Deep Learning in Practice with PaddlePaddle" shares the author's experience from getting acquainted with PaddlePaddle to completing the book publication. It introduces the PaddlePaddle framework in detail and helps readers master practical applications through cases such as handwritten digit recognition. The content covers basic usage, dataset processing, object detection, as well as server-side and mobile-side applications. This book is suitable for machine learning enthusiasts and practitioners, and can also be used as a teaching reference. During the learning process of PaddlePaddle, the author shared tutorials through blogs, which ultimately led to the publication of this book.

Read More
"PaddlePaddle from Beginner to Alchemy" - Part 7: Reinforcement Learning

Your tutorial provides a detailed introduction to implementing a Deep Q-Network (DQN) using PaddlePaddle to play a small game. Below is a summary of your documentation and some supplementary suggestions: ### Document Summary 1. **Environment Setup**: You have explained how to install and configure PaddlePaddle to ensure the relevant code can run successfully. 2. **Project Introduction**: You have elaborated on how to use PaddlePaddle to implement a simple reinforcement learning model for playing a small game (e.g., an Atari game). 3. **Code Implementation** (Note: The original text cuts off here, so the translation reflects the visible content)

Read More
PaddlePaddle from Beginner to "Alchemy" - Part 8: Model Saving and Usage

### Chapter 8 - Model Saving and Loading in PaddlePaddle: From Beginner to "Alchemy" In this chapter, we will introduce how to save and load models using PaddlePaddle. Saving and loading models is one of the important steps in machine learning projects, allowing us to deploy trained models for practical applications or continue optimizing and fine-tuning them. #### 1. Model Saving To save a trained model to a file, we can use `fluid.io.save_persistable`

Read More
"PaddlePaddle: From Beginner to 'Alchemy Master' (2) - Calculating 1+1"

This chapter introduces how to perform simple tensor operations and variable operations using the PaddlePaddle Fluid version. First, two constant tensors x1 and x2 with shape [2, 2] and value 1 are defined using the `fill_constant()` function, and then their sum is calculated using the `sum()` function. Next, a CPU executor is created and parameters are initialized, finally outputting the result [[2, 2], [2, 2]]. Then, it demonstrates how to perform operations using variables, which is defined in `variable_sum.py`.

Read More