当前位置: 首页 > wzjs >正文

哪里查询网站备案高端网站建设公司哪家好

哪里查询网站备案,高端网站建设公司哪家好,专做新车分期的网站,内蒙古app开发公司目录 介绍 转换代码 下载地址: 介绍 CCPD 是一个大型的、多样化的、经过仔细标注的中国城市车牌开源数据集。CCPD 数据集主要分为 CCPD2019 数据集和 CCPD2020(CCPD-Green)数据集。CCPD2019 数据集…

目录

介绍

转换代码                                          

下载地址:


介绍

        CCPD 是一个大型的、多样化的、经过仔细标注的中国城市车牌开源数据集。CCPD 数据集主要分为 CCPD2019 数据集和 CCPD2020(CCPD-Green)数据集。CCPD2019 数据集车牌类型仅有普通车牌(蓝色车牌),CCPD2020 数据集车牌类型仅有新能源车牌(绿色车牌)。

 具体介绍可以看看这篇:

[深度学习] CCPD车牌数据集介绍_ccpd数据集-CSDN博客https://blog.csdn.net/LuohenYJ/article/details/117752120

下载地址在文末,只要数据集的直接下滑

下载后是这样的:

        可以看到,该数据集包含的场景还是很丰富的,并且数据量也特多,cpdd_base 里甚至有 20w 数据,每个图片名字的文件就是该图片的标注(除了 ccpd_np 文件夹),例如下面这个文件:

01-86_91-298&341_449&414-458&394_308&410_304&357_454&341-0_0_14_28_24_26_29-124-24

我们按照  “-”  分割这个字符串,得到如下结果:

01编号
86_91车牌水平偏转和垂直偏转角
298&341_449&414车牌左上角坐标和右下角坐标(目标识别矩形框)
458&394_308&410_304&357_454&341车牌的四个角点,按照顺序分别为右下、左下、左上、右上(yolo-pose姿态识别)
0_0_14_28_24_26_29车牌号码
124亮度
24模糊度

转换代码                                          

知道字符串各个含义以及连接规则后,则可以通过字符分割字符串,并提取需要的信息,并将

信息批量保存至 txt 文件即可,我这里为大家提供两段代码,一段提取车牌目标识别(仅矩形框),一段提取车牌姿态(矩形框+4个角点)。

车牌目标识别提取:

import os
import cv2def parse_bbox_from_filename(filename):"""从文件名中解析出车牌目标矩形框的左上角、右下角坐标。"""parts = filename.split('-')# 解析矩形框坐标bbox_part = parts[2].split('_')x1, y1 = map(int, bbox_part[0].split('&'))  # 左上角x2, y2 = map(int, bbox_part[1].split('&'))  # 右下角return (x1, y1), (x2, y2)def get_bbox(x_min, y_min, x_max, y_max, img_w, img_h):"""根据给定的最小最大坐标计算YOLO格式的bbox(中心点坐标、宽度、高度)。"""x_center = round((x_min + x_max) / 2 / img_w, 6)y_center = round((y_min + y_max) / 2 / img_h, 6)width = round((x_max - x_min) / img_w, 6)height = round((y_max - y_min) / img_h, 6)return x_center, y_center, width, heightif __name__ == '__main__':images_dir = r'D:\tcy_works\data\CCPD2019\ccpd_base'  # 替换为你自己的图像路径save_dir = r'D:\tcy_works\data\CCPD_deal\CCPD2019\ccpd_base'  # 替换为你想保存结果的路径os.makedirs(os.path.join(save_dir, "labels"), exist_ok=True)image_files = [os.path.join(images_dir, f) for f in os.listdir(images_dir) if f.lower().endswith(('.jpg', '.png'))]for image_path in image_files:filename = os.path.basename(image_path)try:(x_min, y_min), (x_max, y_max) = parse_bbox_from_filename(filename)except Exception as e:print(f"解析文件名失败: {filename}, 错误: {e}")continueimg = cv2.imread(image_path)if img is None:print(f"读取图像失败: {image_path}")continueheight, width = img.shape[:2]# 计算 bounding boxx_center, y_center, w_bbox, h_bbox = get_bbox(x_min, y_min, x_max, y_max, width, height)# 构建 YOLO 格式标注(仅 bbox)class_id = 0  # 假设类别ID为0label_line = [class_id, x_center, y_center, w_bbox, h_bbox]label_line = list(map(str, label_line))# 保存 label 文件label_file = os.path.join(save_dir, "labels", os.path.splitext(filename)[0] + ".txt")with open(label_file, 'w') as f:f.write(' '.join(label_line) + '\n')print(f"已处理图像: {filename}")print("所有图像处理完成!")

车牌姿态提取:

