alpha
Login
or
Join now
nateholland.bsky.social
/
PoseDetection
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
fix: use preview coordinates for iOS
author
nathan holland
date
9 months ago
(Sep 7, 2025, 9:09 PM +0300)
commit
1c073bde
1c073bde485e602ae6eaea758f394830428e4e98
parent
8e58b468
8e58b468d6da19e0b9c88610fc64a421f0810e0c
+23
-11
3 changed files
Expand all
Collapse all
Unified
Split
posedetection
src
iosMain
kotlin
com
performancecoachlab
posedetection
camera
CameraEngine.kt
FrameProcessor.kt
sample
composeApp
src
commonMain
kotlin
com
nate
posedetection
App.kt
+9
-6
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/CameraEngine.kt
Reviewed
···
496
496
timestamp,
497
497
preview = cameraPreviewLayer,
498
498
onSkeletonProcessed = { skeleton ->
499
499
-
skeleton?.also {
500
500
-
skeletonRepository?.updateSkeleton(
501
501
-
it
502
502
-
)
503
503
-
}
504
499
detectedSkeleton = skeleton
505
500
},
506
501
onObjectsProcessed = { objects ->
507
502
detectedObjects = objects
508
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
513
+
previewSkeleton?.also {
514
514
+
skeletonRepository?.updateSkeleton(
515
515
+
it
516
516
+
)
517
517
+
}
519
518
val previewObjects = detectedObjects.map {
520
519
it.copy(
521
520
boundingBox = mapBoxToPreview(
···
523
522
)
524
523
)
525
524
}
525
525
+
previewObjects?.also{ objects->
526
526
+
customObjectRepository?.updateCustomObject(objects)
527
527
+
}
528
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
Reviewed
···
500
500
}
501
501
}?.isInFocusArea(focusArea) ?: false
502
502
}
503
503
-
/*firstOrNull{
504
504
-
isInFocusArea(it,focusArea,width, height, mapPoint)
505
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
Reviewed
···
8
8
import androidx.compose.foundation.layout.imePadding
9
9
import androidx.compose.foundation.layout.padding
10
10
import androidx.compose.material3.Button
11
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
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
334
-
detectMode = DetectMode.NONE,
336
336
+
detectMode = DetectMode.BOTH,
335
337
drawSkeleton = true,
338
338
+
drawObjects = { obj ->
339
339
+
obj.map {
340
340
+
DrawableObject(
341
341
+
obj = it,
342
342
+
shape = DrawableShape.OVAL,
343
343
+
colour = Color.Yellow,
344
344
+
style = Stroke(it.boundingBox.width * 0.1f)
345
345
+
)
346
346
+
}
347
347
+
},
336
348
objectModel = generalModel,
337
349
modifier = Modifier.weight(1f),
338
338
-
frontCamera = true,
350
350
+
frontCamera = false,
339
351
recordingId = recordingId,
340
352
onVideoSaved = {id,url -> path = url },
341
353
)