This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

refactor: single reference to models in sample app

+21 -11
+21 -11
sample/composeApp/src/commonMain/kotlin/com/nate/posedetection/App.kt
··· 75 75 import kotlin.time.Clock 76 76 import kotlin.time.ExperimentalTime 77 77 78 + val androidPath = "lite-model_efficientdet_lite2_detection_metadata_1.tflite" 79 + val iosPath = "YOLOv3FP16" 78 80 @Composable 79 81 internal fun App() = AppTheme { 80 82 var selectedTabIndex by remember { mutableStateOf(0) } ··· 152 154 var frame by remember { mutableStateOf(timeRange.first) } 153 155 val generalModel = initialiseObjectModel( 154 156 ModelPath( 155 - "lite-model_efficientdet_lite2_detection_metadata_1.tflite", 156 - "YOLOv3FP16" 157 + androidPath, 158 + iosPath 157 159 ) 158 160 ) 159 161 val frameAnalyser by remember { mutableStateOf(FrameAnalyser(generalModel)) } ··· 312 314 var path by remember { mutableStateOf("") } 313 315 val generalModel = initialiseObjectModel( 314 316 ModelPath( 315 - "lite-model_efficientdet_lite2_detection_metadata_1.tflite", 316 - "YOLOv3FP16" 317 + androidPath, 318 + iosPath 317 319 ) 318 320 ) 319 - var frontCamera by remember { mutableStateOf(true) } 321 + var frontCamera by remember { mutableStateOf(false) } 320 322 val controller = remember { CameraViewControllerImpl() } 321 323 PermissionProvider().apply { 322 324 if (!hasCameraPermission()) RequestCameraPermission(onGranted = { ··· 358 360 detectMode = DetectMode.OBJECT, 359 361 drawSkeleton = true, 360 362 drawObjects = { obj -> 361 - obj.map { 362 - DrawableObject( 363 - obj = it, 364 - shape = DrawableShape.LABEL, 365 - colour = Color.Yellow, 366 - style = Stroke(it.boundingBox.width * 0.1f) 363 + obj.flatMap { 364 + listOf( 365 + DrawableObject( 366 + obj = it, 367 + shape = DrawableShape.LABEL, 368 + colour = Color.Yellow, 369 + style = Stroke(it.boundingBox.width * 0.1f) 370 + ), 371 + DrawableObject( 372 + obj = it, 373 + shape = DrawableShape.OVAL, 374 + colour = Color.Green, 375 + style = Stroke(it.boundingBox.width * 0.1f) 376 + ) 367 377 ) 368 378 } 369 379 },