description: Perform pose estimation and object detection on mobile (iOS and Android) using ONNX Runtime and YOLOv8 with built-in pre and post processing
# Object detection and pose estimation on mobile with YOLOv8
Learn how to build and run ONNX models on mobile with built-in pre and post processing for object detection and pose estimation.
## Contents
{: .no_toc }
* TOC placeholder
{:toc}
## Object detection with YOLOv8
You can find the full source code for the [Android](https://github.com/microsoft/ app in the ONNX Runtime inference examples repository.
### Build the ONNX model with built-in pre and post processing
This step is optional as the model is available in the examples repository in the applications folders above. If you are interested, the following steps show you how to build the model yourself.
Create a Python environment and install the following packages.
After the script has run, you will see one PyTorch model and two ONNX models:
*`yolov8n.pt`: The original YOLOv8 PyTorch model
*`yolov8n.onnx`: The exported YOLOv8 ONNX model
*`yolov8n.with_pre_post_processing.onnx`: The ONNX model with pre and post processing included in the model
*`<test image>.out.jpg`: Your test image with bounding boxes supplied.
For example, the wolves test image in the extensions repo:

### Build an Android application
Load the Android application into Android Developer Studio.
You see the main inference code in [ObjectDetector.kt](https://github.com/microsoft/onnxruntime-inference-examples/blob/main/mobile/examples/object_detection/android/app/src/main/java/ai/onnxruntime/example/objectdetection/ObjectDetector.kt). It's as simple as loading the image image into byte array, and running it through the model with ONNX Runtime to get the original image with boxes.
```java
fun detect(inputStream: InputStream, ortEnv: OrtEnvironment, ortSession: OrtSession): Result {