From 7b0cd1d608d7ce8a6eb9cbccb429c5ffc8998052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=8E=B9?= Date: Wed, 21 Jun 2023 13:24:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'BANK=5Fatm/yolov8=5Fdet.p?= =?UTF-8?q?y'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BANK_atm/yolov8_det.py | 50 ------------------------------------------ 1 file changed, 50 deletions(-) delete mode 100644 BANK_atm/yolov8_det.py diff --git a/BANK_atm/yolov8_det.py b/BANK_atm/yolov8_det.py deleted file mode 100644 index b9139bf..0000000 --- a/BANK_atm/yolov8_det.py +++ /dev/null @@ -1,50 +0,0 @@ -import cv2 -from tqdm import tqdm -from ultralytics import YOLO -from ultralytics.yolo.utils.plotting import Annotator -import os - -def analysis_yolov8(images, model_coco,confidence): - - frame = images - - # 第一步:用COCO数据集推理 - results_coco = model_coco(frame) - # print(results_coco) - - if results_coco: - - for r in results_coco: - - boxes = r.boxes - - re_list = [] - for box in boxes: - - b = box.xyxy[0] # get box coordinates in (top, left, bottom, right) format - c = box.cls - - # 保存标签和坐标值作为返回结果 - blist = b.tolist() - labels_name = model_coco.names[int(c)] - - confidence = float(box.conf) - - confidence = round(confidence, 2) - - # 过滤置信度0.5以下目标 - if confidence < confidence: - - continue - - re_dict = {labels_name:blist} - re_list.append(re_dict) - - return re_list - - -# if __name__ == '__main__': - -# model_coco = YOLO("model_files/bk1.pt") -# frame = cv2.imread("E:/BANK_XZ/data_file/0000162.jpg") -# analysis_video(frame, model_coco,confidence=0.5) \ No newline at end of file