···11-An realtime pose detection library for [Android](https://www.android.com/) and [Compose Multiplatform](https://www.jetbrains.com/lp/compose-multiplatform/).
22-Android version uses CameraX and GoogleML Kit, while iOS version uses AVFoundation with VisionKit and CoreML.
11+An realtime pose detection library for [Android](https://www.android.com/)
22+and [Compose Multiplatform](https://www.jetbrains.com/lp/compose-multiplatform/).
33+Android version uses CameraX and GoogleML Kit, while iOS version uses AVFoundation with VisionKit
44+and CoreML.
35We also support analysing pre-recorded video files.
44-We now also support adding custom object detection models to the library, allowing you to detect custom objects in your camera feed or video files along side body poses.
66+We now also support adding custom object detection models to the library, allowing you to detect
77+custom objects in your camera feed or video files along side body poses.
5869## Quick Start
710811Import the Compose library
9121013```kotlin
1111-implementation("com.performancecoachlab.posedetection:posedetection-compose:4.7.1")
1414+implementation("com.performancecoachlab.posedetection:posedetection-compose:4.7.2")
1215```
13161417Add camera use to your android manifest
···3033## Usage
31343235Request camera permissions
3636+3337```kotlin
3438var permissionGranted by remember { mutableStateOf(false) }
3539PermissionProvider().apply {
···4044```
41454246Create a Skeleton Repisitory
4747+4348```kotlin
4449val skeletonRepository = remember { SkeletonRepository() }
4550val customObjectRepository = remember { CustomObjectRespository() }
4651```
47524853Initialise the camera feed
5454+4955```kotlin
5056if (permissionGranted) {
5157 CameraView(
···5864```
59656066Create a Pose to detect
6767+6168```kotlin
6269val upRightPose = Pose(
6370 leftShoulder = Pose.PoseRange(0.0, 40.0),
···7077```
71787279Listen for skeleton updates and detect specific poses
8080+7381```kotlin
7482val skeleton by skeletonRepository.skeletonFlow.collectAsState()
7583val poseDetected = skeleton?.let {
···79878088Analyse pre recorded video files.
8189Initialise the video extraction for android with your application context.
9090+8291```kotlin
8392VideoExtractionContext.setUp(applicationContext)
8493```
9494+8595extract frames from the video and request analysis
9696+8697```kotlin
8798rememberCoroutineScope().launch {
8899 try {
···99110100111Add a custom object detection model
101112Initialse the custom models for ios and android respectively.
102102-For android you need to add a .tflite model file to your assets folder, then set androidModelPath to the name of the model file, including the .tflite extension.
103103-For iOS you need to add a .mlmodel model file to your Xcode project, then set iosModelPath to the name of the model file without the .mlmodel extension.
113113+For android you need to add a .tflite model file to your assets folder, then set androidModelPath to
114114+the name of the model file, including the .tflite extension.
115115+For iOS you need to add a .mlmodel model file to your Xcode project, then set iosModelPath to the
116116+name of the model file without the .mlmodel extension.
117117+104118```kotlin
105119val generalModel = ObjectModelProvider.get(
106120 ModelPath(
···109123 )
110124)
111125```
112112-Once this is done, you can use the model to detect objects in the camera feed or video frames.
113126127127+Once this is done, you can use the model to detect objects in the camera feed or video frames.
114128115129Check out the sample app for full example of how to use the library.
116130
···11package com.performancecoachlab.posedetection.encoding
2233import androidx.compose.ui.graphics.ImageBitmap
44-import com.performancecoachlab.posedetection.recording.InputFrame
5465/**
76 * Builder for creating videos from a sequence of ImageBitmap frames
···27272828data class FrameSize(
2929 val width: Int,
3030- val height: Int)
3030+ val height: Int
3131+)
31323233data class Label(
3334 val text: String,