我想将json文件转换为csv文件

时间:2019-03-05 09:01:42

标签: image image-processing annotations label

我有一个名为“ data.json”的json文件,我想将其转换为csv文件。 这是json文件的一部分:

{"1-DSCN9107-25082017.JPG131909":{"filename":"1-DSCN9107-25082017.JPG","size":131909,"regions":[{"shape_attributes":{"name":"polyline","all_points_x":[257,351,350,617,638,191,22,103,147],"all_points_y":[7,117,230,288,477,472,200,23,-1]},"region_attributes":{"car damaged parts":"parachoc"}}],"file_attributes":{}},

“ 1-DSCN9108-25082017.JPG132452”:{“文件名”:“ 1-DSCN9108-25082017.JPG”,“大小”:132452,“区域”:[{“ shape_attributes”:{“名称”:“折线“,” all_points_x“:[322,332,324,309,254,107,12,190,315,439,548,594,553,501,396,318],” all_points_y“:[83,100,152,175,189,168,254,442,477,472,340,220,98,2,0,85]}”“”“” “:{}},

“ 1-IMG_2854-16102017.jpg117738”:{“文件名”:“ 1-IMG_2854-16102017.jpg”,“大小”:117738,“区域”:[{“ shape_attributes”:{“名称”:“多边形“,” all_points_x“:[862,505,569,819,874,892],” all_points_y“:[390,504,670,678,497,407]},” region_attributes“:{”汽车损坏零件“:” parachoc“}}]],” file_attributes“:{}},

“ 1-IMG_2855-16102017.jpg122454”:{“文件名”:“ 1-IMG_2855-16102017.jpg”,“大小”:122454,“区域”:[null,null,{“ shape_attributes”:{“ name“:” polygon“,” all_points_x“:[783,843,440,377,445],” all_points_y“:[371,232,260,358,382]},” region_attributes“:{” car受损零件“:” parachoc“}}},{” shape_attributes“:{” name“ :“ rect”,“ x”:335,“ y”:424,“宽度”:419,“高度”:185},“ region_attributes”:{“汽车损坏的零件”:“ parachoc”}}]],“ file_attributes “:{}},

“ 1-IMG_2857-16102017.jpg133485”:{“文件名”:“ 1-IMG_2857-16102017.jpg”,“大小”:133485,“区域”:[{“ shape_attributes”:{“名称”:“多边形“,” all_points_x“:[1001,1017,582,487,678,1021,1019],” all_points_y“:[5,10,156,374,431,346,12]},” region_attributes“:{”汽车损坏部件“:” phare gauche“}} {“ shape_attributes”:{“ name”:“ polygon”,“ all_points_x”:[1019,79,116,1020],“ all_points_y”:[356,519,757,765]},“ region_attributes”:{“汽车损坏的零件”:“ parachoc”} }],“ file_attributes”:{}},

我只想提取csv文件中两个单独列中的两个字段filename和region_attributes。我该怎么办?

0 个答案:

没有答案