3 from __future__
import absolute_import
4 from __future__
import division
5 from __future__
import print_function
6 from __future__
import unicode_literals
10 model, blob_in, blob_out, order=
"NCHW", use_gpu_transform=
False, **kwargs
12 assert 'is_test' in kwargs,
"Argument 'is_test' is required" 14 if (use_gpu_transform):
15 kwargs[
'use_gpu_transform'] = 1
if use_gpu_transform
else 0
17 outputs = model.net.ImageInput(blob_in, blob_out, **kwargs)
20 outputs = model.net.ImageInput(
21 blob_in, [blob_out[0] +
'_nhwc'] + blob_out[1:], **kwargs
23 outputs_list = list(outputs)
24 outputs_list[0] = model.net.NHWC2NCHW(outputs_list[0], blob_out[0])
25 outputs = tuple(outputs_list)
27 outputs = model.net.ImageInput(blob_in, blob_out, **kwargs)
31 def video_input(model, blob_in, blob_out, **kwargs):
33 outputs = model.net.VideoInput(blob_in, blob_out, **kwargs)