diff --git a/services/mlmodel/mlmodel.go b/services/mlmodel/mlmodel.go index 6c53758ace3..fd2de1bc7e3 100644 --- a/services/mlmodel/mlmodel.go +++ b/services/mlmodel/mlmodel.go @@ -35,12 +35,26 @@ func init() { // // Infer example: // -// input_tensors := ml.Tensors{"0": tensor.New(tensor.WithShape(1, 2, 3), tensor.WithBacking([]int{1, 2, 3, 4, 5, 6}))} +// import ( +// "go.viam.com/rdk/ml" +// "gorgonia.org/tensor" +// ) +// +// myMLModel, err := mlmodel.FromRobot(machine, "mlmodel-1") +// +// input_tensors := ml.Tensors{ +// "image": tensor.New( +// tensor.Of(tensor.Uint8), +// tensor.WithShape(1, 384, 384, 3), +// tensor.WithBacking(make([]uint8, 1*384*384*3)), +// ), +// } // // output_tensors, err := myMLModel.Infer(context.Background(), input_tensors) // // Metadata example: // +// myMLModel, err := mlmodel.FromRobot(machine, "mlmodel-1") // metadata, err := myMLModel.Metadata(context.Background()) // // [ML model service docs]: https://docs.viam.com/services/ml/deploy/