更新 main2.py

This commit is contained in:
2025-07-29 20:28:38 +08:00
parent 59458d2925
commit b9a38a45f0

View File

@@ -12,12 +12,12 @@ def getxy(cvx,cvy):
else:
returnx+="中0海里"
return returnx,returny
model = YOLO("./best4.pt")
model = YOLO("./best4_ncnn_model")
import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'SimHei' # 设置字体为中文黑体
def zh_ch(string):
return string.encode("gbk").decode(errors="ignore")
cap = cv2.VideoCapture(1)
cap = cv2.VideoCapture(0)
cv2.namedWindow('window', cv2.WINDOW_NORMAL)
cv2.setWindowProperty('window', cv2.WND_PROP_FULLSCREEN, cv2.WINDOW_FULLSCREEN)
while cap.isOpened():