MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / infer

Method infer

samples/python/efficientdet/infer.py:116–127  ·  view source on GitHub ↗

Execute inference on a batch of images. :param batch: A numpy array holding the image batch. :return A list of outputs as numpy arrays.

(self, batch)

Source from the content-addressed store, hash-verified

114 return specs
115
116 def infer(self, batch):
117 """
118 Execute inference on a batch of images.
119 :param batch: A numpy array holding the image batch.
120 :return A list of outputs as numpy arrays.
121 """
122 # Copy I/O and Execute
123 common.memcpy_host_to_device(self.inputs[0]['allocation'], batch)
124 self.context.execute_v2(self.allocations)
125 for o in range(len(self.outputs)):
126 common.memcpy_device_to_host(self.outputs[o]['host_allocation'], self.outputs[o]['allocation'])
127 return [o['host_allocation'] for o in self.outputs]
128
129 def process(self, batch, scales=None, nms_threshold=None):
130 """

Callers 2

processMethod · 0.95
mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected