用户可借助此项目在 Android 设备上实现实时目标检测。它采用 YOLOv8 TFLite 模型,支持摄像头实时检测多种物体类别,提供简洁直观的用户界面,还包含 Kotlin 原生版与 JNI C++ 优化版分支。【此简介由AI生成】
| Files | Last commit | Last update |
|---|---|---|
| 2 years ago | ||
| 2 years ago | ||
| 2 years ago | ||
| 2 years ago | ||
| 2 years ago | ||
| 2 years ago | ||
| 2 years ago | ||
| 2 years ago | ||
| 2 years ago | ||
| 2 years ago |
YOLOv8 TFLite Android App
This Android application uses the YOLOv8 model implemented in TensorFlow Lite (TFLite) for real-time object detection on mobile devices.
Branches
-
main (Kotlin): The main branch contains the Kotlin-only version of the application. It provides a native Kotlin experience for developers and users.
-
dev (JNI C++): The dev branch includes additional functionalities or optimizations implemented using C++ code through the Java Native Interface (JNI). This version may offer improved performance or access to native features.
Features
- Camera access for real-time object detection using YOLOv8 TFLite model.
- Support for various object classes.
- Simple and intuitive user interface.
Installation
-
Clone or download the repository to your local machine:
git clone https://github.com/xiaohaoo/yolo-android.git -
Switch to the desired branch (
mainordev) using Git:git checkout main # or git checkout dev -
Open the project in Android Studio.
-
Build and run the application on your Android device or emulator.
Usage
-
Launch the YOLOv8 TFLite app on your Android device.
-
Grant necessary permissions for camera access when prompted.
-
Point the camera towards objects to detect.
-
Detected objects will be highlighted in real-time with bounding boxes and labels.
Screenshots
TODO
Model Conversion
The YOLOv8 model was converted to TensorFlow Lite format using the following steps:
- Train the YOLOv8 model using your preferred framework (e.g., TensorFlow, PyTorch).
- Convert the trained model to TensorFlow Lite format using the TensorFlow Lite Converter.
- Optimize the converted model for mobile inference (quantization, model size reduction).
- Integrate the optimized TFLite model into your Android app.
For detailed model conversion and optimization steps, refer to the official TensorFlow Lite documentation.
Credits
- YOLOv8 Model: https://github.com/ultralytics/ultralytics
- TensorFlow Lite: https://www.tensorflow.org/lite
License
This project is licensed under the MIT License.