feat: 增加循跡回歸雙服務端
This commit is contained in:
@@ -2,7 +2,8 @@ import paddle.inference as paddle_infer
|
||||
import numpy as np
|
||||
import paddle.vision.transforms as T
|
||||
class Lane_model_infer:
|
||||
def __init__(self, model_dir="./lane_model"):
|
||||
# def __init__(self, model_dir="./lane_model/7_12_6"):
|
||||
def __init__(self, model_dir="./lane_model/6_9"):
|
||||
# 初始化 paddle 推理
|
||||
self.model_dir = model_dir
|
||||
self.config = paddle_infer.Config(model_dir + "/model.pdmodel", model_dir + "/model.pdiparams")
|
||||
@@ -21,6 +22,9 @@ class Lane_model_infer:
|
||||
self.normalize_transform = T.Normalize(mean=[127.5], std=[127.5])
|
||||
# print(self.config.summary())
|
||||
def infer(self,src) -> np.ndarray:
|
||||
# 7_12_3 [60:240,:]
|
||||
# crop_src = src[60:240,:]
|
||||
# image = self.normalize_transform(crop_src)
|
||||
image = self.normalize_transform(src)
|
||||
image = image.transpose(2, 0, 1)
|
||||
image = np.expand_dims(image, axis=0)
|
||||
|
||||
Reference in New Issue
Block a user