Foreword

This project implements thousands of animal recognition using PaddlePaddle, providing simple sample code, a GUI interface for operation, and a Flask web interface that can be called by Android applications.

Source Code Address: Download Here

Video Tutorial Address: Bilibili

  1. First, let’s write a simple program to achieve animal recognition with the following code:
import cv2

from utils.predictor import ClassificationPredictor

predictor = ClassificationPredictor(model_path='models', width=224, height=224)

image = cv2.imread('test.jpg')
result = predictor.predict([image])[0]
print(f'Prediction Result: {result[0]}, Confidence: {result[1]}')
  1. A gui.py interface program is provided for operation and recognition through the interface.

  2. Additionally, a server.py is provided, which uses Flask to offer a web interface. Android applications can call this interface to implement animal recognition.

Sample code for the Android application is provided in the project, with the interface shown below.

Xiaoye