扑克数据集
数据集地址:https://download.csdn.net/download/matt45m/89130302
这是一个检测扑克牌种类的数据集,检测种类目前只有6种,分别是
"queen", "ten", "nine", "king", "jack", "ace"
数据集共含有363张图片,标注的工具是labelimg,数据标签是xml,格式如下:
<annotation><folder>train</folder><filename>cam_image37.jpg</filename><path>C:\tensorflow_cards\train\cam_image37.jpg</path><source><database>Unknown</database></source><size><width>960</width><height>540</height><depth>3</depth></size><segmented>0</segmented><object><name>ace</name><pose>Unspecified</pose><truncated>0</truncated><difficult>0</difficult><bndbox><xmin>293</xmin><ymin>41</ymin><xmax>448</xmax><ymax>247</ymax></bndbox></object><object><name>ace</name><pose>Unspecified</pose><truncated>0</truncated><difficult>0</difficult><bndbox><xmin>481</xmin><ymin>276</ymin><xmax>654</xmax><ymax>518</ymax></bndbox></object><object><name>king</name><pose>Unspecified</pose><truncated>0</truncated><difficult>0</difficult><bndbox><xmin>488</xmin><ymin>32</ymin><xmax>653</xmax><ymax>246</ymax></bndbox></object><object><name>king</name><pose>Unspecified</pose><truncated>0</truncated><difficult>0</difficult><bndbox><xmin>279</xmin><ymin>280</ymin><xmax>442</xmax><ymax>518</ymax></bndbox></object>
</annotation>
数据可视化:
from xml.dom.minidom import parse
import xml.dom.minidomdef acquire_label_xml(img_path):DOMTree = xml.dom.minidom.parse(img_path)collection = DOMTree.documentElementboundingbox = collection.getElementsByTagName("object")img_lable = []for i in boundingbox:tmp = []category = i.getElementsByTagName("name")[0].childNodes[0].datatmp.append(float([j.childNodes[0].data for j in i.getElementsByTagName("bndbox")[0].getElementsByTagName("xmin")][0]))tmp.append(float([j.childNodes[0].data for j in i.getElementsByTagName("bndbox")[0].getElementsByTagName("ymin")][0]))tmp.append(float([j.childNodes[0].data for j in i.getElementsByTagName("bndbox")[0].getElementsByTagName("xmax")][0]))tmp.append(float([j.childNodes[0].data for j in i.getElementsByTagName("bndbox")[0].getElementsByTagName("ymax")][0]))tmp.append(category)img_lable.append(tmp)return img_lable