yolo模型识别不到
This commit is contained in:
10
core/all.py
10
core/all.py
@ -67,7 +67,7 @@ def detect(client_ip, frame):
|
||||
if full_save_path:
|
||||
cv2.imwrite(full_save_path, frame)
|
||||
print(f"✅ yolo违规图片已保存:{display_path}") # 日志也修正
|
||||
save_db(model_type="yolo", client_ip=client_ip, result=str(full_save_path))
|
||||
save_db(model_type="yolo", client_ip=client_ip, result=str(display_path))
|
||||
return (True, yolo_result, "yolo")
|
||||
|
||||
# 2. 人脸检测
|
||||
@ -77,17 +77,19 @@ def detect(client_ip, frame):
|
||||
if full_save_path:
|
||||
cv2.imwrite(full_save_path, frame)
|
||||
print(f"✅ face违规图片已保存:{display_path}") # 日志也修正
|
||||
save_db(model_type="face", client_ip=client_ip, result=str(full_save_path))
|
||||
save_db(model_type="face", client_ip=client_ip, result=str(display_path))
|
||||
return (True, face_result, "face")
|
||||
|
||||
# 3. OCR检测
|
||||
ocr_flag, ocr_result = ocrDetect(frame)
|
||||
if ocr_flag:
|
||||
full_save_path, display_path = get_image_save_path(model_type="ocr", client_ip=client_ip) # 这里改了
|
||||
full_save_path, display_path = get_image_save_path(model_type="ocr", client_ip=client_ip)
|
||||
print(f"✅ ocr违规图片已保存:{display_path}")
|
||||
# 这里改了
|
||||
if full_save_path:
|
||||
cv2.imwrite(full_save_path, frame)
|
||||
print(f"✅ ocr违规图片已保存:{display_path}") # 日志也修正
|
||||
save_db(model_type="ocr", client_ip=client_ip, result=str(full_save_path))
|
||||
save_db(model_type="ocr", client_ip=client_ip, result=str(display_path))
|
||||
return (True, ocr_result, "ocr")
|
||||
|
||||
# 4. 无违规内容(不保存图片)
|
||||
|
||||
Reference in New Issue
Block a user