This repository has no description
0

Configure Feed

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

fix: use preview coordinates for iOS

+23 -11
+9 -6
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/CameraEngine.kt
··· 496 496 timestamp, 497 497 preview = cameraPreviewLayer, 498 498 onSkeletonProcessed = { skeleton -> 499 - skeleton?.also { 500 - skeletonRepository?.updateSkeleton( 501 - it 502 - ) 503 - } 504 499 detectedSkeleton = skeleton 505 500 }, 506 501 onObjectsProcessed = { objects -> 507 502 detectedObjects = objects 508 - customObjectRepository?.updateCustomObject(objects) 509 503 }) 510 504 cameraPreviewLayer?.also { preview -> 511 505 val previewSkeleton = detectedSkeleton?.let { ··· 516 510 height = 360f 517 511 ) 518 512 } 513 + previewSkeleton?.also { 514 + skeletonRepository?.updateSkeleton( 515 + it 516 + ) 517 + } 519 518 val previewObjects = detectedObjects.map { 520 519 it.copy( 521 520 boundingBox = mapBoxToPreview( ··· 523 522 ) 524 523 ) 525 524 } 525 + previewObjects?.also{ objects-> 526 + customObjectRepository?.updateCustomObject(objects) 527 + } 528 + 526 529 preview.bounds.useContents { 527 530 Pair( 528 531 size.width.toInt(), size.height.toInt()
-3
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/FrameProcessor.kt
··· 500 500 } 501 501 }?.isInFocusArea(focusArea) ?: false 502 502 } 503 - /*firstOrNull{ 504 - isInFocusArea(it,focusArea,width, height, mapPoint) 505 - }*/ 506 503 regionOfInterest = 507 504 calculateRegionOfInterest(recognizedPoints) 508 505 val updatedSkeleton = Skeleton(
+14 -2
sample/composeApp/src/commonMain/kotlin/com/nate/posedetection/App.kt
··· 8 8 import androidx.compose.foundation.layout.imePadding 9 9 import androidx.compose.foundation.layout.padding 10 10 import androidx.compose.material3.Button 11 + import androidx.compose.ui.graphics.drawscope.Stroke 11 12 import androidx.compose.material3.CircularProgressIndicator 12 13 import androidx.compose.material3.Tab 13 14 import androidx.compose.material3.TabRow ··· 48 49 import com.performancecoachlab.posedetection.recording.AnalysisObject 49 50 import com.performancecoachlab.posedetection.recording.FrameAnalyser 50 51 import com.performancecoachlab.posedetection.recording.InputFrame 52 + import com.performancecoachlab.posedetection.recording.Label 51 53 import com.performancecoachlab.posedetection.recording.extractFrame 52 54 import com.performancecoachlab.posedetection.skeleton.Pose 53 55 import com.performancecoachlab.posedetection.skeleton.SkeletonRepository ··· 331 333 CameraView( 332 334 skeletonRepository = skeletonRepository, 333 335 customObjectRepository = customObjectRespository, 334 - detectMode = DetectMode.NONE, 336 + detectMode = DetectMode.BOTH, 335 337 drawSkeleton = true, 338 + drawObjects = { obj -> 339 + obj.map { 340 + DrawableObject( 341 + obj = it, 342 + shape = DrawableShape.OVAL, 343 + colour = Color.Yellow, 344 + style = Stroke(it.boundingBox.width * 0.1f) 345 + ) 346 + } 347 + }, 336 348 objectModel = generalModel, 337 349 modifier = Modifier.weight(1f), 338 - frontCamera = true, 350 + frontCamera = false, 339 351 recordingId = recordingId, 340 352 onVideoSaved = {id,url -> path = url }, 341 353 )