我需要一個工具來用矩形邊界框註釋圖像。輸出將採用pascal voc xml格式。註釋和圖像將成爲卷積神經網絡用於進行對象檢測的訓練數據集的一部分。我將自己手動註釋圖像。在pascal voc中註釋圖像xml
我考慮過以下工具,但他們不支持pascal-voc。
是否有一個註釋工具,將節省我的時間?
我需要一個工具來用矩形邊界框註釋圖像。輸出將採用pascal voc xml格式。註釋和圖像將成爲卷積神經網絡用於進行對象檢測的訓練數據集的一部分。我將自己手動註釋圖像。在pascal voc中註釋圖像xml
我考慮過以下工具,但他們不支持pascal-voc。
是否有一個註釋工具,將節省我的時間?
這個python代碼片段會將Sloth json轉換爲pascal voc xml。
def make_anno():
zind = 0
for z in data:
print zind
filename = data[zind]["filename"]
print filename
head, tail = os.path.split(filename)
basename, file_extension = os.path.splitext(tail)
f = open(basename + '.xml','w')
line = "<annotation>" + '\n'
f.write(line)
line = '\t\t<folder>' + "folder" + '</folder>' + '\n'
f.write(line)
line = '\t\t<filename>' + tail + '</filename>' + '\n'
f.write(line)
line = '\t\t<source>\n\t\t<database>Source</database>\n\t</source>\n'
f.write(line)
im=Image.open('/home/location/VOCdevkit/newdataset/img/' + tail)
(width, height) = im.size
line = '\t<size>\n\t\t<width>'+ str(width) + '</width>\n\t\t<height>' + str(height) + '</height>\n\t'
line += '\t<depth>Unspecified</depth>\n\t</size>'
f.write(line)
line = '\n\t<segmented>Unspecified</segmented>'
f.write(line)
ind = 0
for i in data[zind]["annotations"]:
line = '\n\t<object>'
line += '\n\t\t<name>Name</name>\n\t\t<pose>Unspecified</pose>'
line += '\n\t\t<truncated>Unspecified</truncated>\n\t\t<difficult>Unspecified</difficult>'
xmin = (data[zind]["annotations"][ind]["x"])
line += '\n\t\t<bndbox>\n\t\t\t<xmin>' + str(xmin) + '</xmin>'
ymin = (data[zind]["annotations"][ind]["y"])
line += '\n\t\t\t<ymin>' + str(ymin) + '</ymin>'
width = (data[zind]["annotations"][ind]["width"])
height = (data[zind]["annotations"][ind]["height"])
xmax = xmin + width
ymax = ymin + height
line += '\n\t\t\t<xmax>' + str(xmax) + '</xmax>'
line += '\n\t\t\t<ymax>' + str(ymax) + '</ymax>'
line += '\n\t\t</bndbox>'
line += '\n\t</object>'
f.write(line)
ind +=1
f.close()
zind +=1
看起來好像沒有工具可以輸出你想要的格式。您可能需要使用一種工具以不同的格式輸出xml
,並對其進行轉換。不理想,但可能會奏效。
例如,您可以構建一個xslt
以將工具的xml
輸出轉換爲Pascal VOC xml標準。
請參考我的github: https://github.com/tzutalin/ImageNet_Utils
pascal voc格式是否接受旋轉的矩形註釋?我想檢測劃痕,但是如果我不旋轉矩形,當劃痕水平或垂直時,我會得到太多背景。 –
我投票決定關閉,因爲這是一個工具的請求/推薦。也許你最好在SoftwareRecommendations StackExchange中問這個問題。另請參閱此處:http://meta.stackoverflow.com/questions/254393/what-exactly-is-a-recommendation-questions – RobAu
我尊敬地建議,高效管理深度學習數據集與查找pdf建議不一樣工具。 – gobob
您不是在問有效管理大數據集;你問一個工具來註釋圖像。您沒有展示任何關於自己尋找這樣的工具的研究,也沒有提供任何示例,也沒有顯示您的挑戰是什麼。請改善你的問題。 – RobAu