https://github.com/danielsarmiento04/yolo_kotlin
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.5%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: DanielSarmiento04
- Language: Kotlin
- Default Branch: main
- Size: 8.94 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
Readme.md
YOLOv11 Object Detection for Android
A Kotlin-based Android implementation of YOLOv11 object detection using ONNX Runtime and OpenCV. This application demonstrates real-time object detection on Android devices with high performance and accuracy.
Features
- YOLOv11 object detection on Android
- ONNX Runtime integration for efficient inference
- OpenCV for image processing
- Jetpack Compose UI
- Support for both CPU and GPU (CUDA) acceleration
- Visualization of detection results with bounding boxes and labels
Requirements
- Android Studio Flamingo (2022.2.1) or newer
- Android SDK 24+ (Android 7.0 Nougat or higher)
- OpenCV for Android 4.6.0+
- ONNX Runtime 1.14.0+
- Kotlin 1.8.0+
- Jetpack Compose 1.4.0+
Project Structure
YOLO11Detector.kt- Core detector class implementing YOLOv11 model inferenceMainActivity.kt- Android activity with Compose UI implementationDetection.kt- Data classes for detections and bounding boxesConfig.kt- Configuration settings for the detector
Setup Instructions
Clone the repository:
bash git clone https://github.com/yourusername/yolo_kotlin.git cd yolo_kotlinOpen the project in Android Studio
Download the YOLOv11 ONNX model:
- Place your trained YOLOv11 ONNX model file named
best.onnxin theapp/src/main/assets/directory - Add a
classes.txtfile with class names (one per line) in the same directory - (Optional) Add test images in the assets folder
- Place your trained YOLOv11 ONNX model file named
Build and run the application on your Android device or emulator
Usage
The application demonstrates object detection on a sample image included in the assets folder. The main interface shows:
- The processed image with bounding boxes around detected objects
- Class labels and confidence scores for each detection
- Inference time information
- The total count of detected objects
Customizing the Detector
You can adjust detection parameters in Config.kt:
```kotlin // Default confidence threshold const val DEFAULTCONFIDENCETHRESHOLD = 0.25f
// Default IoU threshold for NMS const val DEFAULTIOUTHRESHOLD = 0.45f ```
How It Works
- The ONNX model is loaded using ONNX Runtime
- Images are preprocessed with letterboxing to maintain aspect ratio
- The model runs inference on the preprocessed image
- Postprocessing applies non-maximum suppression (NMS) to filter duplicate detections
- Results are displayed with colored bounding boxes and labels
Performance Notes
- CPU is used by default for compatibility with all Android devices
- GPU acceleration via CUDA can be enabled for compatible devices
- Threading is optimized based on available processors
License
[Include your license information here]
Acknowledgments
- YOLOv11 model architecture by [appropriate credit]
- ONNX Runtime for efficient model inference
- OpenCV for image processing capabilities
Owner
- Name: José Daniel Sarmiento
- Login: DanielSarmiento04
- Kind: user
- Location: Santander, Colombia
- Company: Axede S.A
- Repositories: 7
- Profile: https://github.com/DanielSarmiento04
Programmer, mechanical engineer and entrepreneur, my goal is to improve the quality of life of people, technology is the tool I use.
GitHub Events
Total
- Push event: 2
Last Year
- Push event: 2
Dependencies
- androidx.activity:activity-compose 1.7.2 implementation
- androidx.compose.material:material 1.5.1 implementation
- androidx.compose.ui:ui 1.5.1 implementation
- androidx.compose.ui:ui-tooling-preview 1.5.1 implementation
- com.microsoft.onnxruntime:onnxruntime-mobile latest.release implementation