ultralytics 8.1.31 NCNN and CLIP updates (#9235)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
41c2d8d99f
commit
3c179f87cb
8 changed files with 77 additions and 60 deletions
|
|
@ -509,14 +509,9 @@ class AutoBackend(nn.Module):
|
|||
# NCNN
|
||||
elif self.ncnn:
|
||||
mat_in = self.pyncnn.Mat(im[0].cpu().numpy())
|
||||
ex = self.net.create_extractor()
|
||||
input_names, output_names = self.net.input_names(), self.net.output_names()
|
||||
ex.input(input_names[0], mat_in)
|
||||
y = []
|
||||
for output_name in output_names:
|
||||
mat_out = self.pyncnn.Mat()
|
||||
ex.extract(output_name, mat_out)
|
||||
y.append(np.array(mat_out)[None])
|
||||
with self.net.create_extractor() as ex:
|
||||
ex.input(self.net.input_names()[0], mat_in)
|
||||
y = [np.array(ex.extract(x)[1])[None] for x in self.net.output_names()]
|
||||
|
||||
# NVIDIA Triton Inference Server
|
||||
elif self.triton:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue