Game Development 9 min read

Building an AI-Powered Object Hunt Game with Paddle.js and PaddleClas

The article details how to create the AI‑driven “Object Hunt Battle” game by processing data, designing and training a PP‑LCNet model with PaddleClas, converting it for Paddle.js, and integrating real‑time WebGL inference on mobile devices, achieving sub‑50 ms latency and encouraging developers to explore further.

Baidu App Technology
Baidu App Technology
Baidu App Technology
Building an AI-Powered Object Hunt Game with Paddle.js and PaddleClas

This article introduces the development of an AI-powered object hunt game called "寻物大作战" (Object Hunt Battle). The game leverages deep learning technology to create an engaging experience where players use their phone cameras to find specific objects within a time limit.

The development process encompasses four key stages: data processing, model design, model training, and deployment. The technical foundation relies on two main components: PaddleClas for image classification and Paddle.js for JavaScript-based deep learning inference.

PaddleClas provides over 180 pre-trained models and recently introduced the PP-LCNet lightweight backbone network model, optimized for Intel CPU and ARM mobile platforms. This model offers excellent speed-accuracy balance and performs well in downstream visual tasks like object detection and semantic segmentation.

Paddle.js is Baidu's JavaScript-based deep learning framework that provides a complete end-to-end front-end AI solution. It supports multiple computation schemes including WebGL, WebGPU, WebAssembly, and NodeGL. The framework includes tools for model conversion (X2Paddle, paddlejs-converter), data stream processing (paddlejs-mediapipe), and pre-trained model libraries (HumanSeg, MobileNetV2, Gesture recognition, OCR).

The development workflow involves three main steps: model conversion using paddlejs-converter, Paddle.js initialization with proper backend configuration, and integrating inference capabilities into the business logic. The game uses the onCameraFrame method to capture video frames and the predict API to perform real-time object classification.

Performance testing shows impressive results: 32.1ms inference time on Redmi K30 Pro and 49.24ms on iPhone X using WebGL computation. These results demonstrate significant advantages over server-side inference approaches, making Paddle.js ideal for real-time AI applications.

The article concludes by inviting developers to join the Paddle.js community and explore more creative applications of this technology.

mobile AIWebGLreal-time inferencedeep learning frameworkPaddle.jsAI game developmentobject classificationPaddleClasvideo stream processing
Baidu App Technology
Written by

Baidu App Technology

Official Baidu App Tech Account

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.