目录

1. 数据整体官方描述

2. 数据特点

2.1 imnames

2.2 wordBB:单词级别

2.3 charBB:字符级别的bbox

2.4 txt:文本级别


1. 数据整体官方描述

SynthText in the Wild Dataset
-----------------------------
Ankush Gupta, Andrea Vedaldi, and Andrew Zisserman
Visual Geometry Group, University of Oxford, 2016Data format:
------------SynthText.zip (size = 42074172 bytes (41GB)) contains 858,750 synthetic
scene-image files (.jpg) split into 200 directories, with
7,266,866 word-instances, and 28,971,487 characters.Ground-truth annotations are contained in the file "gt.mat" (Matlab format).
The file "gt.mat" contains the following cell-arrays, each of size 1x858750:1. imnames :  names of the image files2. wordBB  :  word-level bounding-boxes for each image, represented bytensors of size 2x4xNWORDS_i, where:- the first dimension is 2 for x and y respectively,- the second dimension corresponds to the 4 points(clockwise, starting from top-left), and-  the third dimension of size NWORDS_i, corresponds tothe number of words in the i_th image.3. charBB  : character-level bounding-boxes,each represented by a tensor of size 2x4xNCHARS_i(format is same as wordBB's above)4. txt     : text-strings contained in each image (char array).Words which belong to the same "instance", i.e.,those rendered in the same region with the same font, color,distortion etc., are grouped together; the instanceboundaries are demarcated by the line-feed character (ASCII: 10)A "word" is any contiguous substring of non-whitespacecharacters.A "character" is defined as any non-whitespace character.For any questions or comments, contact Ankush Gupta at:
removethisifyouarehuman-ankush@robots.ox.ac.uk

2. 数据特点

数据集下文件如下。

(1)数据集总共有41g,858750张合成图片,jpg格式,这么图片分成200个场景图片(即图片背景不同,其实有202个场景),单词有7,266,866个,字符有28,971,487个;

(2)标注文件时mat格式,读取后保存内容如下。

2.1 imnames

保存图片文件相对路径

2.2 wordBB:单词级别

每张图片对应其中一个标注tensor,该tensor的size是(2, 4, n_word_i):2是xy坐标;4是表示4个点,左上角开始,顺时针方向;n_word_i是第i张图片中的word个数。

“单词”是指任何非空白的连续字符串。

2.3 charBB:字符级别的bbox

size也是(2, 4, n_char_i). 意义同wordBB.

字符是指任何非空白字符。

char_bbox 转labelme格式的json标注文件:

def syntext2json_char_level():data_dir = r"F:\BaiduNetdiskDownload\SynthText800k\detection"gt_path = os.path.join(data_dir, "gt.mat")img_paths = os.path.join(data_dir, "imgs")gt_mat = loadmat(gt_path)# word_bboxes = gt_mat['wordBB'][0]img_names = gt_mat['imnames'][0]char_bboxes = gt_mat['charBB'][0]for i in tqdm(range(img_names.size)):coco_output = {"version": "3.16.7","flags": {},# "fillColor": [255, 0, 0, 128],# "lineColor": [0, 255, 0, 128],"imagePath": {},"shapes": [],"imageData": {}}img_name = img_names[i][0]img_full_path = os.path.join(img_paths, img_name)coco_output["imagePath"] = os.path.basename(img_full_path)coco_output["imageData"] = Nonejson_full_path = img_full_path.replace(".jpg", ".json")# print(json_full_path)cur_img = cv2.imread(img_full_path)if cur_img is None:continuecur_bboxes = char_bboxes[i]  # (2,4,n)if len(cur_bboxes.shape) != 3:cur_bboxes = np.expand_dims(cur_bboxes, 2)# rectify_bboxes = np.zeros((cur_bboxes.shape[2], 4, 2))for j in range(cur_bboxes.shape[2]):  # (2,4,15)  多个cnt,多个字符bbox = cur_bboxes[:, :, j]  # (2,4)pt_list = [[int(bbox[0][m]), int(bbox[1][m])] for m in range(4)]  # 记录当前字符x, y, w, h = cv2.boundingRect(np.array(pt_list))rect = [[x, y], [x + w, y + h]]# cv2.rectangle(cur_img, pt_list[0], pt_list[2], (0, 0, 255), 3)# cv2.namedWindow("img", cv2.WINDOW_NORMAL), cv2.imshow("img", cur_img), cv2.waitKey()shape_info = {'points': rect,'group_id': None,# "fill_color": None,# "line_color": None,"label": "loc","shape_type": "rectangle","flags": {}}coco_output["shapes"].append(shape_info)coco_output["imageHeight"] = cur_img.shape[0]coco_output["imageWidth"] = cur_img.shape[1]with open(json_full_path, 'w') as output_json_file:json.dump(coco_output, output_json_file, indent=4)output_json_file.close()

2.4 txt:文本级别

每个图像中包含的文本字符串(字符数组)。

以图片ballet_106_0.jpg为例. 其标注有8个文本,同一个区域、且字体、颜色、扭曲等特征相同的单词被视为一个文本。

SynthText文本数据详细解析相关推荐

  1. BC28连接电信Iot平台上报数据(详细解析)

    一.在电信物联网平台创建产品 1.1.创建产品 IMEI号通过以下命令查询: AT+CGSN=1 //查询IMEI号 AT+CIMI //查询IMSI号 上面我们设置为服务ID为1时会在提交时显示重复 ...

  2. 简单爬取微博评论详细解析,学习爬取ajax异步数据交换动态网页

    爬取微博评论详细解析,学习爬取ajax异步数据交换动态网页 1.什么是ajax异步数据交换网页 2.用到的工具模块和简单解释 3.网页内容解析 4.代码实现及解释 1.什么是ajax异步数据交换网页 ...

  3. 实践数据湖iceberg 第二十四课 iceberg元数据详细解析

    系列文章目录 实践数据湖iceberg 第一课 入门 实践数据湖iceberg 第二课 iceberg基于hadoop的底层数据格式 实践数据湖iceberg 第三课 在sqlclient中,以sql ...

  4. CANopen伺服控制-服务数据对象(SDO)详细解析

    CANopen服务数据对象(SDO)详细解析 SDO"服务数据对象"允许对对象字典进行读或写访问.数据服务对象,以下简称SDO 在下文中,对象字典的所有者称为"服务器/主 ...

  5. 在线文本实体抽取能力,助力应用解析海量文本数据

    随着信息化的发展,很多具有重要价值的知识隐藏分布在海量数据中,影响了人们获取知识的效率,如何处理繁杂的非结构化文本数据成为难题. 近日,HMS Core机器学习服务6.5.0版本新增在线文本实体抽取能 ...

  6. Kaggle Titanic Challenges 生存预测 数据预处理 模型训练 交叉验证 步骤详细解析

    本博客所有内容均整理自<Hands-On Machine Learning with Scikit-Learn & TensorFlow>一书及其GitHub源码. 看<Ha ...

  7. 特征工程(二) :文本数据的展开、过滤和分块

    如果让你来设计一个算法来分析以下段落,你会怎么做? Emma knocked on the door. No answer. She knocked again and waited. There w ...

  8. 语义分析 文本矛盾点解析_关于解析文本的几点思考

    语义分析 文本矛盾点解析 Yesterday I wrote about three course modules in Oslo, and the fact that most of the pre ...

  9. SMS短信PDU编码详细解析

    以一个例子来详细解析: 01 08 91 683110300405F1 60 05 A1 0110F0 00 08 31808061349523 04 4F60597D (1)01-短信状态: [01 ...

最新文章

  1. ADPRL - 近似动态规划和强化学习 - Note 2 - Stochastic Finite Horizon Problem
  2. 五、任意输入10个int类型数据,排序输出,再找出素数
  3. Ubuntu18.04 安装 gnuplot
  4. B端会员模块的思考与设计
  5. 怎么配置网站mysql数据库_本地DZ网站如何配置本地MYSQL数据库
  6. 怎么把excel文件转成dta_Word怎么转成PDF文件?首选就是这个转换方法!
  7. Django内建模版标签和过滤器
  8. CNN反向传播卷积核翻转
  9. dataTables本地刷新数据解决只能初始化一次问题
  10. python分句_Python循环中的分句,继续和其他子句
  11. 作者:聂瑞华(1963-),男,华南师范大学计算机学院教授。
  12. nginx https透明代理_nginx正向https代理配置
  13. Ponemon Institute告诉你,大数据正在勾搭网络安全
  14. 速领,阿里巴巴Java开发手册终极版
  15. Linux:搭建web服务器(二)
  16. 解决IDM下载城通网盘,一个网站不允许请求同一个文件两次,即使设置了快捷键也无用的问题
  17. 【Git】版本控制管理(第二版) 前言 第一章 第二章
  18. MySQL installer直接解决安装(包括不想安在c盘也OK)、更新、卸载问题
  19. flink的内存管理器MemoryManager
  20. c语言的中打印出鸟图形,教你画出一只萌萌哒小鸟【PS教程】

热门文章

  1. 阿里巴巴、百度前端工程师 2015 暑期实习生面试经历
  2. Silverlight开发历程—(绘制放射渐变图形)
  3. 4种免费将图片转成PDF的方法,手机电脑都能用
  4. 调用腾讯云语音转文本
  5. html中切角文本框,css实现切角效果
  6. php 斜杠字符,php-如何编码包含正斜杠的查询字符串?
  7. 如何将计算机桌面屏幕放大,电脑桌面内容放大怎么缩小
  8. 比尔·盖茨退位 | 历史上的今天
  9. 有关“夜壶冲”的由来
  10. git 撤销刚才的rebase_从撤销 rebase 谈谈 git 原理