Mask_RCNN
Mask_RCNN copied to clipboard
Error while loading my own dataset(images)
hi every body i made a dataset but i think I made this dataset incorrect Because when i want to train it i get take this error:
Loading weights /home/farzad/mask_rcnn_coco.h5
2018-10-21 10:13:52.335212: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
Traceback (most recent call last):
File "custom.py", line 363, in
can you show your load_custom() function?
@lovedanang You mean the Json file? this is my Json file: {"_via_settings":{"ui":{"annotation_editor_height":25,"annotation_editor_fontsize":0.8,"leftsidebar_width":18,"image_grid":{"img_height":80,"rshape_fill":"none","rshape_fill_opacity":0.3,"rshape_stroke":"yellow","rshape_stroke_width":2,"show_region_shape":true,"show_image_policy":"all"},"image":{"region_label":"region_id","region_label_font":"10px Sans"}},"core":{"buffer_size":18,"filepath":{},"default_filepath":""},"project":{"name":"via_project_22Oct2018_9h4m"}},"_via_img_metadata":{"image1.jpg22699":{"filename":"image1.jpg","size":22699,"regions":[{"shape_attributes":{"name":"polyline","all_points_x":[23,56,96,130,174,209,235,263,276,269,231,170,132,68,31,13,13,24],"all_points_y":[131,77,44,30,28,37,54,101,176,212,251,269,274,257,230,195,147,132]},"region_attributes":{"head":"head"}}],"file_attributes":{}},"image2.jpg55195":{"filename":"image2.jpg","size":55195,"regions":[{"shape_attributes":{"name":"polyline","all_points_x":[375,343,310,317,344,416,459,495,505,490,435,375],"all_points_y":[28,49,137,236,287,302,284,206,112,53,22,27]},"region_attributes":{"head":"head"}},{"shape_attributes":{"name":"polyline","all_points_x":[98,137,191,231,246,247,223,198,139,98,61,24,53,98],"all_points_y":[28,26,35,64,134,188,246,289,313,307,268,164,78,27]},"region_attributes":{"head":"head"}}],"file_attributes":{}},"image3.jpg10744":{"filename":"image3.jpg","size":10744,"regions":[{"shape_attributes":{"name":"polyline","all_points_x":[150,90,67,74,113,153,208,236,225,148],"all_points_y":[22,48,95,150,184,204,185,129,60,22]},"region_attributes":{"head":"head"}}],"file_attributes":{}},"image4.jpg30982":{"filename":"image4.jpg","size":30982,"regions":[{"shape_attributes":{"name":"polyline","all_points_x":[151,91,61,77,126,186,235,250,208,151],"all_points_y":[115,150,210,278,308,308,278,215,126,113]},"region_attributes":{"head":"head"}}],"file_attributes":{}},"image5.jpg52968":{"filename":"image5.jpg","size":52968,"regions":[{"shape_attributes":{"name":"polyline","all_points_x":[387,250,216,220,254,278,425,470,527,521,463,387],"all_points_y":[89,157,224,305,369,388,388,357,253,146,84,87]},"region_attributes":{"head":"head"}}],"file_attributes":{}},"image6.jpg56672":{"filename":"image6.jpg","size":56672,"regions":[{"shape_attributes":{"name":"polyline","all_points_x":[349,279,258,314,428,528,539,455,349,350],"all_points_y":[85,127,271,347,364,300,185,109,83,82]},"region_attributes":{"head":"head"}}],"file_attributes":{}},"image7.jpg73111":{"filename":"image7.jpg","size":73111,"regions":[{"shape_attributes":{"name":"polyline","all_points_x":[391,310,252,224,243,379,475,565,604,591,508,392,393],"all_points_y":[122,153,226,399,453,538,553,504,417,275,141,121,120]},"region_attributes":{"head":"head"}}],"file_attributes":{}}},"_via_attributes":{"region":{"head":{"type":"image","description":"","options":{"head":""},"default_options":{"head":true}}},"file":{}}}
but this is the original json file:
{"test_pattern_qbist.jpg129855":{"fileref":"","size":129855,"filename":"test_pattern_qbist.jpg","base64_img_data":"","file_attributes":{},"regions":{}},"a_swan_swimming_in_geneve_lake.jpg62201":{"fileref":"","size":62201,"filename":"a_swan_swimming_in_geneve_lake.jpg","base64_img_data":"","file_attributes":{},"regions":{}},"sinus_test_pattern.jpg27894":{"fileref":"","size":27894,"filename":"sinus_test_pattern.jpg","base64_img_data":"","file_attributes":{},"regions":{}},"image67.jpg47277":{"fileref":"","size":47277,"filename":"image67.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[298,327,346,369,522,512,488,393,307,288,298],"all_points_y":[199,203,241,265,246,290,320,322,318,264,199]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[241,237,220,193,150,173,212,247,248,241],"all_points_y":[167,172,194,199,206,210,202,184,165,167]},"region_attributes":{"name":"damage"}}}},"image66.jpg19024":{"fileref":"","size":19024,"filename":"image66.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[199,176,120,97,89,90,110,129,146,168,173,185,199],"all_points_y":[78,83,86,98,125,168,192,206,174,143,120,100,78]},"region_attributes":{"name":"damage"}}}},"image65.jpg102144":{"fileref":"","size":102144,"filename":"image65.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[466,443,407,373,321,246,180,155,140,125,109,98,95,103,127,143,179,275,299,334,366,404,431,466],"all_points_y":[176,125,56,35,37,51,56,71,119,156,225,264,310,363,435,482,481,457,441,401,322,259,208,176]},"region_attributes":{"name":"damage"}}}},"image64.jpg85335":{"fileref":"","size":85335,"filename":"image64.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[519,503,507,532,554,574,579,563,548,530,519],"all_points_y":[187,232,251,251,242,228,212,190,179,172,187]},"region_attributes":{"name":"damage"}}}},"image63.jpg24447":{"fileref":"","size":24447,"filename":"image63.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[354,371,362,326,293,250,218,197,186,171,185,195,232,280,304,320,326,325,322,197,196,192,324,354],"all_points_y":[134,91,66,31,25,48,77,117,159,204,238,271,286,298,290,282,273,264,264,261,261,262,176,134]},"region_attributes":{"name":"damage"}}}},"image62.jpg26862":{"fileref":"","size":26862,"filename":"image62.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[204,154,116,50,39,84,119,147,176,204,198,204],"all_points_y":[200,218,238,240,234,227,216,201,184,182,203,200]},"region_attributes":{"name":"damage"}}}},"image61.jpg151524":{"fileref":"","size":151524,"filename":"image61.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[451,498,539,566,576,530,488,476,451],"all_points_y":[375,373,379,378,375,356,365,372,375]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[501,534,578,623,632,582,559,522,501,501],"all_points_y":[279,297,309,320,304,303,288,278,270,279]},"region_attributes":{"name":"damage"}}}},"image60.jpg9420":{"fileref":"","size":9420,"filename":"image60.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[171,167,199,222,244,236,214,186,171],"all_points_y":[150,183,195,190,183,140,148,147,150]},"region_attributes":{"name":"damage"}}}},"image59.png190027":{"fileref":"","size":190027,"filename":"image59.png","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[201,200,226,222,218,190,164,152,145,150,161,189,199,200,201],"all_points_y":[219,197,163,124,112,114,115,124,153,195,208,218,212,200,219]},"region_attributes":{"name":"damage"}}}},"image58.jpg19410":{"fileref":"","size":19410,"filename":"image58.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[91,176,291,339,270,122,67,96,91],"all_points_y":[354,342,316,277,291,331,336,352,354]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[267,307,327,332,303,267],"all_points_y":[422,424,402,383,400,422]},"region_attributes":{"name":"damage"}},"2":{"shape_attributes":{"name":"polygon","all_points_x":[300,242,173,152,196,261,300],"all_points_y":[486,507,543,569,556,525,486]},"region_attributes":{"name":"damage"}},"3":{"shape_attributes":{"name":"polygon","all_points_x":[106,214,321,356,351,283,277,161,115,106],"all_points_y":[260,256,234,200,183,200,211,228,259,260]},"region_attributes":{"name":"damage"}}}},"image57.jpg49985":{"fileref":"","size":49985,"filename":"image57.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[364,386,391,401,422,441,440,430,364],"all_points_y":[172,198,246,263,272,241,199,176,172]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[444,453,494,497,444],"all_points_y":[335,351,355,333,335]},"region_attributes":{"name":"damage"}},"2":{"shape_attributes":{"name":"polygon","all_points_x":[53,98,97,25,3,3,3,53],"all_points_y":[217,221,194,175,176,199,214,217]},"region_attributes":{"name":"damage"}}}},"image56.jpg54664":{"fileref":"","size":54664,"filename":"image56.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[425,395,414,448,535,620,707,707,688,663,615,536,473,425],"all_points_y":[140,178,230,304,311,334,262,230,197,163,148,142,144,140]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[451,482,536,598,577,543,505,460,451,451],"all_points_y":[380,397,395,389,367,373,371,359,371,380]},"region_attributes":{"name":"damage"}}}},"image55.jpeg6377":{"fileref":"","size":6377,"filename":"image55.jpeg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[170,143,125,115,138,207,219,209,194,174,170],"all_points_y":[35,59,101,127,148,151,130,97,73,50,35]},"region_attributes":{"name":"damage"}}}},"image54.jpg75921":{"fileref":"","size":75921,"filename":"image54.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[446,510,582,554,506,459,453,456,446],"all_points_y":[66,83,83,36,24,46,71,68,66]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[671,683,700,696,715,719,725,742,740,727,711,700,671],"all_points_y":[40,65,105,133,155,157,163,156,120,86,58,24,40]},"region_attributes":{"name":"damage"}},"2":{"shape_attributes":{"name":"polygon","all_points_x":[563,680,698,672,634,554,562,563],"all_points_y":[222,249,227,195,204,199,217,222]},"region_attributes":{"name":"damage"}},"3":{"shape_attributes":{"name":"polygon","all_points_x":[825,865,923,915,817,790,741,695,635,598,571,563,560,560,565,574,608,630,670,692,762,785,757,745,743,733,736,746,758,791,790,825],"all_points_y":[320,362,393,463,519,546,549,546,541,530,522,496,464,449,442,439,442,444,445,444,442,438,400,375,350,334,329,322,322,315,314,320]},"region_attributes":{"name":"damage"}}}},"image53.jpg99620":{"fileref":"","size":99620,"filename":"image53.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[423,433,456,448,462,480,499,511,537,553,540,515,479,443,423],"all_points_y":[158,160,165,175,185,173,165,163,161,157,151,152,152,151,158]},"region_attributes":{"name":"damage"}}}},"image52.jpg81607":{"fileref":"","size":81607,"filename":"image52.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[316,332,345,344,346,379,400,398,414,434,438,461,518,526,507,511,515,464,441,435,425,407,403,392,387,366,363,356,344,343,338,338,316],"all_points_y":[160,198,230,266,274,297,305,319,344,366,377,388,382,372,353,332,313,290,287,265,247,247,247,245,231,195,187,171,157,153,153,153,160]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[468,488,504,519,522,544,540,531,520,500,476,467,467,468],"all_points_y":[410,411,416,436,443,463,473,483,483,475,436,416,415,410]},"region_attributes":{"name":"damage"}},"2":{"shape_attributes":{"name":"polygon","all_points_x":[551,551,551,572,597,598,635,671,671,634,584,536,551],"all_points_y":[316,332,354,360,356,356,358,358,346,342,331,308,316]},"region_attributes":{"name":"damage"}}}},"image51.png781992":{"fileref":"","size":781992,"filename":"image51.png","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[238,286,317,342,359,413,443,368,286,288,239,237,238],"all_points_y":[181,202,222,221,240,293,349,321,260,257,233,194,181]},"region_attributes":{"name":"damage"}}}},"image50.jpg27642":{"fileref":"","size":27642,"filename":"image50.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[67,67,84,128,171,205,218,234,219,178,167,89,67],"all_points_y":[160,175,187,171,181,197,211,202,187,167,160,145,160]},"region_attributes":{"name":"damage"}}}},"image49.jpg1559182":{"fileref":"","size":1559182,"filename":"image49.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[874,657,480,431,318,330,464,562,676,756,785,841,874],"all_points_y":[434,450,436,418,412,453,499,520,536,531,499,476,434]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[1410,1457,1486,1496,1508,1495,1483,1444,1415,1410],"all_points_y":[429,425,425,448,477,495,499,479,439,429]},"region_attributes":{"name":"damage"}}}},"image48.jpg89979":{"fileref":"","size":89979,"filename":"image48.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[388,361,340,354,372,413,433,438,441,447,388],"all_points_y":[130,165,197,216,225,236,234,221,210,186,130]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[430,383,374,393,421,442,441,430],"all_points_y":[292,305,333,357,357,353,300,292]},"region_attributes":{"name":"damage"}},"2":{"shape_attributes":{"name":"polygon","all_points_x":[310,333,381,397,399,369,342,329,310],"all_points_y":[403,428,440,441,413,396,398,386,403]},"region_attributes":{"name":"damage"}}}},"image47.jpg81861":{"fileref":"","size":81861,"filename":"image47.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[387,371,280,257,233,243,255,309,370,419,445,503,509,522,525,530,531,511,456,403,387],"all_points_y":[131,126,145,183,231,266,321,364,390,397,392,330,313,261,225,196,159,148,141,125,131]},"region_attributes":{"name":"damage"}}}},"image46.jpeg8226":{"fileref":"","size":8226,"filename":"image46.jpeg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[37,60,75,115,138,142,121,95,62,39,37],"all_points_y":[131,118,109,114,131,130,100,102,92,109,131]},"region_attributes":{"name":"damage"}}}},"image45.jpg72830":{"fileref":"","size":72830,"filename":"image45.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[402,392,345,304,273,248,216,177,146,140,64,60,99,164,208,295,387,402],"all_points_y":[241,224,215,224,225,235,238,260,278,289,310,322,312,292,258,230,241,241]},"region_attributes":{"name":"damage"}}}},"image43.jpg11530":{"fileref":"","size":11530,"filename":"image43.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[226,175,160,164,174,189,197,218,236,226],"all_points_y":[62,139,178,202,207,181,138,117,80,62]},"region_attributes":{"name":"damage"}}}},"image42.jpg166307":{"fileref":"","size":166307,"filename":"image42.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[566,584,655,760,831,882,909,940,971,989,1015,1038,1044,1004,953,858,795,721,632,560,566],"all_points_y":[330,355,378,379,386,395,353,337,317,305,286,274,256,243,274,331,361,353,340,325,330]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[658,647,627,554,528,537,570,641,695,738,759,852,862,905,937,976,987,969,927,892,861,838,766,716,658],"all_points_y":[437,477,507,520,539,564,567,559,551,533,534,534,527,514,493,467,446,429,418,419,429,436,446,440,437]},"region_attributes":{"name":"damage"}},"2":{"shape_attributes":{"name":"polygon","all_points_x":[1112,1144,1158,1160,1135,1108,1090,1112],"all_points_y":[324,324,307,285,298,313,325,324]},"region_attributes":{"name":"damage"}}}},"image40.jpeg6703":{"fileref":"","size":6703,"filename":"image40.jpeg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[78,90,114,129,143,226,229,201,154,114,78],"all_points_y":[60,81,107,131,143,166,159,118,95,79,60]},"region_attributes":{"name":"damage"}}}},"image44.jpg16443":{"fileref":"","size":16443,"filename":"image44.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[400,355,319,329,293,234,217,214,245,267,284,319,352,394,418,431,400],"all_points_y":[180,185,201,218,221,251,256,244,210,193,180,173,169,159,150,162,180]},"region_attributes":{"name":"damage"}}}},"image39.jpg177180":{"fileref":"","size":177180,"filename":"image39.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[258,348,416,475,494,465,446,394,394,363,352,335,307,289,258],"all_points_y":[493,493,494,493,485,466,463,457,457,453,457,465,478,483,493]},"region_attributes":{"name":"damage"}}}},"image38.jpg537354":{"fileref":"","size":537354,"filename":"image38.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[911,853,827,794,838,869,916,972,903,913,922,954,911],"all_points_y":[577,680,789,874,930,970,979,947,802,773,701,680,577]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[1090,1153,1200,1210,1246,1257,1290,1297,1202,1210,1244,1221,1170,1166,1149,1040,1069,1099,1090],"all_points_y":[528,469,501,587,640,732,804,869,934,893,863,791,695,688,653,638,621,596,528]},"region_attributes":{"name":"damage"}}}},"image33.jpg84015":{"fileref":"","size":84015,"filename":"image33.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[211,202,193,170,172,183,211],"all_points_y":[386,419,426,414,386,380,386]},"region_attributes":{"name":"damage"}}}},"image28.jpg29297":{"fileref":"","size":29297,"filename":"image28.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[371,418,490,493,548,594,670,641,592,535,494,452,410,377,325,311,371],"all_points_y":[221,226,247,262,262,266,270,253,248,246,236,223,209,210,197,203,221]},"region_attributes":{"name":"damage"}}}},"image21.jpeg8999":{"fileref":"","size":8999,"filename":"image21.jpeg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[90,120,148,154,159,135,111,84,69,80,90],"all_points_y":[113,123,127,105,92,76,64,64,79,92,113]},"region_attributes":{"name":"damage"}}}},"image19.jpeg4107":{"fileref":"","size":4107,"filename":"image19.jpeg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[108,89,72,73,77,81,101,119,139,160,135,114,111,110,126,108],"all_points_y":[73,65,93,122,151,181,208,221,227,220,204,171,148,123,103,73]},"region_attributes":{"name":"damage"}}}},"image18.jpeg8394":{"fileref":"","size":8394,"filename":"image18.jpeg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[100,118,144,162,161,155,154,133,121,133,124,100],"all_points_y":[98,111,116,112,94,77,63,62,70,76,88,98]},"region_attributes":{"name":"damage"}}}},"image17.jpg564107":{"fileref":"","size":564107,"filename":"image17.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[292,422,584,655,688,713,755,805,884,875,845,749,723,581,567,422,284,248,275,292],"all_points_y":[672,585,456,406,362,348,313,278,202,185,190,213,237,315,353,476,605,660,670,672]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[1020,897,878,854,874,888,957,982,1009,1020],"all_points_y":[223,315,340,315,284,255,208,196,195,223]},"region_attributes":{"name":"damage"}},"2":{"shape_attributes":{"name":"polygon","all_points_x":[830,793,771,740,669,533,500,508,646,746,809,830],"all_points_y":[334,365,391,418,486,600,637,660,558,485,404,334]},"region_attributes":{"name":"damage"}},"3":{"shape_attributes":{"name":"polygon","all_points_x":[582,600,716,736,638,533,582],"all_points_y":[897,874,884,915,971,986,897]},"region_attributes":{"name":"damage"}},"4":{"shape_attributes":{"name":"polygon","all_points_x":[810,786,771,789,801,833,848,818,810],"all_points_y":[816,850,886,903,884,831,792,805,816]},"region_attributes":{"name":"damage"}}}},"image16.jpg44825":{"fileref":"","size":44825,"filename":"image16.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[325,320,338,374,390,399,412,430,447,465,488,458,439,414,393,368,325],"all_points_y":[163,189,208,264,319,327,360,388,423,437,415,371,325,266,222,179,163]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[598,569,526,473,466,464,464,468,482,516,519,531,554,584,626,655,598],"all_points_y":[176,187,210,212,243,267,298,353,347,307,286,278,269,250,217,168,176]},"region_attributes":{"name":"damage"}}}},"image15.jpg11051":{"fileref":"","size":11051,"filename":"image15.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[81,111,138,160,196,203,210,201,166,135,111,91,84,81],"all_points_y":[123,106,102,114,131,149,170,179,175,181,168,155,132,123]},"region_attributes":{"name":"damage"}}}},"image14.jpg46482":{"fileref":"","size":46482,"filename":"image14.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[257,239,216,225,224,242,237,238,284,311,328,347,376,383,392,384,392,437,453,460,507,569,585,589,539,479,443,399,368,324,297,289,257],"all_points_y":[86,111,131,139,166,170,192,199,201,236,253,260,270,275,304,305,332,364,329,331,374,382,364,349,308,261,220,183,155,137,132,103,86]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[176,165,175,199,203,204,199,176],"all_points_y":[213,254,287,265,239,216,200,213]},"region_attributes":{"name":"damage"}},"2":{"shape_attributes":{"name":"polygon","all_points_x":[316,327,334,351,357,352,333,316],"all_points_y":[486,497,513,510,499,489,485,486]},"region_attributes":{"name":"damage"}}}},"image13.jpg586915":{"fileref":"","size":586915,"filename":"image13.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[1084,1127,1153,1186,1168,1092,1051,838,746,670,655,640,609,609,642,655,757,886,983,1084],"all_points_y":[586,685,810,929,1031,1201,1236,1252,1168,1084,950,884,751,655,607,589,576,581,564,586]},"region_attributes":{"name":"damage"}}}},"image10.jpg38250":{"fileref":"","size":38250,"filename":"image10.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[85,49,41,64,101,142,176,267,286,285,286,256,210,124,106,85],"all_points_y":[30,58,67,110,127,154,161,184,186,163,136,107,94,46,37,30]},"region_attributes":{"name":"damage"}}}},"image9.jpeg7037":{"fileref":"","size":7037,"filename":"image9.jpeg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[92,130,201,222,233,196,166,102,71,40,36,80,92],"all_points_y":[80,75,84,75,64,44,41,45,43,52,63,95,80]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[188,187,209,224,236,255,219,214,188],"all_points_y":[150,166,179,177,176,164,151,146,150]},"region_attributes":{"name":"damage"}}}},"image8.jpg145456":{"fileref":"","size":145456,"filename":"image8.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[404,368,319,284,242,217,190,194,199,209,218,242,273,283,319,315,325,328,355,358,419,428,446,479,486,404],"all_points_y":[300,358,432,460,501,532,581,640,697,751,796,823,820,820,800,760,669,635,548,532,446,435,388,357,345,300]},"region_attributes":{"name":"damage"}}}},"image7.jpg202200":{"fileref":"","size":202200,"filename":"image7.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[494,750,802,942,1025,1064,944,921,893,831,737,625,503,494],"all_points_y":[225,182,280,490,643,714,915,912,908,720,543,402,244,225]},"region_attributes":{"name":"damage"}}}},"image6.png195214":{"fileref":"","size":195214,"filename":"image6.png","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[63,85,109,137,205,215,189,171,140,113,99,79,63],"all_points_y":[109,120,131,135,135,128,126,126,124,113,103,98,109]},"region_attributes":{"name":"damage"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[264,280,351,353,331,279,259,233,264],"all_points_y":[126,123,139,123,113,111,115,120,126]},"region_attributes":{"name":"damage"}},"2":{"shape_attributes":{"name":"polygon","all_points_x":[6,29,33,10,0,6],"all_points_y":[102,100,92,83,90,102]},"region_attributes":{"name":"damage"}}}},"image5.jpeg8689":{"fileref":"","size":8689,"filename":"image5.jpeg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[73,81,120,128,115,112,88,73],"all_points_y":[96,109,137,118,106,105,98,96]},"region_attributes":{"name":"damage"}}}},"image4.jpg26872":{"fileref":"","size":26872,"filename":"image4.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[69,117,130,145,165,150,134,126,109,88,69],"all_points_y":[145,152,171,181,200,208,202,187,167,161,145]},"region_attributes":{"name":"damage"}}}},"image3.jpg79882":{"fileref":"","size":79882,"filename":"image3.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[473,450,434,380,352,304,267,236,184,71,60,62,143,146,196,237,301,371,426,473],"all_points_y":[201,175,159,143,131,131,132,103,93,131,170,242,322,326,324,239,201,180,196,201]},"region_attributes":{"name":"damage"}}}},"image2.jpg70052":{"fileref":"","size":70052,"filename":"image2.jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[761,752,679,624,504,443,370,306,275,213,177,156,127,128,102,102,126,232,273,364,473,566,658,677,702,725,761],"all_points_y":[201,147,79,68,90,94,123,143,162,203,225,224,249,278,340,357,356,266,229,185,152,130,134,166,185,191,201]},"region_attributes":{"name":"damage"}}}},"image1.jpeg4794":{"fileref":"","size":4794,"filename":"image1.jpeg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[216,168,85,89,105,121,155,169,201,212,216],"all_points_y":[41,37,44,75,123,124,125,117,80,48,41]},"region_attributes":{"name":"damage"}}}}}
You JSON does not have the same formatting as the required one. You need only one part of your JSON: the "_via_img_metadata". If you load your JSON into a variable names var, just pass var["_via_img_metadata"] and it should be fine.
Also, you could just modify your JSON to keep only the "_via_img_metadata" part, like that :
{ "image1.jpg22699": { "filename": "image1.jpg", "size": 22699, "regions": [ { "shape_attributes": { "name": "polyline", "all_points_x": [ 23, 56, 96, 130, 174, 209, 235, 263, 276, 269, 231, 170, 132, 68, 31, 13, 13, 24 ], "all_points_y": [ 131, 77, 44, 30, 28, 37, 54, 101, 176, 212, 251, 269, 274, 257, 230, 195, 147, 132 ] }, "region_attributes": { "head": "head" } } ], "file_attributes": {} }, "image2.jpg55195": { "filename": "image2.jpg", "size": 55195, "regions": [ { "shape_attributes": { "name": "polyline", "all_points_x": [ 375, 343, 310, 317, 344, 416, 459, 495, 505, 490, 435, 375 ], "all_points_y": [ 28, 49, 137, 236, 287, 302, 284, 206, 112, 53, 22, 27 ] }, "region_attributes": { "head": "head" } }, { "shape_attributes": { "name": "polyline", "all_points_x": [ 98, 137, 191, 231, 246, 247, 223, 198, 139, 98, 61, 24, 53, 98 ], "all_points_y": [ 28, 26, 35, 64, 134, 188, 246, 289, 313, 307, 268, 164, 78, 27 ] }, "region_attributes": { "head": "head" } } ], "file_attributes": {} }, "image3.jpg10744": { "filename": "image3.jpg", "size": 10744, "regions": [ { "shape_attributes": { "name": "polyline", "all_points_x": [ 150, 90, 67, 74, 113, 153, 208, 236, 225, 148 ], "all_points_y": [ 22, 48, 95, 150, 184, 204, 185, 129, 60, 22 ] }, "region_attributes": { "head": "head" } } ], "file_attributes": {} }, "image4.jpg30982": { "filename": "image4.jpg", "size": 30982, "regions": [ { "shape_attributes": { "name": "polyline", "all_points_x": [ 151, 91, 61, 77, 126, 186, 235, 250, 208, 151 ], "all_points_y": [ 115, 150, 210, 278, 308, 308, 278, 215, 126, 113 ] }, "region_attributes": { "head": "head" } } ], "file_attributes": {} }, "image5.jpg52968": { "filename": "image5.jpg", "size": 52968, "regions": [ { "shape_attributes": { "name": "polyline", "all_points_x": [ 387, 250, 216, 220, 254, 278, 425, 470, 527, 521, 463, 387 ], "all_points_y": [ 89, 157, 224, 305, 369, 388, 388, 357, 253, 146, 84, 87 ] }, "region_attributes": { "head": "head" } } ], "file_attributes": {} }, "image6.jpg56672": { "filename": "image6.jpg", "size": 56672, "regions": [ { "shape_attributes": { "name": "polyline", "all_points_x": [ 349, 279, 258, 314, 428, 528, 539, 455, 349, 350 ], "all_points_y": [ 85, 127, 271, 347, 364, 300, 185, 109, 83, 82 ] }, "region_attributes": { "head": "head" } } ], "file_attributes": {} }, "image7.jpg73111": { "filename": "image7.jpg", "size": 73111, "regions": [ { "shape_attributes": { "name": "polyline", "all_points_x": [ 391, 310, 252, 224, 243, 379, 475, 565, 604, 591, 508, 392, 393 ], "all_points_y": [ 122, 153, 226, 399, 453, 538, 553, 504, 417, 275, 141, 121, 120 ] }, "region_attributes": { "head": "head" } } ], "file_attributes": {} } }
@stygian2a thanks my dear one another question when i run this python3 custom.py train --dataset=/home/farzad/Deep-Learning/mask_rcnn_damage_detection --weights=coco after train how can i save the weights.h5?
@amin3511 you can add callbacks in model.train() or modify callbacks in model.py (line 2347-2353).
@lovedanang Can you explain more? i use this model.save_weights('my_model_weights.h5') but i get error
@amin3511 you can do like this.
this code will save your best weights. Because the model you have define by model = modellib.MaskRCNN(mode="training", config=config, model_dir="logs/") it wasn't defined by keras. if you want to save weights after training, you should modify train() function in model.py. Add self.keras_model.save_weights(...) below self.keras_model.fit_generator(....).
@stygian2a , im trying to modify my JSON file. i created annotations with VIA 2.0.7 and got ERRROR: KeyError: 'regions'. Please, can you help me? many thx.
Hi @stygian2a @flit86 Could you please share which part of your JSON did you change to match the formatting required by the code?
I am trying to utilize the Mask RCNN to identify buildings from images.
My JSON file is the following: {"_via_settings":{"ui":{"annotation_editor_height":25,"annotation_editor_fontsize":0.8,"leftsidebar_width":18,"image_grid":{"img_height":80,"rshape_fill":"none","rshape_fill_opacity":0.3,"rshape_stroke":"yellow","rshape_stroke_width":2,"show_region_shape":true,"show_image_policy":"all"},"image":{"region_label":"via_region_id","region_color":"via_default_region_color","region_label_font":"10px Sans","on_image_annotation_editor_placement":"NEAR_REGION"}},"core":{"buffer_size":18,"filepath":{},"default_filepath":""},"project":{"name":"train"}},
"_via_img_metadata":{"Z1.jpg59410":{"filename":"Z1.jpg","size":59410,"regions":[{"shape_attributes":{"name":"polygon","all_points_x":[82,77,82,155,163,160,143,142,133,133,117,115],"all_points_y":[206,249,256,271,229,217,213,209,207,200,197,205]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[213,212,182,178,213,221,227,234,243,243,265,271,273,269,265,258,262,235,232],"all_points_y":[25,40,37,69,75,79,78,82,81,70,73,58,38,36,31,35,11,7,24]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[193,234,239,230,179,189],"all_points_y":[219,225,234,299,299,226]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[248,289,294,288,237],"all_points_y":[229,235,243,298,299]},"region_attributes":{"dbuildings":"dbuilding"}}],
"file_attributes":{}},"Z2.jpg62702":{"filename":"Z2.jpg","size":62702,"regions":[{"shape_attributes":{"name":"polygon","all_points_x":[143,193,198,199,199,203,203,255,257,239,237,233,231,230,191,192,171,151,149,161,163,149],"all_points_y":[54,50,55,73,76,76,74,70,117,115,128,129,134,136,137,142,141,145,131,131,126,127]},"region_attributes":{"dbuildings":"dbuilding"}}],
"file_attributes":{}},"Z3.jpg60052":{"filename":"Z3.jpg","size":60052,"regions":[{"shape_attributes":{"name":"polygon","all_points_x":[164,169,187,189,240,237,288,283,203,202,165],"all_points_y":[95,146,146,166,166,143,139,89,96,90,93]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[45,50,50,148,148,143,103,103],"all_points_y":[104,130,156,150,129,94,96,101]},"region_attributes":{"dbuildings":"dbuilding"}}],
"file_attributes":{}},"Z4.jpg64861":{"filename":"Z4.jpg","size":64861,"regions":[{"shape_attributes":{"name":"polygon","all_points_x":[68,70,62,62,65,66,77,77,113,110,125,128,123],"all_points_y":[157,174,175,185,183,197,197,206,204,181,179,165,153]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[87,89,80,81,108,124,124,127,127,131,131,110,107,95],"all_points_y":[235,253,253,271,269,269,261,260,253,253,235,235,230,230]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[229,236,252,273,271,262,262,267,266,258,259],"all_points_y":[87,155,153,151,126,126,120,120,105,105,88]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[237,238,247,250,265,279,274],"all_points_y":[163,193,194,227,227,225,161]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[222,225,213,215,227,228,258,258,268,268,256,255],"all_points_y":[14,37,42,55,55,65,65,55,55,35,33,13]},"region_attributes":{"dbuildings":"dbuilding"}}],
"file_attributes":{}},"Z5.jpg68200":{"filename":"Z5.jpg","size":68200,"regions":[{"shape_attributes":{"name":"polygon","all_points_x":[209,217,282,275,295,293,257,257,249,250,259,259,250,250],"all_points_y":[59,133,128,62,60,13,18,21,23,39,39,55,58,55]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[94,127,133,133,160,158,154,93,91],"all_points_y":[180,180,185,175,181,197,210,210,185]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[29,99,99,97,95,101,107,104,24,21,32],"all_points_y":[21,16,24,35,35,68,71,81,83,54,53]},"region_attributes":{"dbuildings":"dbuilding"}}],
"file_attributes":{}},"Z6.jpg64795":{"filename":"Z6.jpg","size":64795,"regions":[{"shape_attributes":{"name":"polygon","all_points_x":[50,51,127,127,89,89,70,70],"all_points_y":[41,72,73,41,41,29,30,41]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[191,193,193,243,244,239,239,230,230,212,213],"all_points_y":[137,186,207,209,184,183,169,169,148,142,137]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[29,31,49,63,57,42,23],"all_points_y":[193,193,194,197,259,257,255]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[131,170,170,199,199,201,203,130],"all_points_y":[237,235,224,223,230,235,271,275]},"region_attributes":{"dbuildings":"dbuilding"}},{"shape_attributes":{"name":"polygon","all_points_x":[102,153,147,146,131,131,121,119,110,109,102,90],"all_points_y":[139,127,91,85,87,90,91,96,96,104,106,109]},"region_attributes":{"dbuildings":"dbuilding"}}],"file_attributes":{}}},"_via_attributes":{"region":{"dbuildings":{"type":"text","description":"","default_value":""}},"file":{}}}
This is the error that keeps popping up:
2019-07-08 19:04:21.815598: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set. If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU. To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
Traceback (most recent call last):
File "dbuilding.py", line 358, in
train(model)
File "dbuilding.py", line 175, in train
dataset_train.load_dbuilding(args.dataset, "train")
File "dbuilding.py", line 109, in load_dbuilding
annotations = [a for a in annotations if a['regions']]
File "dbuilding.py", line 109, in
annotations = [a for a in annotations if a['regions']]
KeyError: 'regions'
Would really appreciate it if you could provide a detailed explanation of the changes that you made and also suggest the changes that I should proceed with!
Dear amin3511,
I want to use Mask-RCNN to train on my custom dataset (just one class).
First of all, I use Labelme to create groundtruth for each image. Each image has a .json file as its ground-truth.
After that, I don't know what should I do...
I want to know how to convert my groundtruth file to a format that Mask-rcnn can use. Do you have any tools ?
Looking forward to hearing from you, thanks in advance.
With best regards, Ming
Hi folks, i am trying to run annotated images which i labeled through VGG annotator and then try to get the json through colab directory and google drive directory. But it always give me no such file directory. Any suggestions ??
modify your JSON to keep only the "_via_img_metadata" part
Sorry, how do you have this format ?
I was using VGG Image Annotator 2.0.11 to annotate my dataset and I had the same issue. I fixed it in custom.py like this :
annotations1 = json.load(open(os.path.join(dataset_dir, "via_region_data.json")))
annotations2 = list(annotations1.values())
annotations3 = list(annotations2[1].values()) # need to adapt to our dataset
# annotations. Skip unannotated images.
annotations = [a for a in annotations3 if a['regions']]
It's not very gracefull but it works !