Datawhale 零基础入门CV赛事-Task1 赛题理解

比赛链接:零基础入门CV赛事- 街景字符编码识别

目的:识别真实街景图片中的数字。

数据集:Google街景图像中的门牌号数据集(The Street View House Numbers Dataset, SVHN)。训练集数据包括3W张照片,验证集数据包括1W张照片,每张照片包括颜色图像和对应的编码类别和具体位置;为了保证比赛的公平性,测试集A包括4W张照片,测试集B包括4W张照片。
所有的数据(训练集、验证集和测试集)的标注使用JSON格式,并使用文件名进行索引。如果一个文件中包括多个字符,则使用列表将字段进行组合。
在这里插入图片描述
最终判断方法优劣的标准:以编码整体识别准确率为评价指标,结果越大越好。
在这里插入图片描述
提交格式:提交文件后缀名.csv。
.csv结果文件内部样式:
在这里插入图片描述
预备工作:
1)环境配置
利用anaconda新建虚拟环境。

conda create -n py37_torch131 python=3.7
source activate py37_torch131
conda install pytorch=1.3.1 torchvision cudatoolkit=10.0
pip install jupyter tqdm opencv-python matplotlib pandas

2)下载数据到指定路径(这部分是队长大大提供的代码,非常6)
前提是要先从天池网站上把他们提供的.csv文件下载下来。

# import related packages
import pandas as pd
import os
import requests
import zipfile
# read .csv file
links = pd.read_csv("mchar_data_list_0515.csv")# the path of .csv should be where you store your .csv file, modify it adaptively.

dir_name = "Dataset" 
mypath = "/home/zdst/Ryan/Street_view_number/" # the path should be modified according to your situation

if not os.path.exists(mypath + dir_name):
    os.mkdir(mypath + dir_name)

# download files from links listed on the .csv file one by one
for i,link in enumerate(links["link"]):
    file_name = links['file'][i]
    print(file_name,'\t',link)
    file_name = mypath + dir_name + '/' + file_name
    if not os.path.exists(file_name):
        response = requests.get(link,stream=True)
        with open(file_name,"wb") as f:
            for chunk in response.iter_content(chunk_size=1024):
                if chunk:
                   f.write(chunk)

zip_list = ['mchar_train','mchar_test_a','mchar_val']

# unzip related files
for little_zip in zip_list:
    if not os.path.exist(mypath + dir_name + '/' + little_zip):
        zip_file = zipfile.ZipFile(mypath + dir_name + '/' + little_zip + '.zip','r')
        zip_file.extractall(path = mypath + dir_name)

参考资料:
Datawhale 零基础入门CV赛事-Baseline讲解
Datawhale 零基础入门CV赛事-Task1 赛题理解

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值