()
| 128 | gl: ExpoWebGLRenderingContext |
| 129 | ) => { |
| 130 | const loop = async () => { |
| 131 | // Get the tensor and run pose detection. |
| 132 | const imageTensor = images.next().value as tf.Tensor3D; |
| 133 | |
| 134 | const startTs = Date.now(); |
| 135 | const poses = await model!.estimatePoses( |
| 136 | imageTensor, |
| 137 | undefined, |
| 138 | Date.now() |
| 139 | ); |
| 140 | const latency = Date.now() - startTs; |
| 141 | setFps(Math.floor(1000 / latency)); |
| 142 | setPoses(poses); |
| 143 | tf.dispose([imageTensor]); |
| 144 | |
| 145 | if (rafId.current === 0) { |
| 146 | return; |
| 147 | } |
| 148 | |
| 149 | // Render camera preview manually when autorender=false. |
| 150 | if (!AUTO_RENDER) { |
| 151 | updatePreview(); |
| 152 | gl.endFrameEXP(); |
| 153 | } |
| 154 | |
| 155 | rafId.current = requestAnimationFrame(loop); |
| 156 | }; |
| 157 | |
| 158 | loop(); |
| 159 | }; |
no outgoing calls
no test coverage detected