Running edge inference on THINKLET while recording at 30fps with LiteRT GPU
A Fairy Devices developer described an app for the Android-based wearable camera THINKLET. It uses the YOLO26n object detection model (TFLite version) to find objects on the device and starts recording at 1280x720 and 30fps once one is found. The recording includes the 5 seconds before detection (pre-roll[1]), so the encoder runs constantly. The goals were faster inference, 30fps recording and lower CPU use.
Running the model through the CompiledModel API of LiteRT[2] 2.3 on the GPU together with the CPU cut one frame from 1302 ms to 576 ms and CPU usage from 409% to 107%. Using only the GPU causes compilation to fail, because the NMS[3] post-processing inside the model cannot run on the GPU, so the CPU is specified too. GPU initialization takes about 20.4 seconds on the first launch, so the app runs on the CPU until the GPU is ready and then switches; the compiled result is cached, which cuts later starts to 0.83 seconds.
Recording had fallen to about 10fps because the OpenGL drawing for the preview and encoder had to wait for the GPU, which inference was using. The author then sent a separate video stream straight from the camera to the encoder, with the 1280x720 size produced by the camera's ISP[4]. Recording then ran at 29.9fps, a frame took 477 ms, and CPU usage was 60%. The trade-off: CameraX rejected four simultaneous streams, so the live preview was dropped and detection boxes are drawn on the image used for inference.
Sources
-
JPZenn JA
THINKLETでエッジ推論しながら30fpsで録画する:LiteRTのGPU推論を活かす工夫




