Closed Cilouche closed 1 year ago
I think the workflow is as following (let's assume imgs
is am array of image tensors, in which tensors have shape [h, w, c]):
Tensor batched_image = tf.expand_dims(imgs[0], 0);
for(int i = 1; i < imgs.Length; i++){
batched_image = tf.concat(new []{batched_image, tf.expand_dims(imgs[i], 0)}, 0);
}
var result = model.predict(bacthed_image);
Note that in tensorflow nhwc
is the default layout of image input, which means the four dims are batchsize, width, height, channels respectively. Generally using different hwc
in training and predicting phase may lead to error, but changing batchsize won't.
Thanks
Description
Hi;
I would like to make an inference on a number of images (Batch images inference), however I can't find an application example or documentation on that..
Suggestions please?
THANKS
Alternatives
No response