import os
import cv2def parse_points_from_filename(filename):"""从文件名中解析出车牌目标矩形框的左上角、右下角坐标以及车牌四个角点坐标。"""parts = filename.split('-')# 解析矩形框坐标bbox_part = parts[2].split('_')x1, y1 = map(int, bbox_part[0].split('&'))  # 左上角x2, y2 = map(int, bbox_part[1].split('&'))  # 右下角# 解析角点坐标:parts[3] 如 '458&394_308&410_304&357_454&341'points = []for point in parts[3].split('_'):x, y = map(int, point.split('&'))points.append((x, y))return (x1, y1), (x2, y2), pointsdef normalize_points(points, img_w, img_h):"""将点坐标归一化到 [0, 1] 范围内,并保留 6 位小数。返回列表格式:[x1, y1, vis1, x2, y2, vis2, ..., xn, yn, visn]"""norm_points = []for x, y in points:x_norm = round(x / img_w, 6)y_norm = round(y / img_h, 6)visibility = 2.000000  # YOLO-Pose 中表示该关键点始终可见norm_points.extend([x_norm, y_norm, visibility])return norm_pointsdef get_bbox(x_min, y_min, x_max, y_max, img_w, img_h):"""根据给定的最小最大坐标计算YOLO格式的bbox(中心点坐标、宽度、高度)。"""x_center = round((x_min + x_max) / 2 / img_w, 6)y_center = round((y_min + y_max) / 2 / img_h, 6)width = round((x_max - x_min) / img_w, 6)height = round((y_max - y_min) / img_h, 6)return x_center, y_center, width, heightif __name__ == '__main__':images_dir = r'D:\tcy_works\data\CCPD2019\ccpd_base'  # 替换为你自己的图像路径save_dir = r'D:\tcy_works\data\CCPD_deal\CCPD2019\ccpd_base'  # 替换为你想保存结果的路径os.makedirs(os.path.join(save_dir, "labels"), exist_ok=True)image_files = [os.path.join(images_dir, f) for f in os.listdir(images_dir) if f.lower().endswith(('.jpg', '.png'))]for image_path in image_files:filename = os.path.basename(image_path)try:(x_min, y_min), (x_max, y_max), points = parse_points_from_filename(filename)except Exception as e:print(f"解析文件名失败: {filename}, 错误: {e}")continueimg = cv2.imread(image_path)if img is None:print(f"读取图像失败: {image_path}")continueheight, width = img.shape[:2]# 计算 bounding boxx_center, y_center, w_bbox, h_bbox = get_bbox(x_min, y_min, x_max, y_max, width, height)# 归一化角点坐标 + 添加可见性(每个角点加一个 2.000000)norm_points = normalize_points(points, width, height)# 构建 YOLO-Pose 格式标注class_id = 0  # 假设类别ID为0label_line = [class_id, x_center, y_center, w_bbox, h_bbox] + norm_pointslabel_line = list(map(lambda x: f"{x:.6f}", label_line))  # 统一保留6位小数# 保存 label 文件label_file = os.path.join(save_dir, "labels", os.path.splitext(filename)[0] + ".txt")with open(label_file, 'w') as f:f.write(' '.join(label_line) + '\n')print(f"已处理图像: {filename}")print("所有图像处理完成!")

 下载地址:

百度网盘(密码:ol3j)https://pan.baidu.com/share/init?surl=JSpc9BZXFlPkXxRK4qUCyw

drive.google.comhttps://drive.google.com/file/d/1m8w1kFxnCEiqz_-t2vTcgrgqNIv986PR/view?usp=sharing

感谢您的观看!!!

http://www.dtcms.com/wzjs/61579.html

相关文章:

  • 福州企业网站维护价格低链接网
  • 乌鲁木齐城乡建设管理局网站建站服务
  • 游戏网站排行榜前十名百度查重软件
  • 2023年税收优惠政策珠海seo排名收费
  • 网站被挂黑链如何自己开发网站
  • 网站的ppt方案怎么做网络网站
  • 昆明做网站的公司有哪些谷歌google地图
  • 电脑做试卷的网站网站运营公司
  • 广告视频网站数据分析网页
  • 网站开发的最初阶段包括google下载安卓版
  • 怎么做cms网站国外推广网站
  • 学习做网站营销广告文案
  • 网站建设海外推广 香港今日头条军事新闻
  • 网站建设联系方式博客seo怎么做
  • wordpress怎么增加字段太原seo全网营销
  • 做技术支持的网站有推广网站的公司
  • 如何注册网络公司廊坊推广seo霸屏
  • 国家企业信用公示信息网官网北京seo关键词
  • 武汉网站建设dw027谷歌商店下载官方正版
  • 使用帝国备份王搬迁织梦网站百度收录方法
  • 登别的网站应怎么做企业危机公关
  • 怎样模仿别人的网站seo零基础视频教程
  • 文档流程做网站手游推广平台有哪些
  • 驾校网站模板自己怎样开网站
  • 哪个网站可以做片头百度广告一天多少钱
  • 网站建设怎么用长尾做标题营销型网站案例
  • 怎么自己编写网站网络营销比较成功的企业
  • 国外优质设计网站百度百科合作模式
  • 在线网站优化公司今日热榜官网
  • 企业网站搜索优化外包中国seo网站