UPDATE Vision test

This commit is contained in:
HJW
2024-09-12 08:49:25 +08:00
parent d24a79c21c
commit 05f468f7c9
2 changed files with 30 additions and 4 deletions

View File

@ -23,17 +23,17 @@ class Detection:
def __init__(self, use_openvino_model = True):
self.use_openvino_model = use_openvino_model
if self.use_openvino_model == False:
model_path = ''.join([os.getcwd(), '/model/pt/best.pt'])
model_path = ''.join([os.getcwd(), '/Vision/model/pt/best.pt'])
device = 'cpu'
self.model = yolov8_segment()
self.model.load_model(model_path, device)
else:
model_path = ''.join([os.getcwd(), '/model/openvino/best.xml'])
model_path = ''.join([os.getcwd(), '/Vision/model/openvino/best.xml'])
device = 'CPU'
self.model = yolov8_segment_openvino(model_path, device, conf_thres=0.3, iou_thres=0.3)
img_path = ''.join([os.getcwd(), '/model/data/test0911.png'])
point_path = ''.join([os.getcwd(), '/model/data/test0911.xyz'])
img_path = ''.join([os.getcwd(), '/Vision/model/data/test0910.png'])
point_path = ''.join([os.getcwd(), '/Vision/model/data/test0910.xyz'])
self.img = cv2.imread(img_path)
self.point = np.loadtxt(point_path).reshape((1080, 1440, 3))