datawhale组队学习入门CV Task1
Task 1 赛题理解
项目数据
数据标签
评测指标
数据读取
解题思路
1. 项目数据
数据集来自SVHN街道字符
训练集:3W张照片,验证集:1W张照片
测试集A B 均包含4W张照片
2. 数据标签
训练集中图片给出编码标签和具体字符框位置,同一图片可能含有多个字符,使用JSON标注。
3. 评价指标
Score = 编码识别正确数量/测试集图片数量
4. 数据读取
JSON读标签
import json
train_json = json.load(open('../input/train.json'))
<div STYLE="page-break-after: always;"></div>
def parse_json(d):
arr = np.array([
d['top'], d['height'], d['left'], d['width'], d['label']
])
arr = arr.astype(int)
return arr
img = cv2.imread('../input/train/000000.png')
arr = parse_json(train_json['000000.png'])
plt.figure(figsize=(10, 10))
plt.subplot(1, arr.shape[1]+1, 1)
plt.imshow(img)
plt.xticks([]); plt.yticks([])
for idx in range(arr.shape[1]):
plt.subplot(1, arr.shape[1]+1, idx+2)
plt.imshow(img[arr[0, idx]:arr[0, idx]+arr[1, idx],arr[2, idx]:arr[2, idx]+arr[3, idx]])
plt.title(arr[4, idx])
plt.xticks([]); plt.yticks([])
5. 解题思路
对于不定长字符识别有三种解题思路
填充为定长字符
不定长字符识别
如CRNN字符识别模型
先检测再识别
先识别字符位置再识别字符。
参考物体检测模型SSD和YOLO.
小结
第一次使用anaconda,不熟悉jupyter操作,配置环境花了较长时间,对于题目意思基本理解。
资料来源:
Datawhale link.