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: model recreation
author
nate
date
4 months ago
(Feb 7, 2026, 9:21 AM +0200)
commit
10283ead
10283ead44df6b9abdef7013d66bc4142e5f020e
parent
cff2b173
cff2b1734a888e165a36f8a978bb9a66c4330818
+22
3 changed files
Expand all
Collapse all
Unified
Split
posedetection
src
androidMain
kotlin
com
performancecoachlab
posedetection
custom
CustomObjectModel.android.kt
commonMain
kotlin
com
performancecoachlab
posedetection
custom
CustomObjectModel.kt
iosMain
kotlin
com
performancecoachlab
posedetection
custom
CustomObjectModel.ios.kt
+5
posedetection/src/androidMain/kotlin/com/performancecoachlab/posedetection/custom/CustomObjectModel.android.kt
Reviewed
···
399
399
}
400
400
}.getOrDefault("")
401
401
}
402
402
+
403
403
+
@Composable
404
404
+
internal actual fun platformRememberObjectModel(modelPath: ModelPath): ObjectModel {
405
405
+
return ObjectModelProvider.get(modelPath)
406
406
+
}
+10
posedetection/src/commonMain/kotlin/com/performancecoachlab/posedetection/custom/CustomObjectModel.kt
Reviewed
···
18
18
expect class ObjectModel {
19
19
}
20
20
21
21
+
@Composable
22
22
+
fun rememberObjectModel(modelPath: ModelPath): ObjectModel {
23
23
+
// Android: cache via provider to avoid recreation
24
24
+
// iOS: do NOT share/cross-cache the model; create once per composition
25
25
+
return platformRememberObjectModel(modelPath)
26
26
+
}
27
27
+
28
28
+
@Composable
29
29
+
internal expect fun platformRememberObjectModel(modelPath: ModelPath): ObjectModel
30
30
+
21
31
object ObjectModelProvider {
22
32
@Volatile private var cached: ObjectModel? = null
23
33
+7
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/custom/CustomObjectModel.ios.kt
Reviewed
···
1
1
package com.performancecoachlab.posedetection.custom
2
2
3
3
import androidx.compose.runtime.Composable
4
4
+
import androidx.compose.runtime.remember
4
5
import kotlinx.cinterop.ExperimentalForeignApi
5
6
import platform.CoreML.MLModel
6
7
import platform.Foundation.NSBundle
···
38
39
fun getModel(): VNCoreMLModel? {
39
40
return model
40
41
}
42
42
+
}
43
43
+
44
44
+
@Composable
45
45
+
internal actual fun platformRememberObjectModel(modelPath: ModelPath): ObjectModel {
46
46
+
// iOS: create once for this composition; avoids global caching issues
47
47
+
return initialiseObjectModel(modelPath)
41
48
}