概述
自己在用labelImg打好標(biāo)簽后,想只用其中幾類訓(xùn)練,不想訓(xùn)練全部類別,又不想重新打標(biāo)生成.xml文件,因此想到這個辦法:直接在.xml文件中刪除原有的不需要的標(biāo)簽類及其屬性。
打標(biāo)時標(biāo)簽名出現(xiàn)了大小寫(工程量大時可能會手滑),程序中有改寫標(biāo)簽值為小寫的過程,因為我做py-faster-rcnn 訓(xùn)練時,標(biāo)簽必須全部為小寫。
以如下的.xml文件為例,我故意把標(biāo)簽增加了大寫
<annotation verified="yes"> <filename>test.jpg</filename> <path>C:\Users\yasin\Desktop\test</path> <source> <database>Unknown</database> </source> <size> <width>400</width> <height>300</height> <depth>3</depth> </size> <segmented>0</segmented> <object> <name>People</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>80</xmin> <ymin>69</ymin> <xmax>144</xmax> <ymax>89</ymax> </bndbox> </object> <object> <name>CAT</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>40</xmin> <ymin>69</ymin> <xmax>143</xmax> <ymax>16</ymax> </bndbox> </object> <object> <name>dog</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>96</xmin> <ymin>82</ymin> <xmax>176</xmax> <ymax>87</ymax> </bndbox> </object> </annotation>
分享文章:python批量修改labelImg生成的xml文件的方法-創(chuàng)新互聯(lián)
文章起源:http://jinyejixie.com/article32/dcgepc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、域名注冊、做網(wǎng)站、微信公眾號、響應(yīng)式網(wǎng)站、微信小程序
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容