Pascal VOCのフォーマットに関する調査
anntのpythonライブラリにpascalVOCの読み込み&書き込み機能を実装を検討中。 実装にあたって具体的な仕様を調べてみたもののあまり厳密に決まってなさそう。 調べてなんとなくわかったこととかメモなどを記載していく。
調べるにあたって参考にした資料
フォーマットの例
Pascal VOC 2007から抜粋したxmlファイルの例を記載する。
<annotation> <folder>VOC2007</folder> <filename>voc2007.jpg</filename> <source> <database>The VOC2007 Database</database> <annotation>PASCAL VOC2007</annotation> <image>flickr</image> <flickrid>325991873</flickrid> </source> <owner> <flickrid>archintent louisville</flickrid> <name>?</name> </owner> <size> <width>500</width> <height>375</height> <depth>3</depth> </size> <segmented>0</segmented> <object> <name>chair</name> <pose>Rear</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>263</xmin> <ymin>211</ymin> <xmax>324</xmax> <ymax>339</ymax> </bndbox> </object> <object> <name>chair</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>165</xmin> <ymin>264</ymin> <xmax>253</xmax> <ymax>372</ymax> </bndbox> </object> <object> <name>chair</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>1</difficult> <bndbox> <xmin>5</xmin> <ymin>244</ymin> <xmax>67</xmax> <ymax>374</ymax> </bndbox> </object> <object> <name>chair</name> <pose>Unspecified</pose> <truncated>0</truncated> <difficult>0</difficult> <bndbox> <xmin>241</xmin> <ymin>194</ymin> <xmax>295</xmax> <ymax>299</ymax> </bndbox> </object> <object> <name>chair</name> <pose>Unspecified</pose> <truncated>1</truncated> <difficult>1</difficult> <bndbox> <xmin>277</xmin> <ymin>186</ymin> <xmax>312</xmax> <ymax>220</ymax> </bndbox> </object> </annotation>
フォーマットの説明
1つのファイルに対して1つのアノテーション情報を記載したxmlファイルが用意されている。 xmlファイルは'annotation'タグで始まっていて、直下にメタデータに関するタグや、具体的なアノテーション情報が記載されているobjectタグなどが配置されている。
タグ名 | 説明 |
---|---|
folder | 画像が格納されているフォルダ名 |
filename | アノテーションした対象の画像ファイル名 |
source | (不明)情報源に関する情報? |
owner | (不明)画像の所有者に関する情報? |
size | タグ名通り画像サイズに関する情報(幅、高さ、チャネル数) |
segmented | (不明)0のことが多い気がする。 |
object | 肝心のアノテーション情報。詳細は次の段落で説明 |
objectタグについて
objectタグには肝心な画像内部に写っている物体の情報が記載されています。 各タグの説明は上述のガイドラインに従って記載しています。
タグ名 | 説明 |
---|---|
name | 写っている物体のクラス名 |
pose | おそらくアクション分類タスク用の人物の行動を表すタグ |
truncated | 物体が15~20%以上画像からはみ出しているか |
difficult | 認識するのが難しいオブジェクト。e.g. 理解に文脈が必要な画像等 |
occluded | 2008以降追加 物体の5%以上が何かに隠れているか |
bndbox | バウンディングボックスの位置情報 |
part | (不明)ポーズに関する情報? |
actions | 写っている人物の行動に関する情報。行動推測タスク用 |
point | (不明) |
殆ど不明となってしまった。明確なフォーマットが見つからずライブラリ作るのが大変そう。正直使う上で必要なタグは限られているので不要な月は実装しなくて良い気がする。 適宜、修正・追記していく予定。