误检太多解决办法:
1.增加数据。
2.如果没有数据,增加负样本。
将没有目标物体的场景当做负样本,生成空标签(如下代码),加入训练即可。
import os
import xml.dom.minidom
img_path = './fu/'
xml_path = './xml/'
for img_file in os.listdir(img_path):
img_name = os.path.splitext(img_file)[0]
#create an empty dom document object
doc = xml.dom.minidom.Document()
#creat a root node which name is annotation
annotation = doc.createElement('annotation')
#add the root node to the dom document object
doc.appendChild(annotation)
#add the folder subnode
folder = doc.createElement('folder')
folder_text = doc.createTextNode('JPEGImages')
folder.appendChild(folder_text)
annotation.appendChild(folder)
#add the filename subnode
filename = doc.createElement('filename')
filenam