|
@@ -55,7 +55,8 @@ class ClassificationInference:
|
|
|
img = Tensor(image[None, :, :, :])
|
|
|
model = base.model(modelPath=self.model_path) # 初始化 base.model 类
|
|
|
outputs = model.infer([img])[0] # 执行推理。输入数据类型:List[base.Tensor], 返回模型推理输出的List[base.Tensor]
|
|
|
- outputs = np.array(outputs.to_host()) # 将outputs移动到内存中,并且将base.Tensor类转为numpy array
|
|
|
+ outputs.to_host()
|
|
|
+ outputs = np.array(outputs) # 将outputs移动到内存中,并且将base.Tensor类转为numpy array
|
|
|
return outputs
|
|
|
|
|
|
def predict_batch(self, image_paths):
|