Files
silver_pose/v2/internal/spike/preprocess.go
T

15 lines
586 B
Go
Raw Normal View History

package spike
2026-07-22 16:18:16 +08:00
import "silverpose/v2/internal/pose"
// LetterboxBGRToNCHW converts one packed BGR frame into the RGB, CHW,
// float32 tensor expected by the locked 640-pixel YOLO pose ONNX model.
//
2026-07-22 16:18:16 +08:00
// T-303 aligned the implementation with the fixed-shape Ultralytics
// letterbox used by the V1/ONNX baseline. New V2 code should import the pose
// package directly to retain the returned coordinate transform.
func LetterboxBGRToNCHW(frame []byte, width, height, target int) ([]float32, error) {
2026-07-22 16:18:16 +08:00
input, _, err := pose.PreprocessBGR(frame, width, height, target)
return input, err
}