update vision

This commit is contained in:
hjw
2024-09-11 14:27:58 +08:00
parent 2b20732119
commit 6bc52d70f5
3 changed files with 13 additions and 9 deletions

View File

@ -20,7 +20,7 @@ import os
class Detection:
def __init__(self, use_openvino_model = False):
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'])
@ -32,14 +32,14 @@ class Detection:
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/test0910.png'])
point_path = ''.join([os.getcwd(), '/model/data/test0910.xyz'])
img_path = ''.join([os.getcwd(), '/model/data/test0911.png'])
point_path = ''.join([os.getcwd(), '/model/data/test0911.xyz'])
self.img = cv2.imread(img_path)
self.point = np.loadtxt(point_path).reshape((1080, 1440, 3))
def get_position(self, Point_isVision=True):
def get_position(self, Point_isVision=False):
""
'''
:param api: None