diff --git a/README.md b/README.md index 122e70b821c1126f31004cc6c71322a1dbfa4066..1cbe50e75d3a33b9f099ee490baa8d66a28cfe6c 100644 --- a/README.md +++ b/README.md @@ -29,17 +29,26 @@ Unlike the FCN-32/16/8s models, this network is trained with gradient accumulati To reproduce the validation scores, use the [seg11valid](https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/data/pascal/seg11valid.txt) split defined by the paper in footnote 7. Since SBD train and PASCAL VOC 2011 segval intersect, we only evaluate on the non-intersecting set for validation purposes. -**NYUDv2 models**: trained online with high momentum on color, depth, and HHA features (from Gupta et al. https://github.com/s-gupta/rcnn-depth): +**NYUDv2 models**: trained online with high momentum on color, depth, and HHA features (from Gupta et al. https://github.com/s-gupta/rcnn-depth). +These models demonstrate FCNs for multi-modal input. * [FCN-32s NYUDv2 Color](nyud-fcn32s-color): single stream, 32 pixel prediction stride net on color/BGR input * [FCN-32s NYUDv2 HHA](nyud-fcn32s-hha): single stream, 32 pixel prediction stride net on HHA input * [FCN-32s NYUDv2 Early Color-Depth](nyud-fcn32s-color-d): single stream, 32 pixel prediction stride net on early fusion of color and (log) depth for 4-channel input * [FCN-32s NYUDv2 Late Color-HHA](nyud-fcn32s-color-hha): single stream, 32 pixel prediction stride net by late fusion of FCN-32s NYUDv2 Color and FCN-32s NYUDv2 HHA -**The following models have not yet been ported to master and trained with the latest settings. Check back soon.** +**SIFT Flow models**: trained online with high momentum for joint semantic class and geometric class segmentation. +These models demonstrate FCNs for multi-task output. + +* [FCN-32s SIFT Flow](siftflow-fcn32s): single stream stream, 32 pixel prediction stride net +* [FCN-16s SIFT Flow](siftflow-fcn16s): two stream, 16 pixel prediction stride net +* [FCN-8s SIFT Flow](siftflow-fcn8s): three stream, 8 pixel prediction stride net -SIFT Flow model (also fine-tuned from VGG-16): -* [FCN-16s SIFT Flow](https://gist.github.com/longjon/f35e3a101e1478f721f5#file-readme-md): two stream, 16 pixel prediction stride version +*Note*: in this release, the evaluation of the semantic classes is not quite right at the moment due to an issue with missing classes. +This will be corrected soon. +The evaluation of the geometric classes is fine. + +**The following models have not yet been ported to master and trained with the latest settings. Check back soon.** PASCAL-Context models including architecture definition, solver configuration, and bare-bones solving script (fine-tuned from the ILSVRC-trained VGG-16 model): * [FCN-32s PASCAL-Context](https://gist.github.com/shelhamer/80667189b218ad570e82#file-readme-md): single stream, 32 pixel prediction stride version diff --git a/data/sift-flow/README.md b/data/sift-flow/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fb7428ffb1646e22b11e1df737983ae4c558b279 --- /dev/null +++ b/data/sift-flow/README.md @@ -0,0 +1,16 @@ +# SIFT Flow + +SIFT Flow is a semantic segmentation dataset with two labelings: + +- semantic classes, such as "cat" or "dog" +- geometric classes, consisting of "horizontal, vertical, and sky" + +Refer to `classes.txt` for the listing of classes in model output order. +Refer to `../siftflow_layers.py` for the Python data layer for this dataset. + +Note that the dataset has a number of issues, including unannotated images and missing classes from the test set. +The provided splits exclude the unannotated images. +As noted in the paper, care must be taken for proper evalution by excluding the missing classes. + +Download the dataset: +http://www.cs.unc.edu/~jtighe/Papers/ECCV10/siftflow/SiftFlowDataset.zip diff --git a/data/sift-flow/classes.txt b/data/sift-flow/classes.txt new file mode 100644 index 0000000000000000000000000000000000000000..eb980fc5dbb899b9ec2db8732f6b2eeb5a0eddfd --- /dev/null +++ b/data/sift-flow/classes.txt @@ -0,0 +1,47 @@ +Semantic and geometric segmentation classes for scenes. + +Semantic: 0 is void and 1–33 are classes. + +01 awning +02 balcony +03 bird +04 boat +05 bridge +06 building +07 bus +08 car +09 cow +10 crosswalk +11 desert +12 door +13 fence +14 field +15 grass +16 moon +17 mountain +18 person +19 plant +20 pole +21 river +22 road +23 rock +24 sand +25 sea +26 sidewalk +27 sign +28 sky +29 staircase +30 streetlight +31 sun +32 tree +33 window + +Geometric: -1 is void and 1–3 are classes. + +01 sky +02 horizontal +03 vertical + +N.B. Three classes (cow, desert, and moon) are absent from the test set, so +they are excluded from evaluation. The highway_bost181 and street_urb506 images +are missing annotations so these are likewise excluded from evaluation. diff --git a/data/sift-flow/test.txt b/data/sift-flow/test.txt new file mode 100644 index 0000000000000000000000000000000000000000..7009acb59866193809b26e8bf6c355aa2d8d3d1f --- /dev/null +++ b/data/sift-flow/test.txt @@ -0,0 +1,200 @@ +coast_natu975 +insidecity_art947 +insidecity_urb781 +highway_bost374 +coast_n203085 +insidecity_a223049 +mountain_nat116 +street_art861 +mountain_land188 +street_par177 +opencountry_natu524 +forest_natu29 +highway_gre37 +street_bost77 +insidecity_art1125 +street_urb521 +highway_bost178 +street_art760 +street_urb885 +insidecity_art829 +coast_natu804 +mountain_sharp44 +coast_natu649 +opencountry_land691 +insidecity_hous35 +tallbuilding_art1719 +mountain_n736026 +mountain_moun41 +insidecity_urban992 +opencountry_land295 +tallbuilding_art527 +highway_art238 +forest_for114 +coast_land296 +tallbuilding_sky7 +mountain_n44009 +tallbuilding_art1316 +forest_nat717 +highway_bost164 +street_par29 +forest_natc52 +tallbuilding_art1004 +coast_sun14 +opencountry_land206 +opencountry_land364 +mountain_n219015 +highway_a836030 +forest_nat324 +opencountry_land493 +insidecity_art1598 +street_street27 +insidecity_a48009 +coast_cdmc889 +street_gre295 +tallbuilding_a538076 +street_boston378 +highway_urb759 +street_par151 +tallbuilding_urban1003 +tallbuilding_urban16 +highway_bost151 +opencountry_nat965 +highway_gre661 +forest_for42 +opencountry_n18002 +insidecity_art646 +highway_gre55 +coast_n295051 +forest_bost103 +highway_n480036 +mountain_land4 +forest_nat130 +coast_nat643 +insidecity_urb250 +street_gre11 +street_boston271 +opencountry_n490003 +mountain_nat762 +street_par86 +coast_arnat59 +mountain_land787 +highway_gre472 +opencountry_tell67 +mountain_sharp66 +opencountry_land534 +insidecity_gre290 +highway_bost307 +opencountry_n213059 +forest_nat220 +forest_cdmc348 +tallbuilding_art900 +insidecity_art569 +street_urb200 +coast_natu468 +coast_n672069 +insidecity_hous109 +forest_land862 +opencountry_natu65 +tallbuilding_a805096 +opencountry_n291058 +forest_natu439 +coast_nat799 +tallbuilding_urban991 +tallbuilding_sky17 +opencountry_land638 +opencountry_natu563 +tallbuilding_urb733 +forest_cdmc451 +mountain_n371066 +mountain_n213081 +mountain_nat57 +tallbuilding_a463068 +forest_natu848 +tallbuilding_art306 +insidecity_boston92 +insidecity_urb584 +tallbuilding_urban1126 +coast_n286045 +street_gre179 +coast_nat1091 +opencountry_nat615 +coast_nat901 +forest_cdmc291 +mountain_natu568 +mountain_n18070 +street_bost136 +tallbuilding_art425 +coast_bea3 +tallbuilding_art1616 +insidecity_art690 +highway_gre492 +highway_bost320 +forest_nat400 +highway_par23 +tallbuilding_a212033 +forest_natu994 +tallbuilding_archi296 +highway_gre413 +tallbuilding_a279033 +insidecity_art1277 +coast_cdmc948 +forest_for15 +street_par68 +mountain_natu786 +opencountry_open61 +opencountry_nat423 +mountain_land143 +tallbuilding_a487066 +tallbuilding_art1751 +insidecity_hous79 +street_par118 +highway_bost293 +mountain_n213021 +opencountry_nat802 +coast_n384099 +opencountry_natu998 +mountain_n344042 +coast_nat1265 +forest_text44 +forest_for84 +insidecity_a807066 +opencountry_nat1117 +coast_sun42 +insidecity_par180 +opencountry_land923 +highway_art580 +street_art1328 +coast_cdmc838 +opencountry_land660 +opencountry_cdmc354 +coast_natu825 +opencountry_natu38 +mountain_nat30 +coast_n199066 +forest_text124 +forest_land222 +tallbuilding_city56 +tallbuilding_city22 +opencountry_fie36 +mountain_ski24 +coast_cdmc997 +insidecity_boston232 +opencountry_land575 +opencountry_land797 +insidecity_urb362 +forest_nat1033 +mountain_nat891 +street_hexp3 +tallbuilding_art1474 +tallbuilding_urban73 +opencountry_natu852 +mountain_nat1008 +coast_nat294 +mountain_sharp20 +opencountry_fie14 +mountain_land275 +forest_land760 +coast_land374 +mountain_nat426 +highway_gre141 \ No newline at end of file diff --git a/data/sift-flow/trainval.txt b/data/sift-flow/trainval.txt new file mode 100644 index 0000000000000000000000000000000000000000..c79a73d5f7b088f137367c9ffaec08bbf146b957 --- /dev/null +++ b/data/sift-flow/trainval.txt @@ -0,0 +1,2486 @@ +forest_for121 +tallbuilding_a812069 +street_bost64 +coast_land111 +mountain_land131 +mountain_n199074 +coast_n18001 +mountain_n213094 +opencountry_land692 +highway_gre459 +insidecity_urb308 +insidecity_urb301 +tallbuilding_urban22 +opencountry_nat1010 +street_boston18 +mountain_sharp18 +insidecity_art626 +forest_natu26 +insidecity_gre102 +opencountry_land625 +mountain_moun44 +mountain_n347077 +forest_land854 +tallbuilding_a562064 +tallbuilding_urban596 +tallbuilding_city14 +street_urb848 +forest_nat221 +opencountry_land351 +highway_n480001 +insidecity_boston57 +mountain_nat1003 +mountain_nat122 +opencountry_nat873 +forest_text42 +tallbuilding_art1015 +highway_bost321 +tallbuilding_art1357 +tallbuilding_a805044 +opencountry_tell56 +mountain_land879 +tallbuilding_art426 +tallbuilding_urban1057 +coast_osun54 +forest_nat209 +insidecity_a463022 +coast_natu808 +street_par150 +mountain_land280 +street_bost65 +tallbuilding_art1750 +coast_n122078 +highway_gre481 +street_boston274 +mountain_land716 +coast_cdmc954 +mountain_land130 +insidecity_urb121 +coast_n203071 +opencountry_land631 +tallbuilding_city8 +coast_n291008 +opencountry_nat1078 +opencountry_land507 +opencountry_art582 +opencountry_land658 +forest_nat315 +tallbuilding_a487092 +tallbuilding_sky3 +street_street110 +coast_cdmc862 +highway_nat542 +street_par3 +forest_land861 +coast_natu908 +opencountry_n18011 +coast_bea1 +coast_natu515 +coast_nat566 +mountain_ski72 +mountain_land880 +opencountry_nat932 +opencountry_nat823 +forest_bost98 +highway_art568 +insidecity_urb725 +opencountry_natu544 +mountain_nat1114 +coast_sun56 +forest_for102 +mountain_land150 +street_par101 +coast_cdmc900 +street_par12 +insidecity_par173 +street_urb265 +highway_bost325 +coast_cdmc845 +street_par165 +highway_gre42 +opencountry_nat457 +tallbuilding_art473 +highway_bost403 +opencountry_nat750 +highway_gre40 +mountain_sharp60 +mountain_sharp67 +tallbuilding_a462022 +opencountry_natu841 +opencountry_natu179 +opencountry_n371054 +forest_text46 +mountain_nat78 +street_par153 +coast_n486055 +highway_urb720 +highway_art1673 +highway_art874 +highway_bost334 +highway_gre48 +street_par64 +coast_sun34 +highway_bost311 +forest_for3 +mountain_land479 +opencountry_natu519 +mountain_sharp34 +forest_natu866 +forest_bost100 +coast_land258 +highway_gre684 +street_street47 +mountain_n219008 +forest_land245 +opencountry_land550 +forest_text47 +coast_natu815 +highway_bost149 +opencountry_fie35 +tallbuilding_art1413 +opencountry_natu652 +coast_nat202 +insidecity_gre262 +mountain_n344076 +tallbuilding_urban1158 +mountain_nat316 +forest_nat623 +forest_nat619 +street_par16 +tallbuilding_art350 +insidecity_city21 +coast_n344048 +street_hexp17 +mountain_land16 +insidecity_art642 +insidecity_boston282 +coast_natu25 +opencountry_land835 +coast_sun22 +tallbuilding_art945 +forest_nat1266 +highway_bost176 +opencountry_land560 +tallbuilding_art936 +insidecity_urba2 +coast_cdmc853 +opencountry_land388 +street_art767 +tallbuilding_art528 +forest_for132 +coast_bea27 +coast_nat174 +tallbuilding_art1756 +mountain_land28 +street_par112 +mountain_nat758 +street_urb928 +insidecity_hous120 +street_art1187 +insidecity_art669 +mountain_cdmc184 +tallbuilding_art1012 +coast_sun12 +insidecity_urb701 +forest_nat398 +coast_n708024 +tallbuilding_art459 +forest_cdmc352 +street_par83 +street_gre131 +forest_cdmc377 +forest_nat210 +mountain_n199080 +opencountry_land829 +mountain_n371063 +insidecity_a463036 +tallbuilding_urb988 +opencountry_cdmc712 +street_art1041 +opencountry_nat748 +forest_land376 +coast_cdmc988 +forest_for25 +street_par113 +coast_n291024 +coast_n291061 +tallbuilding_art1749 +forest_nat263 +insidecity_art1443 +forest_for82 +mountain_land198 +street_art771 +insidecity_urb321 +forest_cdmc533 +mountain_n44031 +mountain_land189 +opencountry_open7 +insidecity_hous36 +tallbuilding_urban1210 +opencountry_fie28 +coast_sun39 +coast_n672003 +opencountry_n676095 +forest_nat367 +coast_bea26 +mountain_nat199 +opencountry_fie7 +street_par188 +tallbuilding_art1593 +tallbuilding_art1538 +insidecity_art659 +tallbuilding_urban780 +opencountry_land416 +opencountry_land228 +insidecity_urb648 +opencountry_sopen10 +insidecity_a385019 +opencountry_n295071 +street_par74 +highway_bost308 +street_par72 +coast_n243011 +mountain_n841058 +mountain_n18071 +opencountry_cdmc795 +coast_natu631 +insidecity_gre286 +insidecity_art1604 +mountain_n213034 +opencountry_land41 +forest_land873 +mountain_n344028 +opencountry_land662 +tallbuilding_a487065 +mountain_nat73 +opencountry_land285 +mountain_n251048 +opencountry_land764 +forest_land64 +opencountry_land525 +coast_natu830 +insidecity_a808082 +opencountry_cdmc518 +mountain_sharp46 +street_boston68 +street_gre114 +highway_bost153 +tallbuilding_urban1110 +mountain_nat93 +highway_art596 +opencountry_fie24 +insidecity_a212024 +tallbuilding_city15 +insidecity_urb917 +tallbuilding_archi629 +mountain_n738012 +mountain_nat682 +mountain_n255068 +forest_for44 +tallbuilding_art1481 +mountain_n738013 +mountain_land775 +insidecity_gre197 +street_par97 +mountain_ski65 +tallbuilding_urb974 +coast_n241020 +street_urb294 +mountain_land15 +mountain_land180 +opencountry_land433 +opencountry_natu586 +street_art757 +highway_a866042 +opencountry_land572 +coast_n291022 +opencountry_natu138 +street_boston356 +opencountry_nat942 +mountain_land196 +opencountry_land355 +forest_art114 +tallbuilding_art840 +street_gre116 +insidecity_hous60 +tallbuilding_a487070 +mountain_natu105 +mountain_nat14 +opencountry_land701 +highway_urb754 +street_par76 +coast_n424023 +coast_nat1053 +street_boston32 +highway_bost187 +opencountry_for68 +street_gre209 +coast_cdmc924 +mountain_sharp29 +tallbuilding_a484066 +opencountry_land299 +highway_urb714 +forest_text107 +highway_art1682 +forest_nat219 +opencountry_natu885 +mountain_n18023 +coast_n243062 +insidecity_a248032 +coast_natu795 +coast_n241018 +coast_bea38 +opencountry_natu709 +mountain_nat84 +opencountry_natu176 +street_art1030 +mountain_nat332 +coast_natu822 +coast_nat288 +mountain_n213031 +tallbuilding_urban45 +mountain_nat56 +opencountry_land513 +opencountry_land516 +tallbuilding_art733 +highway_gre277 +forest_land765 +highway_urb962 +mountain_n18044 +forest_nat204 +forest_cdmc368 +mountain_nat1236 +insidecity_a855084 +street_par95 +insidecity_art1269 +mountain_nat688 +coast_n708050 +street_par162 +tallbuilding_a244043 +coast_cdmc123 +insidecity_hous68 +mountain_nat88 +forest_text119 +opencountry_land947 +forest_land864 +mountain_n737049 +opencountry_natu588 +insidecity_art1677 +mountain_land886 +forest_natu443 +coast_nat895 +mountain_moun37 +coast_n295011 +tallbuilding_a487069 +street_boston379 +insidecity_urb728 +insidecity_art795 +street_par22 +opencountry_nat150 +coast_cdmc878 +tallbuilding_archi95 +opencountry_cdmc713 +tallbuilding_urban979 +tallbuilding_urban1124 +mountain_sharp98 +tallbuilding_a808015 +forest_land858 +mountain_n213066 +insidecity_urb322 +tallbuilding_archi71 +street_art511 +tallbuilding_urban1028 +opencountry_land290 +opencountry_land545 +tallbuilding_a212055 +opencountry_land645 +opencountry_open31 +tallbuilding_gre5 +coast_natu641 +forest_for17 +opencountry_land659 +coast_bea9 +mountain_land471 +insidecity_bost85 +forest_for153 +highway_art1696 +forest_bost190 +forest_cdmc319 +tallbuilding_city38 +insidecity_art785 +mountain_n295082 +forest_cdmc318 +tallbuilding_a806016 +mountain_moun14 +opencountry_nat190 +highway_bost182 +forest_natu794 +tallbuilding_a588087 +forest_text41 +coast_land114 +mountain_n213075 +forest_land867 +forest_bost101 +coast_bea4 +coast_cdmc848 +forest_land866 +street_art379 +mountain_n213052 +mountain_moun10 +mountain_natu783 +tallbuilding_a244030 +street_art1199 +forest_nat361 +opencountry_moun17 +highway_gre541 +street_urb927 +insidecity_art612 +tallbuilding_art232 +forest_for47 +tallbuilding_urb529 +insidecity_urb343 +highway_natu778 +forest_cdmc547 +street_urban976 +tallbuilding_a212044 +insidecity_par128 +insidecity_art735 +coast_art487 +mountain_sharp16 +forest_land503 +mountain_n603007 +forest_land217 +forest_natu172 +mountain_nat92 +street_art1688 +coast_nat866 +coast_nat1149 +opencountry_land689 +insidecity_a462055 +highway_a866047 +insidecity_gre314 +highway_gre504 +forest_cdmc313 +coast_natu130 +tallbuilding_art979 +street_boston360 +opencountry_natu935 +tallbuilding_a462050 +mountain_n213065 +opencountry_nat599 +coast_natu824 +insidecity_art871 +insidecity_bost191 +coast_n295080 +insidecity_a212052 +highway_gre125 +opencountry_land505 +forest_text43 +opencountry_land952 +tallbuilding_art1556 +coast_nat479 +mountain_land22 +coast_nat1125 +opencountry_natu307 +tallbuilding_city12 +mountain_nat826 +forest_nat763 +mountain_cdmc181 +mountain_n18036 +highway_bost173 +coast_cdmc866 +tallbuilding_urban1059 +insidecity_a385047 +coast_cdmc934 +forest_natu428 +coast_nat283 +tallbuilding_sky25 +opencountry_land957 +mountain_land145 +mountain_n219006 +opencountry_land565 +tallbuilding_a487047 +highway_gre650 +street_gre600 +forest_for96 +highway_bost306 +highway_n480020 +insidecity_urb612 +insidecity_artc3 +insidecity_a805082 +highway_urb681 +coast_nat491 +tallbuilding_a805085 +tallbuilding_a487061 +mountain_n18021 +forest_cdmc333 +street_urb805 +tallbuilding_city7 +coast_cdmc942 +mountain_n736029 +opencountry_n291051 +mountain_natu742 +coast_cdmc977 +tallbuilding_archi85 +street_par100 +opencountry_nat455 +highway_gre35 +coast_nat770 +insidecity_hous18 +forest_natu430 +opencountry_land653 +street_par124 +insidecity_art1117 +tallbuilding_urban24 +mountain_natu766 +opencountry_nat1111 +tallbuilding_art1549 +opencountry_nat920 +mountain_natu668 +highway_gre467 +insidecity_art622 +highway_bost302 +highway_art885 +opencountry_moun8 +coast_natu604 +mountain_n603040 +coast_land370 +highway_gre491 +tallbuilding_urban158 +street_urb19 +coast_nat120 +opencountry_land352 +tallbuilding_city24 +tallbuilding_art736 +opencountry_land661 +highway_gre475 +highway_art576 +insidecity_urb323 +street_hexp30 +coast_natu704 +highway_bost179 +street_urb589 +mountain_n18028 +highway_art237 +coast_n328036 +highway_bost159 +forest_cdmc385 +mountain_natu750 +tallbuilding_urb899 +opencountry_land639 +highway_gre610 +forest_land335 +insidecity_art551 +tallbuilding_a487086 +mountain_land286 +tallbuilding_art1624 +opencountry_land663 +mountain_sharp68 +opencountry_n291050 +street_urban951 +tallbuilding_urban4 +forest_for149 +highway_urb715 +street_bost46 +street_par90 +insidecity_art1102 +mountain_n199031 +mountain_land780 +tallbuilding_art1717 +tallbuilding_art446 +opencountry_nat458 +mountain_n860034 +mountain_n371076 +tallbuilding_art1725 +tallbuilding_urban1056 +street_art766 +insidecity_art136 +coast_cdmc906 +street_urb304 +street_urb562 +coast_sun16 +highway_gre536 +tallbuilding_sky35 +forest_land801 +opencountry_nat1105 +mountain_moun13 +forest_land733 +coast_osun52 +insidecity_urb992 +highway_art579 +mountain_n295039 +forest_nat1248 +highway_gre462 +insidecity_boston247 +opencountry_land825 +insidecity_art1678 +opencountry_n266024 +forest_cdmc359 +street_gre191 +opencountry_land684 +coast_n347041 +coast_natu642 +coast_nat705 +tallbuilding_sky13 +forest_nat337 +forest_for58 +coast_nat1150 +highway_gre458 +mountain_n18039 +coast_n228083 +mountain_n213049 +tallbuilding_a487063 +highway_gre680 +opencountry_sopen15 +highway_gre275 +street_gre211 +opencountry_open42 +mountain_n213086 +coast_nat1112 +mountain_n219007 +forest_nat228 +forest_cdmc315 +insidecity_art673 +opencountry_land817 +mountain_land318 +highway_bost290 +highway_gre415 +insidecity_art637 +opencountry_nat731 +tallbuilding_archi621 +street_par91 +insidecity_gre98 +highway_land409 +coast_natu702 +opencountry_fie6 +opencountry_land665 +forest_natu317 +coast_land100 +street_boston263 +mountain_n213007 +mountain_moun1 +mountain_n199089 +coast_natu776 +tallbuilding_urb992 +forest_text102 +opencountry_nat499 +highway_bost183 +mountain_sharp61 +insidecity_boston383 +opencountry_land48 +highway_gre411 +forest_nat450 +mountain_n213056 +coast_nat893 +forest_for22 +mountain_land778 +mountain_sharp12 +insidecity_art819 +highway_gre153 +mountain_nat876 +tallbuilding_urban987 +forest_nat835 +highway_bost389 +coast_cdmc976 +coast_natu818 +tallbuilding_urb923 +mountain_n344059 +forest_natu441 +coast_nat865 +highway_gre404 +street_gre27 +opencountry_nat896 +street_gre115 +tallbuilding_art453 +tallbuilding_sky34 +insidecity_art545 +mountain_n213092 +coast_land954 +opencountry_natu864 +insidecity_boston245 +coast_sun31 +tallbuilding_a562066 +insidecity_a683008 +mountain_ski57 +mountain_natu894 +coast_n384030 +tallbuilding_art181 +highway_gre657 +highway_gre485 +opencountry_urb969 +street_hexp4 +coast_natu666 +coast_n203011 +coast_n291057 +forest_cdmc351 +insidecity_art786 +insidecity_urb515 +opencountry_natu380 +mountain_sharp21 +opencountry_fie10 +opencountry_natu984 +tallbuilding_sky37 +mountain_nat801 +tallbuilding_art360 +opencountry_land694 +insidecity_art635 +street_hexp21 +coast_cdmc891 +street_par33 +mountain_land230 +forest_natu425 +mountain_n213053 +mountain_land179 +insidecity_urb267 +insidecity_city84 +insidecity_a0010 +mountain_n344019 +coast_natu817 +forest_natu15 +opencountry_n295046 +coast_natu986 +forest_text48 +highway_gre426 +tallbuilding_urban749 +insidecity_art165 +street_street48 +mountain_art1131 +tallbuilding_boston210 +forest_natc13 +highway_bost154 +opencountry_nat874 +opencountry_land669 +opencountry_open38 +highway_bost310 +forest_nat286 +mountain_nat1135 +street_par20 +highway_nat550 +tallbuilding_art572 +mountain_nat1231 +insidecity_hous130 +mountain_n737027 +opencountry_natu979 +highway_gre408 +forest_natu860 +opencountry_nat1263 +highway_gre484 +forest_land159 +opencountry_natu385 +opencountry_nat1122 +tallbuilding_urban1150 +mountain_natu458 +street_gre189 +opencountry_fie30 +opencountry_fie46 +forest_natu696 +forest_text11 +mountain_nat1046 +tallbuilding_art1506 +forest_text122 +highway_bost387 +street_par120 +forest_nat451 +insidecity_art30 +forest_natu870 +tallbuilding_urb792 +highway_urb471 +opencountry_nat629 +mountain_n344082 +forest_natu440 +street_a714064 +insidecity_a385073 +street_boston270 +insidecity_bost79 +insidecity_art1158 +coast_land924 +coast_land369 +forest_sclos13 +street_art799 +opencountry_sclos10 +tallbuilding_a636015 +opencountry_osun12 +tallbuilding_art1483 +mountain_n371077 +coast_cdmc969 +coast_sun44 +street_art1162 +tallbuilding_urb391 +opencountry_n213027 +tallbuilding_a487049 +mountain_natu102 +mountain_land278 +street_par119 +coast_nat642 +highway_bost313 +forest_nat360 +mountain_n344053 +forest_text75 +forest_nat312 +opencountry_fie12 +coast_n424079 +opencountry_land703 +forest_land741 +street_par155 +coast_n735016 +mountain_n347078 +tallbuilding_art1390 +highway_gre149 +highway_gre656 +tallbuilding_art1393 +insidecity_urb449 +coast_n672004 +highway_gre480 +opencountry_nat1113 +tallbuilding_urban744 +forest_for20 +mountain_ski69 +highway_bost331 +street_gre219 +tallbuilding_art523 +insidecity_bost109 +forest_land863 +opencountry_nat678 +insidecity_bost42 +opencountry_natu19 +mountain_land132 +opencountry_nat1002 +forest_cdmc101 +coast_land902 +forest_cdmc290 +coast_land623 +insidecity_urb981 +forest_for116 +tallbuilding_urb390 +coast_n328052 +coast_osun51 +tallbuilding_urb914 +insidecity_par194 +highway_gre493 +forest_nat212 +tallbuilding_urban167 +tallbuilding_a462025 +mountain_land917 +street_hexp22 +coast_cdmc929 +tallbuilding_a438046 +street_urb244 +mountain_nat87 +insidecity_a683031 +coast_sun1 +tallbuilding_art1011 +forest_nat851 +tallbuilding_urban1038 +tallbuilding_urban1009 +mountain_n213041 +insidecity_art917 +mountain_land315 +tallbuilding_city30 +tallbuilding_a212026 +mountain_nat17 +tallbuilding_a487098 +mountain_nat340 +opencountry_land298 +forest_n18075 +insidecity_art20 +street_art1583 +forest_natu423 +opencountry_nat125 +insidecity_boston361 +mountain_sharp32 +forest_cdmc507 +opencountry_natu790 +insidecity_gre249 +opencountry_sclos30 +insidecity_art831 +highway_gre414 +coast_nat910 +coast_land302 +insidecity_art644 +opencountry_land604 +street_par6 +coast_cdmc841 +coast_n739047 +mountain_land13 +mountain_n213095 +tallbuilding_archi611 +tallbuilding_sky30 +insidecity_par181 +mountain_n344047 +highway_gre140 +opencountry_nat626 +highway_bost402 +highway_gre466 +opencountry_natu576 +insidecity_urb442 +coast_n199067 +forest_natu164 +insidecity_a212025 +highway_bost295 +opencountry_natu552 +coast_n203037 +mountain_sharp22 +coast_natu981 +forest_text50 +forest_natu895 +forest_nat1128 +opencountry_land964 +highway_gre155 +insidecity_boston29 +forest_for52 +forest_for32 +opencountry_n291085 +tallbuilding_a804050 +coast_nat745 +opencountry_nat173 +coast_osun56 +mountain_n860054 +mountain_sharp59 +tallbuilding_art430 +mountain_land142 +street_par192 +tallbuilding_sky22 +highway_gre473 +coast_n384038 +insidecity_a805052 +insidecity_gre303 +forest_for50 +highway_bost322 +tallbuilding_urban1193 +tallbuilding_a487074 +opencountry_cdmc109 +forest_land852 +insidecity_art922 +coast_nat292 +highway_bost326 +opencountry_nat1026 +opencountry_nat1145 +insidecity_art666 +tallbuilding_urban1202 +insidecity_a808091 +insidecity_urb464 +forest_for95 +insidecity_hous14 +street_par99 +insidecity_art1406 +opencountry_cdmc722 +highway_bost398 +mountain_n44004 +tallbuilding_a805043 +insidecity_art1364 +mountain_nat49 +coast_n295027 +highway_art608 +mountain_n18019 +mountain_natu762 +tallbuilding_art188 +tallbuilding_urban1048 +insidecity_art1651 +mountain_nat43 +forest_for38 +street_boston255 +opencountry_fie20 +coast_n672021 +street_boston241 +forest_land922 +insidecity_hous52 +opencountry_land239 +tallbuilding_a462023 +tallbuilding_art435 +tallbuilding_art447 +opencountry_nat718 +insidecity_art656 +mountain_natu457 +coast_nat899 +mountain_land465 +mountain_nat41 +insidecity_art1366 +highway_gre474 +street_boston351 +coast_n291075 +highway_bost314 +mountain_nat51 +highway_nat520 +forest_cdmc358 +street_par36 +coast_nat1177 +coast_sun3 +highway_gre609 +highway_gre646 +coast_natu777 +forest_nat310 +street_art1686 +forest_text106 +coast_sun57 +opencountry_land80 +opencountry_des16 +forest_natc12 +opencountry_land431 +coast_bea2 +forest_for106 +street_street22 +insidecity_urb114 +highway_art328 +street_bost45 +forest_cdmc331 +street_par87 +opencountry_cdmc937 +forest_nat417 +coast_cdmc922 +opencountry_land526 +opencountry_natu529 +street_a805038 +insidecity_art1058 +insidecity_urb881 +tallbuilding_urb777 +street_par1 +opencountry_land823 +forest_nat1027 +coast_n424081 +insidecity_hous19 +opencountry_land903 +highway_gre402 +opencountry_natu413 +tallbuilding_art589 +mountain_sharp30 +opencountry_natu541 +mountain_n213085 +tallbuilding_urban1152 +forest_cdmc277 +street_urb830 +coast_open62 +tallbuilding_art1370 +forest_nat223 +highway_gre400 +street_art764 +insidecity_art628 +mountain_land680 +coast_cdmc989 +mountain_land331 +street_street3 +opencountry_n18041 +highway_bost157 +insidecity_urb49 +opencountry_natu503 +tallbuilding_art391 +mountain_cdmc187 +tallbuilding_art1754 +opencountry_land238 +insidecity_art1165 +insidecity_a248045 +opencountry_land549 +mountain_sharp42 +street_par18 +forest_for105 +tallbuilding_urban983 +tallbuilding_urban1177 +insidecity_art1291 +tallbuilding_art554 +insidecity_urb972 +coast_land108 +forest_natu898 +opencountry_land577 +forest_cdmc283 +mountain_n347049 +tallbuilding_city70 +forest_for112 +coast_n228092 +coast_nat904 +opencountry_sopen9 +opencountry_natu559 +tallbuilding_art315 +insidecity_boston305 +forest_natu2 +coast_nat908 +forest_cdmc458 +forest_natc37 +opencountry_land605 +mountain_nat317 +mountain_n44003 +highway_bost304 +forest_natu158 +insidecity_a463024 +coast_n243030 +tallbuilding_city29 +coast_cdmc916 +tallbuilding_urban157 +street_par141 +insidecity_hous90 +mountain_sharp69 +opencountry_natu932 +insidecity_urb494 +coast_cdmc821 +forest_nat1097 +opencountry_natu574 +opencountry_n291056 +highway_bost156 +highway_bost303 +tallbuilding_city36 +forest_cdmc494 +opencountry_natu535 +tallbuilding_art183 +opencountry_land681 +insidecity_a805046 +coast_nat601 +highway_gre45 +opencountry_n213061 +highway_art563 +street_art923 +mountain_nat485 +tallbuilding_art943 +tallbuilding_art899 +mountain_natu699 +highway_bost155 +tallbuilding_art185 +tallbuilding_city4 +insidecity_urb130 +tallbuilding_a526065 +insidecity_gre641 +insidecity_hous87 +forest_natu863 +mountain_n44002 +tallbuilding_urban745 +forest_urb767 +highway_bost297 +opencountry_land833 +highway_gre407 +insidecity_urb680 +opencountry_n18003 +mountain_land281 +street_gre181 +opencountry_land956 +insidecity_art1363 +highway_urb713 +street_urban997 +insidecity_art620 +mountain_nat433 +mountain_n18009 +highway_urb537 +mountain_nat28 +opencountry_land891 +mountain_land161 +opencountry_natu89 +opencountry_natu647 +tallbuilding_a804071 +insidecity_hous77 +mountain_nat1232 +opencountry_land793 +street_boston21 +coast_nat905 +coast_gre637 +opencountry_land297 +opencountry_n199000 +opencountry_natu41 +opencountry_tell59 +insidecity_art892 +tallbuilding_sky1 +mountain_n603032 +mountain_n295042 +coast_natu469 +mountain_nat391 +mountain_n44062 +opencountry_nat8 +street_par52 +forest_nat162 +opencountry_natu734 +opencountry_land704 +street_street62 +insidecity_urb801 +forest_for27 +street_par70 +coast_sun4 +tallbuilding_art1350 +forest_for86 +tallbuilding_art332 +street_a205062 +tallbuilding_urban1064 +mountain_n480098 +opencountry_land342 +tallbuilding_sky43 +insidecity_art677 +insidecity_urb700 +opencountry_natu77 +mountain_n18069 +coast_cdmc825 +mountain_nat681 +highway_gre525 +mountain_natu749 +tallbuilding_a808090 +opencountry_land911 +highway_a866041 +opencountry_n371070 +insidecity_a487026 +tallbuilding_urban166 +coast_nat743 +opencountry_land359 +highway_gre683 +forest_nat982 +tallbuilding_art1712 +forest_land224 +opencountry_n371057 +highway_bost186 +forest_nat147 +mountain_nat37 +forest_cdmc317 +coast_nat1065 +opencountry_land564 +highway_bost169 +mountain_sharp78 +opencountry_land652 +coast_cdmc1000 +highway_bost318 +opencountry_fie13 +tallbuilding_a487002 +coast_bea39 +street_artc27 +forest_nat697 +highway_nat526 +street_urb983 +tallbuilding_sky42 +opencountry_land600 +coast_natu827 +highway_gre420 +coast_natu399 +opencountry_land732 +opencountry_land60 +street_par203 +forest_nat239 +mountain_n18058 +tallbuilding_art1728 +insidecity_gre22 +opencountry_land348 +coast_nat1043 +mountain_n255008 +mountain_sharp72 +highway_art1693 +mountain_n392087 +tallbuilding_art219 +opencountry_natu92 +opencountry_nat355 +forest_for136 +coast_cdmc850 +coast_nat1146 +highway_gre279 +highway_bost300 +forest_nat208 +mountain_n347051 +insidecity_hous83 +street_par152 +opencountry_fie33 +coast_n672000 +street_gre95 +mountain_sclos4 +highway_bost180 +forest_nat203 +street_art793 +highway_gre538 +tallbuilding_art260 +mountain_n405023 +coast_sun21 +opencountry_natu596 +insidecity_par136 +highway_bost309 +street_bost121 +opencountry_natu144 +coast_land897 +forest_for146 +opencountry_n291048 +mountain_land644 +forest_nat442 +tallbuilding_art1022 +street_boston286 +mountain_sharp96 +tallbuilding_urb398 +opencountry_fie5 +coast_cdmc940 +coast_n238045 +coast_n286096 +insidecity_urb723 +tallbuilding_art326 +opencountry_n18000 +forest_land219 +opencountry_land514 +street_art256 +forest_text105 +tallbuilding_urb492 +coast_nat605 +mountain_land197 +insidecity_bost55 +coast_nat482 +tallbuilding_art1711 +tallbuilding_art1722 +mountain_nat427 +tallbuilding_urb153 +highway_bost393 +street_boston397 +opencountry_nat446 +coast_sun59 +street_art775 +mountain_n213093 +coast_land367 +opencountry_n291082 +forest_natu723 +opencountry_cdmc935 +street_gre214 +coast_nat736 +insidecity_art638 +opencountry_n490067 +highway_gre476 +opencountry_nat502 +opencountry_n213062 +tallbuilding_urban649 +street_boston289 +coast_natu811 +opencountry_nat733 +insidecity_art700 +forest_nat946 +opencountry_land618 +forest_nat325 +forest_urb753 +forest_for130 +mountain_n405000 +mountain_nat99 +tallbuilding_art1558 +opencountry_nat780 +insidecity_urb123 +insidecity_a805091 +opencountry_nat164 +insidecity_art1135 +tallbuilding_city32 +highway_art1674 +coast_cdmc873 +opencountry_n371061 +forest_nat1127 +opencountry_land520 +insidecity_art1156 +forest_for148 +street_bost26 +tallbuilding_urb726 +mountain_natu974 +insidecity_a463070 +street_par5 +street_artc14 +tallbuilding_art352 +highway_urb716 +highway_bost158 +insidecity_gre287 +highway_gre470 +forest_nat211 +forest_nat349 +forest_text21 +mountain_moun27 +coast_land237 +street_par69 +tallbuilding_city47 +opencountry_land688 +coast_n291030 +highway_gre678 +opencountry_land406 +insidecity_a129053 +mountain_sharp5 +forest_nat1242 +highway_bost162 +coast_cdmc927 +highway_art1679 +tallbuilding_art424 +mountain_land619 +opencountry_n371053 +tallbuilding_sky38 +insidecity_urb376 +highway_urb784 +highway_gre53 +insidecity_art1044 +highway_gre409 +mountain_ski62 +opencountry_nat582 +opencountry_n18012 +coast_open60 +coast_n203036 +forest_natu28 +coast_sun45 +opencountry_land291 +tallbuilding_sky21 +street_par42 +highway_bost163 +coast_land341 +insidecity_urb970 +forest_cdmc284 +tallbuilding_a487067 +street_bost75 +forest_land807 +forest_natu31 +insidecity_art1633 +coast_n291032 +tallbuilding_a462057 +street_street98 +highway_bost324 +street_par4 +insidecity_art770 +forest_nat281 +coast_land334 +mountain_n737041 +insidecity_art641 +highway_gre530 +coast_n736062 +forest_for77 +forest_natu611 +forest_natu913 +opencountry_natu506 +coast_n672031 +mountain_sharp38 +forest_natu424 +tallbuilding_a244081 +mountain_land475 +street_urb798 +forest_for127 +insidecity_boston340 +tallbuilding_art1352 +highway_bost329 +opencountry_nat724 +opencountry_land443 +tallbuilding_a462018 +mountain_n213097 +insidecity_a463092 +tallbuilding_city41 +forest_nat470 +opencountry_natu539 +street_street56 +insidecity_art104 +insidecity_art625 +opencountry_natu735 +tallbuilding_a462003 +mountain_sharp11 +forest_land850 +opencountry_nat410 +insidecity_urb738 +coast_natu619 +tallbuilding_a487045 +street_boston61 +tallbuilding_a244069 +tallbuilding_urban693 +forest_natu169 +street_hexp28 +opencountry_open11 +insidecity_art1597 +opencountry_land61 +tallbuilding_a244009 +street_art976 +opencountry_land616 +forest_for143 +forest_natc4 +opencountry_land540 +opencountry_land556 +highway_bost185 +insidecity_art1037 +coast_natu819 +tallbuilding_art1727 +coast_nat167 +insidecity_urb354 +mountain_land172 +mountain_land10 +insidecity_a140032 +opencountry_natu726 +mountain_gre242 +mountain_sharp33 +tallbuilding_exp19 +insidecity_hous106 +tallbuilding_a244068 +street_gre186 +insidecity_urb454 +forest_natu634 +mountain_sharp52 +opencountry_natu136 +coast_nat1151 +tallbuilding_a807065 +street_street59 +street_gre126 +coast_bea30 +coast_bea14 +highway_nat546 +opencountry_fie23 +coast_bea24 +highway_urb545 +street_par146 +insidecity_art942 +insidecity_hous96 +opencountry_natu117 +tallbuilding_urban15 +mountain_nat25 +insidecity_art649 +opencountry_open12 +highway_bost394 +tallbuilding_bost390 +forest_bost102 +opencountry_land557 +street_par123 +mountain_n266020 +street_par158 +highway_gre52 +street_bost82 +mountain_land6 +street_urb332 +tallbuilding_art925 +insidecity_a0004 +opencountry_land501 +forest_nat719 +opencountry_n18080 +tallbuilding_urb893 +coast_land951 +coast_nat900 +street_city91 +insidecity_par40 +opencountry_natu593 +forest_for63 +tallbuilding_a632016 +coast_nat956 +mountain_natu461 +mountain_n199015 +insidecity_par186 +highway_bost319 +forest_nat1253 +street_par21 +insidecity_urb991 +coast_natu718 +coast_nat711 +opencountry_moun39 +opencountry_natu384 +tallbuilding_bost341 +street_boston353 +insidecity_hous37 +opencountry_land276 +opencountry_nat822 +mountain_sharp54 +street_urb382 +forest_nat354 +opencountry_n347020 +tallbuilding_city60 +forest_nat338 +highway_bost147 +forest_natu846 +opencountry_cdmc276 +forest_text40 +coast_n243061 +highway_bost291 +forest_cdmc292 +forest_cdmc282 +tallbuilding_a487039 +tallbuilding_art1619 +highway_bost184 +insidecity_art1167 +tallbuilding_urban1015 +tallbuilding_a223039 +tallbuilding_art442 +coast_land339 +highway_bost292 +tallbuilding_art296 +mountain_nat1136 +street_par102 +insidecity_urb279 +opencountry_land500 +insidecity_art738 +opencountry_sopen11 +opencountry_n18026 +mountain_nat42 +coast_n203069 +opencountry_moun36 +coast_nat820 +opencountry_natu532 +street_urban954 +coast_nat1175 +coast_nat921 +coast_n384013 +mountain_n736011 +opencountry_land271 +coast_natu901 +tallbuilding_art373 +opencountry_land640 +forest_text29 +mountain_nat74 +insidecity_art1486 +coast_cdmc960 +forest_cdmc12 +forest_cdmc415 +tallbuilding_art1546 +coast_nat897 +mountain_land763 +tallbuilding_city83 +tallbuilding_archi67 +tallbuilding_a487062 +forest_natu847 +insidecity_gre304 +street_gre128 +forest_cdmc338 +insidecity_art1186 +street_par199 +mountain_sharp70 +coast_natu923 +street_bost89 +street_a281067 +insidecity_boston262 +street_par49 +coast_bea5 +highway_gre658 +coast_nat284 +mountain_sopen16 +coast_nat810 +coast_n708004 +street_street94 +highway_bost177 +highway_art803 +insidecity_hous50 +street_par140 +mountain_n510071 +opencountry_nat524 +forest_cdmc562 +insidecity_gre446 +forest_cdmc363 +tallbuilding_a212017 +insidecity_art1185 +street_par178 +coast_n203066 +forest_land809 +street_gre122 +opencountry_open52 +insidecity_a379017 +mountain_natu466 +tallbuilding_urban171 +mountain_land27 +coast_land340 +tallbuilding_art1589 +coast_n243063 +mountain_nat80 +tallbuilding_art452 +tallbuilding_urb159 +insidecity_art643 +tallbuilding_a526079 +street_hexp23 +tallbuilding_a487085 +opencountry_land194 +street_art768 +street_land767 +tallbuilding_urban1172 +street_par84 +street_par160 +opencountry_land905 +mountain_land225 +street_city42 +opencountry_land68 +highway_gre58 +mountain_nat409 +highway_art254 +highway_bost168 +coast_nat172 +opencountry_nat654 +street_art1206 +mountain_art1132 +forest_natu18 +street_gre130 +opencountry_nat1121 +forest_text45 +opencountry_land573 +tallbuilding_art1017 +tallbuilding_art1228 +opencountry_land666 +opencountry_land220 +highway_art773 +tallbuilding_art1684 +forest_nat373 +highway_urb744 +highway_bost166 +opencountry_land656 +street_par79 +coast_n446013 +mountain_nat82 +tallbuilding_urb246 +insidecity_bost29 +mountain_land165 +highway_gre239 +forest_land872 +coast_natu826 +street_urb761 +opencountry_land87 +tallbuilding_city31 +coast_natu128 +coast_natu920 +street_a79094 +opencountry_n291054 +tallbuilding_a438011 +mountain_nat1084 +tallbuilding_archi603 +opencountry_open35 +opencountry_natu600 +forest_tell51 +opencountry_natu832 +tallbuilding_sky26 +tallbuilding_art1349 +forest_land377 +coast_nat890 +street_par134 +forest_cdmc306 +tallbuilding_urban3 +opencountry_n18073 +forest_nat715 +insidecity_urb474 +forest_nat468 +street_par9 +insidecity_art1586 +coast_n228047 +street_par185 +forest_natu325 +insidecity_hous114 +mountain_sopen24 +insidecity_hous39 +opencountry_land350 +coast_sun27 +opencountry_cdmc710 +coast_natu912 +opencountry_natu883 +opencountry_n251016 +opencountry_land515 +highway_bost165 +highway_bost167 +street_art475 +street_bost76 +mountain_nat79 +forest_nat359 +tallbuilding_archi615 +forest_for93 +forest_land215 +street_par197 +opencountry_land643 +insidecity_art904 +mountain_n213009 +forest_natu934 +coast_natu648 +street_boston345 +insidecity_art1594 +opencountry_open48 +forest_nat1088 +forest_for157 +street_bost81 +tallbuilding_art1183 +opencountry_n18053 +opencountry_natu183 +coast_natu791 +tallbuilding_a487056 +street_gre135 +street_street85 +highway_a866048 +coast_natu820 +tallbuilding_art1028 +opencountry_natu622 +mountain_n841060 +coast_n603063 +street_art758 +highway_n480070 +insidecity_urb224 +coast_art1130 +opencountry_natu540 +mountain_natu474 +opencountry_natu856 +coast_cdmc830 +mountain_nat36 +tallbuilding_city1 +street_urb866 +forest_for87 +opencountry_fie25 +forest_text20 +coast_cdmc991 +street_urb661 +opencountry_land651 +street_par161 +mountain_n860061 +opencountry_nat618 +insidecity_artc8 +tallbuilding_natu472 +highway_gre662 +coast_land253 +highway_bost172 +mountain_nat686 +tallbuilding_a807024 +tallbuilding_a487082 +tallbuilding_city5 +coast_natu887 +forest_cdmc430 +coast_n203032 +street_par85 +forest_natu163 +opencountry_natu557 +street_par198 +opencountry_natu100 +forest_nat146 +tallbuilding_art1713 +highway_bost316 +opencountry_sopen61 +opencountry_nat589 +mountain_nat53 +insidecity_gre511 +opencountry_n213060 +highway_bost174 +highway_bost317 +coast_n243057 +coast_natu131 +insidecity_a806018 +tallbuilding_art309 +coast_bea33 +forest_natc49 +highway_gre41 +coast_nat768 +mountain_sharp74 +forest_for119 +mountain_nat11 +insidecity_urb387 +opencountry_natu69 +forest_natu949 +forest_land727 +mountain_sharp73 +opencountry_natu843 +insidecity_art847 +tallbuilding_urban445 +highway_bost392 +mountain_n841059 +opencountry_open47 +coast_land946 +opencountry_natu454 +opencountry_land690 +opencountry_land353 +highway_bost332 +tallbuilding_a372007 +opencountry_nat1118 +forest_nat1217 +insidecity_urb335 +forest_natu977 +coast_n203030 +street_gre159 +forest_cdmc388 +highway_nat543 +tallbuilding_art15 +insidecity_hous126 +insidecity_hous15 +insidecity_hous97 +mountain_n18022 +mountain_nat77 +insidecity_art1164 +mountain_sharp41 +forest_for151 +street_par116 +mountain_n405055 +forest_text35 +tallbuilding_a632011 +insidecity_art1528 +forest_land810 +street_urb228 +opencountry_fie27 +tallbuilding_art1718 +opencountry_fie48 +opencountry_n213045 +tallbuilding_a462093 +forest_text39 +highway_land463 +opencountry_natu32 +forest_for78 +coast_n203004 +opencountry_open53 +mountain_n392090 +highway_land464 +coast_land480 +coast_nat186 +opencountry_n490070 +mountain_nat494 +mountain_nat54 +highway_bost150 +insidecity_a129035 +opencountry_n295006 +tallbuilding_art56 +coast_art294 +highway_gre406 +coast_n347047 +insidecity_hous64 +street_par28 +opencountry_n251011 +highway_land449 +forest_nat205 +opencountry_land745 +forest_nat266 +coast_cdmc860 +street_par94 +insidecity_hous70 +opencountry_natu618 +forest_text103 +tallbuilding_urban846 +tallbuilding_art1720 +tallbuilding_urban1081 +forest_text49 +street_gre76 +forest_natu396 +tallbuilding_a804068 +mountain_natu997 +highway_gre537 +tallbuilding_a808081 +highway_urb743 +coast_cdmc933 +street_boston339 +forest_land869 +coast_nat196 +opencountry_nat834 +opencountry_land494 +highway_art250 +coast_nat1208 +coast_natu667 +street_art838 +forest_sclos11 +insidecity_urb245 +forest_natu850 +street_boston19 +opencountry_nat511 +opencountry_land555 +street_urban950 +tallbuilding_art1617 +forest_text63 +tallbuilding_a487041 +mountain_n736023 +opencountry_land42 +insidecity_boston80 +coast_natu531 +highway_bost397 +opencountry_natu921 +street_gre160 +forest_for79 +coast_natu670 +highway_bost294 +street_art779 +insidecity_art1026 +coast_natu911 +mountain_nat55 +coast_nat602 +highway_gre533 +forest_land102 +insidecity_hous93 +tallbuilding_art1027 +street_bost56 +coast_land115 +coast_nat907 +insidecity_urb747 +tallbuilding_urban732 +mountain_n344080 +coast_cdmc851 +opencountry_open37 +coast_bea20 +opencountry_nat918 +insidecity_par189 +street_art880 +highway_gre145 +coast_bea10 +coast_land386 +street_par169 +opencountry_fie43 +highway_art558 +insidecity_art1161 +tallbuilding_urban989 +forest_for85 +street_par156 +street_par103 +highway_nat518 +insidecity_urb844 +forest_natu361 +forest_nat328 +forest_land243 +opencountry_land918 +tallbuilding_urban787 +street_boston396 +insidecity_a385075 +mountain_nat481 +coast_natu938 +mountain_n213048 +tallbuilding_art853 +opencountry_open30 +coast_natu813 +mountain_land223 +opencountry_n251015 +coast_n199065 +mountain_land26 +tallbuilding_a438038 +tallbuilding_art525 +coast_nat639 +highway_art1134 +street_art759 +forest_moun46 +forest_for137 +highway_bost171 +forest_nat1184 +coast_cdmc990 +tallbuilding_archi337 +coast_nat1074 +street_bost60 +street_par54 +street_urb722 +insidecity_a111017 +opencountry_natu83 +tallbuilding_city10 +opencountry_nat811 +tallbuilding_art617 +insidecity_art1258 +highway_bost336 +highway_n480045 +mountain_sharp92 +street_a232022 +mountain_sharp91 +mountain_land11 +insidecity_hous85 +forest_cdmc375 +tallbuilding_urb325 +street_par93 +opencountry_land51 +opencountry_n18054 +opencountry_nat609 +opencountry_land606 +tallbuilding_urb522 +mountain_sharp27 +opencountry_natu45 +coast_n328001 +street_par143 +opencountry_natu594 +mountain_land260 +insidecity_urb487 +mountain_sharp13 +street_street50 +mountain_nat1094 +coast_nat462 +tallbuilding_art1707 +tallbuilding_art1748 +street_gre121 +tallbuilding_a212018 +mountain_n295018 +forest_nat260 +coast_land277 +tallbuilding_archi628 +coast_n384092 +coast_sun15 +coast_sun5 +insidecity_art50 +highway_gre645 +insidecity_art1082 +coast_nat755 +forest_text81 +street_par154 +mountain_n18024 +forest_land107 +tallbuilding_art385 +mountain_nat38 +coast_n672034 +opencountry_natu939 +tallbuilding_city86 +forest_land81 +highway_art1204 +mountain_n344032 +street_urb837 +insidecity_gre94 +highway_bost160 +mountain_n213080 +tallbuilding_art1716 +opencountry_land617 +mountain_n371071 +insidecity_par139 +opencountry_natu55 +forest_text26 +mountain_nat752 +opencountry_land381 +tallbuilding_city50 +mountain_land33 +insidecity_art1664 +street_gre251 +highway_bost175 +tallbuilding_city65 +opencountry_land472 +coast_nat194 +tallbuilding_art1346 +street_boston272 +mountain_land30 +coast_n203059 +forest_text90 +mountain_n199073 +mountain_ski5 +mountain_n405030 +tallbuilding_art1747 +forest_natu707 +highway_gre36 +opencountry_natu546 +insidecity_urb849 +insidecity_enc3 +tallbuilding_art221 +insidecity_art827 +tallbuilding_urban1141 +tallbuilding_a487053 +insidecity_art676 +coast_natu789 +highway_gre46 +highway_gre532 +street_street61 +forest_for67 +street_bost72 +mountain_sharp43 +coast_natu816 +opencountry_land412 +tallbuilding_art218 +tallbuilding_art1392 +street_bost104 +opencountry_land358 +street_bost105 +opencountry_land147 +tallbuilding_art1387 +street_art761 +street_boston373 +highway_bost312 +mountain_land201 +tallbuilding_art1729 +opencountry_land657 +street_par88 +tallbuilding_a244046 +opencountry_sclos18 +mountain_n213005 +tallbuilding_urb906 +highway_art255 +street_gre193 +highway_gre50 +mountain_nat1142 +tallbuilding_art1001 +insidecity_art903 +insidecity_gre9 +opencountry_natu125 +street_par107 +tallbuilding_art1708 +mountain_sharp45 +insidecity_a804060 +opencountry_natu525 +mountain_sharp40 +insidecity_urb359 +insidecity_hous71 +insidecity_art1231 +coast_n291076 +highway_bost298 +street_gre653 +forest_for60 +tallbuilding_art1482 +mountain_ski61 +street_par125 +forest_natu72 +street_art546 +mountain_n531080 +insidecity_hous121 +forest_land726 +insidecity_boston369 +insidecity_urban1068 +highway_art252 +opencountry_land731 +insidecity_urb254 +forest_cdmc281 +insidecity_gre318 +highway_bost335 +insidecity_art901 +highway_bost305 +forest_nat798 +tallbuilding_a279032 +tallbuilding_art172 +insidecity_art727 +highway_bost315 +tallbuilding_a808075 +forest_natu170 +forest_nat867 +forest_cdmc278 +tallbuilding_urban28 +tallbuilding_a806011 +highway_gre147 +tallbuilding_art1310 +coast_natu643 +coast_nat1052 +coast_natu919 +mountain_n266017 +street_urb693 +street_par77 +insidecity_gre207 +coast_natu772 +coast_land113 +mountain_n603048 +street_boston79 +insidecity_par104 +highway_gre478 +tallbuilding_archi28 +insidecity_hous24 +mountain_nat884 +street_urb834 +street_enc15 +coast_nat472 +opencountry_fie8 +tallbuilding_urban828 +insidecity_art1039 +highway_bost148 +insidecity_art692 +mountain_n213098 +coast_nat667 +opencountry_land588 +coast_n295068 +opencountry_land687 +tallbuilding_art1618 +insidecity_hous13 +insidecity_art1110 +forest_text28 +mountain_natu687 +coast_nat807 +tallbuilding_a812029 +opencountry_moun21 +mountain_nat91 +forest_land870 +coast_nat496 +street_bost40 +insidecity_urb656 +mountain_nat1093 +coast_nat293 +street_par78 +mountain_sharp71 +street_gre86 +tallbuilding_urb731 +insidecity_urb721 +coast_cdmc706 +mountain_nat445 +highway_gre651 +forest_land871 +street_urb104 +street_boston46 +street_hexp12 +street_boston408 +mountain_n266018 +coast_sun33 +highway_gre30 +coast_cdmc955 +tallbuilding_archi317 +forest_natu322 +highway_bost330 +mountain_nat760 +tallbuilding_art224 +mountain_sharp48 +coast_land372 +highway_gre479 +insidecity_bost141 +insidecity_art902 +street_urb206 +street_urb274 +tallbuilding_art1732 +mountain_n213096 +coast_land812 +highway_bost323 +insidecity_hous28 +highway_bost395 +highway_bost296 +opencountry_land655 +coast_natu798 +coast_open13 +street_bost137 +coast_nat1201 +insidecity_art654 +forest_text38 +insidecity_art650 +insidecity_urb307 +forest_land849 +opencountry_land218 +mountain_n344062 +forest_nat1095 +tallbuilding_urb133 +street_enc48 +forest_natu402 +insidecity_gre19 +opencountry_nat955 +mountain_land210 +forest_nat1131 +forest_cdmc556 +tallbuilding_urban982 +insidecity_hous1 +coast_cdmc953 +mountain_nat783 +insidecity_a632023 +opencountry_natu449 +forest_for142 +opencountry_n371052 +insidecity_a129048 +forest_natu308 +highway_art820 +coast_nat739 +opencountry_n18077 +street_par59 +street_boston306 +highway_gre644 +street_art869 +street_hexp29 +insidecity_art1496 +opencountry_open55 +street_par81 +coast_n739046 +coast_nat109 +street_boston235 +opencountry_n295072 +opencountry_fie21 +mountain_nat117 +forest_cdmc271 +forest_cdmc280 +tallbuilding_a487087 +forest_text13 +tallbuilding_urban1044 +opencountry_nat1183 +mountain_n199004 +opencountry_fie26 +highway_art336 +mountain_sharp47 +opencountry_natu51 +mountain_nat1062 +highway_art813 +street_art762 +insidecity_gre270 +mountain_natu875 +insidecity_art695 +highway_gre403 +coast_nat1099 +mountain_land319 +opencountry_fie37 +coast_natu408 +tallbuilding_a803053 +mountain_land387 +opencountry_cdmc753 +tallbuilding_art854 +highway_bost301 +forest_text111 +mountain_nat1064 +street_par80 +mountain_sharp19 +mountain_nat29 +insidecity_bost27 +street_bost50 +insidecity_hous22 +mountain_land18 +highway_gre410 +coast_n243003 +coast_sun32 +forest_nat347 +mountain_sharp63 +coast_sun7 +highway_art489 +mountain_nat1207 +mountain_n44001 +highway_n480023 +forest_cdmc293 +insidecity_art681 +street_boston1 +street_art549 +coast_nat700 +opencountry_fie15 +tallbuilding_urb907 +forest_cdmc344 +tallbuilding_art1353 +coast_cdmc871 +forest_nat145 +highway_bost161 +coast_land112 +street_gre2 +coast_nat850 +forest_for110 +coast_natu473 +tallbuilding_art1351 +insidecity_urb482 +coast_land371 +forest_natu161 +mountain_n199075 +mountain_nat346 +highway_nat533 +coast_sun8 +insidecity_par129 +mountain_moun32 +coast_natu638 +forest_land314 +mountain_natu697 +mountain_land17 +insidecity_boston149 +mountain_natu756 +street_bost111 +insidecity_urb595 +tallbuilding_a248018 +opencountry_n676082 +opencountry_nat1034 +street_art798 +highway_gre144 +forest_natu869 +opencountry_land345 +tallbuilding_art106 +tallbuilding_art101 +forest_nat449 +opencountry_natu181 +highway_gre659 +mountain_nat59 +coast_nat285 +highway_urb710 +mountain_nat693 +tallbuilding_sky10 +mountain_moun38 +mountain_natu763 +highway_bost152 +mountain_nat1234 +insidecity_a807036 +tallbuilding_art392 +street_urb510 +coast_land368 +coast_land261 +mountain_n632073 +coast_n203015 +insidecity_hous40 +mountain_sharp10 +insidecity_urb108 +opencountry_land693 +mountain_land153 +highway_gre685 +mountain_natu460 +insidecity_bost44 +forest_cdmc414 +coast_n384026 +forest_nat452 +tallbuilding_a806037 +street_gre124 +forest_natu871 +opencountry_land269 +highway_bost299 +street_gre91 +mountain_nat67 +coast_bea29 +mountain_nat1017 +insidecity_art787 +coast_natu829 +forest_for65 +forest_for28 +coast_natu814 +coast_cdmc923 +tallbuilding_a244040 +insidecity_art661 +insidecity_a79054 +mountain_natu655 +coast_sun11 +tallbuilding_urb911 +coast_land309 +opencountry_land965 +street_art970 +opencountry_fie50 +coast_cdmc951 +street_urb305 +street_par14 +highway_art890 +opencountry_land709 +insidecity_art920 +tallbuilding_art457 +opencountry_natu583 +street_art862 +street_urban996 +highway_natu787 +mountain_sharp53 +coast_nat684 +coast_nat707 +opencountry_land233 +highway_bost170 +coast_sun28 +mountain_n213035 +opencountry_natu739 +opencountry_land202 \ No newline at end of file diff --git a/siftflow-fcn16s/caffemodel-url b/siftflow-fcn16s/caffemodel-url new file mode 100644 index 0000000000000000000000000000000000000000..4934b11d62ef136c80eda813abced1339033b818 --- /dev/null +++ b/siftflow-fcn16s/caffemodel-url @@ -0,0 +1 @@ +http://dl.caffe.berkeleyvision.org/siftflow-fcn16s-heavy.caffemodel diff --git a/siftflow-fcn16s/net.py b/siftflow-fcn16s/net.py new file mode 100644 index 0000000000000000000000000000000000000000..b3250ceb09fecc75040aa5d85e030309669a40d6 --- /dev/null +++ b/siftflow-fcn16s/net.py @@ -0,0 +1,105 @@ +import caffe +from caffe import layers as L, params as P +from caffe.coord_map import crop + +def conv_relu(bottom, nout, ks=3, stride=1, pad=1): + conv = L.Convolution(bottom, kernel_size=ks, stride=stride, + num_output=nout, pad=pad, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + return conv, L.ReLU(conv, in_place=True) + +def max_pool(bottom, ks=2, stride=2): + return L.Pooling(bottom, pool=P.Pooling.MAX, kernel_size=ks, stride=stride) + +def fcn(split): + n = caffe.NetSpec() + n.data, n.sem, n.geo = L.Python(module='siftflow_layers', + layer='SIFTFlowSegDataLayer', ntop=3, + param_str=str(dict(siftflow_dir='../data/sift-flow', + split=split, seed=1337))) + + # the base net + n.conv1_1, n.relu1_1 = conv_relu(n.data, 64, pad=100) + n.conv1_2, n.relu1_2 = conv_relu(n.relu1_1, 64) + n.pool1 = max_pool(n.relu1_2) + + n.conv2_1, n.relu2_1 = conv_relu(n.pool1, 128) + n.conv2_2, n.relu2_2 = conv_relu(n.relu2_1, 128) + n.pool2 = max_pool(n.relu2_2) + + n.conv3_1, n.relu3_1 = conv_relu(n.pool2, 256) + n.conv3_2, n.relu3_2 = conv_relu(n.relu3_1, 256) + n.conv3_3, n.relu3_3 = conv_relu(n.relu3_2, 256) + n.pool3 = max_pool(n.relu3_3) + + n.conv4_1, n.relu4_1 = conv_relu(n.pool3, 512) + n.conv4_2, n.relu4_2 = conv_relu(n.relu4_1, 512) + n.conv4_3, n.relu4_3 = conv_relu(n.relu4_2, 512) + n.pool4 = max_pool(n.relu4_3) + + n.conv5_1, n.relu5_1 = conv_relu(n.pool4, 512) + n.conv5_2, n.relu5_2 = conv_relu(n.relu5_1, 512) + n.conv5_3, n.relu5_3 = conv_relu(n.relu5_2, 512) + n.pool5 = max_pool(n.relu5_3) + + # fully conv + n.fc6, n.relu6 = conv_relu(n.pool5, 4096, ks=7, pad=0) + n.drop6 = L.Dropout(n.relu6, dropout_ratio=0.5, in_place=True) + n.fc7, n.relu7 = conv_relu(n.drop6, 4096, ks=1, pad=0) + n.drop7 = L.Dropout(n.relu7, dropout_ratio=0.5, in_place=True) + + n.score_fr_sem = L.Convolution(n.drop7, num_output=33, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + n.upscore2_sem = L.Deconvolution(n.score_fr_sem, + convolution_param=dict(num_output=33, kernel_size=4, stride=2, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_pool4_sem = L.Convolution(n.pool4, num_output=33, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + n.score_pool4_semc = crop(n.score_pool4_sem, n.upscore2_sem) + n.fuse_pool4_sem = L.Eltwise(n.upscore2_sem, n.score_pool4_semc, + operation=P.Eltwise.SUM) + n.upscore16_sem = L.Deconvolution(n.fuse_pool4_sem, + convolution_param=dict(num_output=33, kernel_size=32, stride=16, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_sem = crop(n.upscore16_sem, n.data) + # loss to make score happy (o.w. loss_sem) + n.loss = L.SoftmaxWithLoss(n.score_sem, n.sem, + loss_param=dict(normalize=False, ignore_label=255)) + + n.score_fr_geo = L.Convolution(n.drop7, num_output=3, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + + n.upscore2_geo = L.Deconvolution(n.score_fr_geo, + convolution_param=dict(num_output=3, kernel_size=4, stride=2, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_pool4_geo = L.Convolution(n.pool4, num_output=3, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + n.score_pool4_geoc = crop(n.score_pool4_geo, n.upscore2_geo) + n.fuse_pool4_geo = L.Eltwise(n.upscore2_geo, n.score_pool4_geoc, + operation=P.Eltwise.SUM) + n.upscore16_geo = L.Deconvolution(n.fuse_pool4_geo, + convolution_param=dict(num_output=3, kernel_size=32, stride=16, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_geo = crop(n.upscore16_geo, n.data) + n.loss_geo = L.SoftmaxWithLoss(n.score_geo, n.geo, + loss_param=dict(normalize=False, ignore_label=255)) + + return n.to_proto() + +def make_net(): + with open('trainval.prototxt', 'w') as f: + f.write(str(fcn('trainval'))) + + with open('test.prototxt', 'w') as f: + f.write(str(fcn('test'))) + +if __name__ == '__main__': + make_net() diff --git a/siftflow-fcn16s/solve.py b/siftflow-fcn16s/solve.py new file mode 100644 index 0000000000000000000000000000000000000000..36a679f1cd858e81d9ee360976c7fe43e757e640 --- /dev/null +++ b/siftflow-fcn16s/solve.py @@ -0,0 +1,31 @@ +import caffe +import surgery, score + +import numpy as np +import os + +import setproctitle +setproctitle.setproctitle(os.path.basename(os.getcwd())) + +weights = '../siftflow-fcn32s/siftflow-fcn32s.caffemodel' + +# init +caffe.set_device(int(sys.argv[1])) +caffe.set_mode_gpu() + +solver = caffe.SGDSolver('solver.prototxt') +solver.net.copy_from(weights) + +# surgeries +interp_layers = [k for k in solver.net.params.keys() if 'up' in k] +surgery.interp(solver.net, interp_layers) + +# scoring +test = np.loadtxt('../data/sift-flow/test.txt', dtype=str) + +for _ in range(50): + solver.step(2000) + # N.B. metrics on the semantic labels are off b.c. of missing classes; + # score manually from the histogram instead for proper evaluation + score.seg_tests(solver, False, test, layer='score_sem', gt='sem') + score.seg_tests(solver, False, test, layer='score_geo', gt='geo') diff --git a/siftflow-fcn16s/solver.prototxt b/siftflow-fcn16s/solver.prototxt new file mode 100644 index 0000000000000000000000000000000000000000..09aff3378dca8db28fc768884e919edc345f9126 --- /dev/null +++ b/siftflow-fcn16s/solver.prototxt @@ -0,0 +1,17 @@ +train_net: "trainval.prototxt" +test_net: "test.prototxt" +test_iter: 1111 +# make test net, but don't invoke it from the solver itself +test_interval: 999999999 +display: 20 +average_loss: 20 +lr_policy: "fixed" +# lr for unnormalized softmax +base_lr: 1e-12 +# high momentum +momentum: 0.99 +# no gradient accumulation +iter_size: 1 +max_iter: 300000 +weight_decay: 0.0005 +test_initialization: false diff --git a/siftflow-fcn16s/test.prototxt b/siftflow-fcn16s/test.prototxt new file mode 100644 index 0000000000000000000000000000000000000000..5ae3ecf006c77bf19dba368dccbd128ab2544df6 --- /dev/null +++ b/siftflow-fcn16s/test.prototxt @@ -0,0 +1,697 @@ +layer { + name: "data" + type: "Python" + top: "data" + top: "sem" + top: "geo" + python_param { + module: "siftflow_layers" + layer: "SIFTFlowSegDataLayer" + param_str: "{\'siftflow_dir\': \'../../data/sift-flow\', \'seed\': 1337, \'split\': \'test\'}" + } +} +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 100 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_1" + type: "ReLU" + bottom: "conv1_1" + top: "conv1_1" +} +layer { + name: "conv1_2" + type: "Convolution" + bottom: "conv1_1" + top: "conv1_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_2" + type: "ReLU" + bottom: "conv1_2" + top: "conv1_2" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1_2" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv2_1" + type: "Convolution" + bottom: "pool1" + top: "conv2_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_1" + type: "ReLU" + bottom: "conv2_1" + top: "conv2_1" +} +layer { + name: "conv2_2" + type: "Convolution" + bottom: "conv2_1" + top: "conv2_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_2" + type: "ReLU" + bottom: "conv2_2" + top: "conv2_2" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "conv2_2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv3_1" + type: "Convolution" + bottom: "pool2" + top: "conv3_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_1" + type: "ReLU" + bottom: "conv3_1" + top: "conv3_1" +} +layer { + name: "conv3_2" + type: "Convolution" + bottom: "conv3_1" + top: "conv3_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_2" + type: "ReLU" + bottom: "conv3_2" + top: "conv3_2" +} +layer { + name: "conv3_3" + type: "Convolution" + bottom: "conv3_2" + top: "conv3_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_3" + type: "ReLU" + bottom: "conv3_3" + top: "conv3_3" +} +layer { + name: "pool3" + type: "Pooling" + bottom: "conv3_3" + top: "pool3" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv4_1" + type: "Convolution" + bottom: "pool3" + top: "conv4_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_1" + type: "ReLU" + bottom: "conv4_1" + top: "conv4_1" +} +layer { + name: "conv4_2" + type: "Convolution" + bottom: "conv4_1" + top: "conv4_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_2" + type: "ReLU" + bottom: "conv4_2" + top: "conv4_2" +} +layer { + name: "conv4_3" + type: "Convolution" + bottom: "conv4_2" + top: "conv4_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_3" + type: "ReLU" + bottom: "conv4_3" + top: "conv4_3" +} +layer { + name: "pool4" + type: "Pooling" + bottom: "conv4_3" + top: "pool4" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv5_1" + type: "Convolution" + bottom: "pool4" + top: "conv5_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_1" + type: "ReLU" + bottom: "conv5_1" + top: "conv5_1" +} +layer { + name: "conv5_2" + type: "Convolution" + bottom: "conv5_1" + top: "conv5_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_2" + type: "ReLU" + bottom: "conv5_2" + top: "conv5_2" +} +layer { + name: "conv5_3" + type: "Convolution" + bottom: "conv5_2" + top: "conv5_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_3" + type: "ReLU" + bottom: "conv5_3" + top: "conv5_3" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5_3" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "fc6" + type: "Convolution" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 7 + stride: 1 + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "drop6" + type: "Dropout" + bottom: "fc6" + top: "fc6" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc7" + type: "Convolution" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 1 + stride: 1 + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "drop7" + type: "Dropout" + bottom: "fc7" + top: "fc7" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "score_fr_sem" + type: "Convolution" + bottom: "fc7" + top: "score_fr_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore2_sem" + type: "Deconvolution" + bottom: "score_fr_sem" + top: "upscore2_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool4_sem" + type: "Convolution" + bottom: "pool4" + top: "score_pool4_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool4_semc" + type: "Crop" + bottom: "score_pool4_sem" + bottom: "upscore2_sem" + top: "score_pool4_semc" + crop_param { + axis: 2 + offset: 5 + } +} +layer { + name: "fuse_pool4_sem" + type: "Eltwise" + bottom: "upscore2_sem" + bottom: "score_pool4_semc" + top: "fuse_pool4_sem" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore16_sem" + type: "Deconvolution" + bottom: "fuse_pool4_sem" + top: "upscore16_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 32 + stride: 16 + } +} +layer { + name: "score_sem" + type: "Crop" + bottom: "upscore16_sem" + bottom: "data" + top: "score_sem" + crop_param { + axis: 2 + offset: 27 + } +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "score_sem" + bottom: "sem" + top: "loss" + loss_param { + ignore_label: 255 + normalize: false + } +} +layer { + name: "score_fr_geo" + type: "Convolution" + bottom: "fc7" + top: "score_fr_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore2_geo" + type: "Deconvolution" + bottom: "score_fr_geo" + top: "upscore2_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool4_geo" + type: "Convolution" + bottom: "pool4" + top: "score_pool4_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool4_geoc" + type: "Crop" + bottom: "score_pool4_geo" + bottom: "upscore2_geo" + top: "score_pool4_geoc" + crop_param { + axis: 2 + offset: 5 + } +} +layer { + name: "fuse_pool4_geo" + type: "Eltwise" + bottom: "upscore2_geo" + bottom: "score_pool4_geoc" + top: "fuse_pool4_geo" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore16_geo" + type: "Deconvolution" + bottom: "fuse_pool4_geo" + top: "upscore16_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 32 + stride: 16 + } +} +layer { + name: "score_geo" + type: "Crop" + bottom: "upscore16_geo" + bottom: "data" + top: "score_geo" + crop_param { + axis: 2 + offset: 27 + } +} +layer { + name: "loss_geo" + type: "SoftmaxWithLoss" + bottom: "score_geo" + bottom: "geo" + top: "loss_geo" + loss_param { + ignore_label: 255 + normalize: false + } +} diff --git a/siftflow-fcn16s/trainval.prototxt b/siftflow-fcn16s/trainval.prototxt new file mode 100644 index 0000000000000000000000000000000000000000..f79cdfda09a366fd9e76a0c058a706c788b64af3 --- /dev/null +++ b/siftflow-fcn16s/trainval.prototxt @@ -0,0 +1,697 @@ +layer { + name: "data" + type: "Python" + top: "data" + top: "sem" + top: "geo" + python_param { + module: "siftflow_layers" + layer: "SIFTFlowSegDataLayer" + param_str: "{\'siftflow_dir\': \'../../data/sift-flow\', \'seed\': 1337, \'split\': \'trainval\'}" + } +} +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 100 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_1" + type: "ReLU" + bottom: "conv1_1" + top: "conv1_1" +} +layer { + name: "conv1_2" + type: "Convolution" + bottom: "conv1_1" + top: "conv1_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_2" + type: "ReLU" + bottom: "conv1_2" + top: "conv1_2" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1_2" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv2_1" + type: "Convolution" + bottom: "pool1" + top: "conv2_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_1" + type: "ReLU" + bottom: "conv2_1" + top: "conv2_1" +} +layer { + name: "conv2_2" + type: "Convolution" + bottom: "conv2_1" + top: "conv2_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_2" + type: "ReLU" + bottom: "conv2_2" + top: "conv2_2" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "conv2_2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv3_1" + type: "Convolution" + bottom: "pool2" + top: "conv3_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_1" + type: "ReLU" + bottom: "conv3_1" + top: "conv3_1" +} +layer { + name: "conv3_2" + type: "Convolution" + bottom: "conv3_1" + top: "conv3_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_2" + type: "ReLU" + bottom: "conv3_2" + top: "conv3_2" +} +layer { + name: "conv3_3" + type: "Convolution" + bottom: "conv3_2" + top: "conv3_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_3" + type: "ReLU" + bottom: "conv3_3" + top: "conv3_3" +} +layer { + name: "pool3" + type: "Pooling" + bottom: "conv3_3" + top: "pool3" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv4_1" + type: "Convolution" + bottom: "pool3" + top: "conv4_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_1" + type: "ReLU" + bottom: "conv4_1" + top: "conv4_1" +} +layer { + name: "conv4_2" + type: "Convolution" + bottom: "conv4_1" + top: "conv4_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_2" + type: "ReLU" + bottom: "conv4_2" + top: "conv4_2" +} +layer { + name: "conv4_3" + type: "Convolution" + bottom: "conv4_2" + top: "conv4_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_3" + type: "ReLU" + bottom: "conv4_3" + top: "conv4_3" +} +layer { + name: "pool4" + type: "Pooling" + bottom: "conv4_3" + top: "pool4" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv5_1" + type: "Convolution" + bottom: "pool4" + top: "conv5_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_1" + type: "ReLU" + bottom: "conv5_1" + top: "conv5_1" +} +layer { + name: "conv5_2" + type: "Convolution" + bottom: "conv5_1" + top: "conv5_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_2" + type: "ReLU" + bottom: "conv5_2" + top: "conv5_2" +} +layer { + name: "conv5_3" + type: "Convolution" + bottom: "conv5_2" + top: "conv5_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_3" + type: "ReLU" + bottom: "conv5_3" + top: "conv5_3" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5_3" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "fc6" + type: "Convolution" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 7 + stride: 1 + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "drop6" + type: "Dropout" + bottom: "fc6" + top: "fc6" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc7" + type: "Convolution" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 1 + stride: 1 + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "drop7" + type: "Dropout" + bottom: "fc7" + top: "fc7" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "score_fr_sem" + type: "Convolution" + bottom: "fc7" + top: "score_fr_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore2_sem" + type: "Deconvolution" + bottom: "score_fr_sem" + top: "upscore2_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool4_sem" + type: "Convolution" + bottom: "pool4" + top: "score_pool4_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool4_semc" + type: "Crop" + bottom: "score_pool4_sem" + bottom: "upscore2_sem" + top: "score_pool4_semc" + crop_param { + axis: 2 + offset: 5 + } +} +layer { + name: "fuse_pool4_sem" + type: "Eltwise" + bottom: "upscore2_sem" + bottom: "score_pool4_semc" + top: "fuse_pool4_sem" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore16_sem" + type: "Deconvolution" + bottom: "fuse_pool4_sem" + top: "upscore16_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 32 + stride: 16 + } +} +layer { + name: "score_sem" + type: "Crop" + bottom: "upscore16_sem" + bottom: "data" + top: "score_sem" + crop_param { + axis: 2 + offset: 27 + } +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "score_sem" + bottom: "sem" + top: "loss" + loss_param { + ignore_label: 255 + normalize: false + } +} +layer { + name: "score_fr_geo" + type: "Convolution" + bottom: "fc7" + top: "score_fr_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore2_geo" + type: "Deconvolution" + bottom: "score_fr_geo" + top: "upscore2_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool4_geo" + type: "Convolution" + bottom: "pool4" + top: "score_pool4_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool4_geoc" + type: "Crop" + bottom: "score_pool4_geo" + bottom: "upscore2_geo" + top: "score_pool4_geoc" + crop_param { + axis: 2 + offset: 5 + } +} +layer { + name: "fuse_pool4_geo" + type: "Eltwise" + bottom: "upscore2_geo" + bottom: "score_pool4_geoc" + top: "fuse_pool4_geo" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore16_geo" + type: "Deconvolution" + bottom: "fuse_pool4_geo" + top: "upscore16_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 32 + stride: 16 + } +} +layer { + name: "score_geo" + type: "Crop" + bottom: "upscore16_geo" + bottom: "data" + top: "score_geo" + crop_param { + axis: 2 + offset: 27 + } +} +layer { + name: "loss_geo" + type: "SoftmaxWithLoss" + bottom: "score_geo" + bottom: "geo" + top: "loss_geo" + loss_param { + ignore_label: 255 + normalize: false + } +} diff --git a/siftflow-fcn32s/caffemodel-url b/siftflow-fcn32s/caffemodel-url new file mode 100644 index 0000000000000000000000000000000000000000..3fe4172d63ec8ace4e0946312934843718c6a58a --- /dev/null +++ b/siftflow-fcn32s/caffemodel-url @@ -0,0 +1 @@ +http://dl.caffe.berkeleyvision.org/siftflow-fcn32s-heavy.caffemodel diff --git a/siftflow-fcn32s/net.py b/siftflow-fcn32s/net.py new file mode 100644 index 0000000000000000000000000000000000000000..c7c04225d487a547252dd3397655c93ee37364cc --- /dev/null +++ b/siftflow-fcn32s/net.py @@ -0,0 +1,82 @@ +import caffe +from caffe import layers as L, params as P +from caffe.coord_map import crop + +def conv_relu(bottom, nout, ks=3, stride=1, pad=1): + conv = L.Convolution(bottom, kernel_size=ks, stride=stride, + num_output=nout, pad=pad, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + return conv, L.ReLU(conv, in_place=True) + +def max_pool(bottom, ks=2, stride=2): + return L.Pooling(bottom, pool=P.Pooling.MAX, kernel_size=ks, stride=stride) + +def fcn(split): + n = caffe.NetSpec() + n.data, n.sem, n.geo = L.Python(module='siftflow_layers', + layer='SIFTFlowSegDataLayer', ntop=3, + param_str=str(dict(siftflow_dir='../data/sift-flow', + split=split, seed=1337))) + + # the base net + n.conv1_1, n.relu1_1 = conv_relu(n.data, 64, pad=100) + n.conv1_2, n.relu1_2 = conv_relu(n.relu1_1, 64) + n.pool1 = max_pool(n.relu1_2) + + n.conv2_1, n.relu2_1 = conv_relu(n.pool1, 128) + n.conv2_2, n.relu2_2 = conv_relu(n.relu2_1, 128) + n.pool2 = max_pool(n.relu2_2) + + n.conv3_1, n.relu3_1 = conv_relu(n.pool2, 256) + n.conv3_2, n.relu3_2 = conv_relu(n.relu3_1, 256) + n.conv3_3, n.relu3_3 = conv_relu(n.relu3_2, 256) + n.pool3 = max_pool(n.relu3_3) + + n.conv4_1, n.relu4_1 = conv_relu(n.pool3, 512) + n.conv4_2, n.relu4_2 = conv_relu(n.relu4_1, 512) + n.conv4_3, n.relu4_3 = conv_relu(n.relu4_2, 512) + n.pool4 = max_pool(n.relu4_3) + + n.conv5_1, n.relu5_1 = conv_relu(n.pool4, 512) + n.conv5_2, n.relu5_2 = conv_relu(n.relu5_1, 512) + n.conv5_3, n.relu5_3 = conv_relu(n.relu5_2, 512) + n.pool5 = max_pool(n.relu5_3) + + # fully conv + n.fc6, n.relu6 = conv_relu(n.pool5, 4096, ks=7, pad=0) + n.drop6 = L.Dropout(n.relu6, dropout_ratio=0.5, in_place=True) + n.fc7, n.relu7 = conv_relu(n.drop6, 4096, ks=1, pad=0) + n.drop7 = L.Dropout(n.relu7, dropout_ratio=0.5, in_place=True) + + n.score_fr_sem = L.Convolution(n.drop7, num_output=33, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + n.upscore_sem = L.Deconvolution(n.score_fr_sem, + convolution_param=dict(num_output=33, kernel_size=64, stride=32, + bias_term=False), + param=[dict(lr_mult=0)]) + n.score_sem = crop(n.upscore_sem, n.data) + # loss to make score happy (o.w. loss_sem) + n.loss = L.SoftmaxWithLoss(n.score_sem, n.sem, + loss_param=dict(normalize=False, ignore_label=255)) + + n.score_fr_geo = L.Convolution(n.drop7, num_output=3, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + n.upscore_geo = L.Deconvolution(n.score_fr_geo, + convolution_param=dict(num_output=3, kernel_size=64, stride=32, + bias_term=False), + param=[dict(lr_mult=0)]) + n.score_geo = crop(n.upscore_geo, n.data) + n.loss_geo = L.SoftmaxWithLoss(n.score_geo, n.geo, + loss_param=dict(normalize=False, ignore_label=255)) + + return n.to_proto() + +def make_net(): + with open('trainval.prototxt', 'w') as f: + f.write(str(fcn('trainval'))) + + with open('test.prototxt', 'w') as f: + f.write(str(fcn('test'))) + +if __name__ == '__main__': + make_net() diff --git a/siftflow-fcn32s/solve.py b/siftflow-fcn32s/solve.py new file mode 100644 index 0000000000000000000000000000000000000000..35ea7e94eac6b49dd992ac5b6454f2d3f7f5f50e --- /dev/null +++ b/siftflow-fcn32s/solve.py @@ -0,0 +1,31 @@ +import caffe +import surgery, score + +import numpy as np +import os + +import setproctitle +setproctitle.setproctitle(os.path.basename(os.getcwd())) + +weights = '../vgg16fc.caffemodel' + +# init +caffe.set_device(int(sys.argv[1])) +caffe.set_mode_gpu() + +solver = caffe.SGDSolver('solver.prototxt') +solver.net.copy_from(weights) + +# surgeries +interp_layers = [k for k in solver.net.params.keys() if 'up' in k] +surgery.interp(solver.net, interp_layers) + +# scoring +test = np.loadtxt('../data/sift-flow/test.txt', dtype=str) + +for _ in range(50): + solver.step(2000) + # N.B. metrics on the semantic labels are off b.c. of missing classes; + # score manually from the histogram instead for proper evaluation + score.seg_tests(solver, False, test, layer='score_sem', gt='sem') + score.seg_tests(solver, False, test, layer='score_geo', gt='geo') diff --git a/siftflow-fcn32s/solver.prototxt b/siftflow-fcn32s/solver.prototxt new file mode 100644 index 0000000000000000000000000000000000000000..ca72e5e32d065baf9c7d5957fee49f56e84e505b --- /dev/null +++ b/siftflow-fcn32s/solver.prototxt @@ -0,0 +1,17 @@ +train_net: "trainval.prototxt" +test_net: "test.prototxt" +test_iter: 1111 +# make test net, but don't invoke it from the solver itself +test_interval: 999999999 +display: 20 +average_loss: 20 +lr_policy: "fixed" +# lr for unnormalized softmax +base_lr: 1e-10 +# high momentum +momentum: 0.99 +# no gradient accumulation +iter_size: 1 +max_iter: 300000 +weight_decay: 0.0005 +test_initialization: false diff --git a/siftflow-fcn32s/solver.prototxt.orig b/siftflow-fcn32s/solver.prototxt.orig new file mode 100644 index 0000000000000000000000000000000000000000..ca72e5e32d065baf9c7d5957fee49f56e84e505b --- /dev/null +++ b/siftflow-fcn32s/solver.prototxt.orig @@ -0,0 +1,17 @@ +train_net: "trainval.prototxt" +test_net: "test.prototxt" +test_iter: 1111 +# make test net, but don't invoke it from the solver itself +test_interval: 999999999 +display: 20 +average_loss: 20 +lr_policy: "fixed" +# lr for unnormalized softmax +base_lr: 1e-10 +# high momentum +momentum: 0.99 +# no gradient accumulation +iter_size: 1 +max_iter: 300000 +weight_decay: 0.0005 +test_initialization: false diff --git a/siftflow-fcn32s/test.prototxt b/siftflow-fcn32s/test.prototxt new file mode 100644 index 0000000000000000000000000000000000000000..ced00099337347baf3f4d125e9bf8c127fa25157 --- /dev/null +++ b/siftflow-fcn32s/test.prototxt @@ -0,0 +1,587 @@ +layer { + name: "data" + type: "Python" + top: "data" + top: "sem" + top: "geo" + python_param { + module: "siftflow_layers" + layer: "SIFTFlowSegDataLayer" + param_str: "{\'siftflow_dir\': \'../../data/sift-flow\', \'seed\': 1337, \'split\': \'test\'}" + } +} +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 100 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_1" + type: "ReLU" + bottom: "conv1_1" + top: "conv1_1" +} +layer { + name: "conv1_2" + type: "Convolution" + bottom: "conv1_1" + top: "conv1_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_2" + type: "ReLU" + bottom: "conv1_2" + top: "conv1_2" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1_2" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv2_1" + type: "Convolution" + bottom: "pool1" + top: "conv2_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_1" + type: "ReLU" + bottom: "conv2_1" + top: "conv2_1" +} +layer { + name: "conv2_2" + type: "Convolution" + bottom: "conv2_1" + top: "conv2_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_2" + type: "ReLU" + bottom: "conv2_2" + top: "conv2_2" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "conv2_2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv3_1" + type: "Convolution" + bottom: "pool2" + top: "conv3_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_1" + type: "ReLU" + bottom: "conv3_1" + top: "conv3_1" +} +layer { + name: "conv3_2" + type: "Convolution" + bottom: "conv3_1" + top: "conv3_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_2" + type: "ReLU" + bottom: "conv3_2" + top: "conv3_2" +} +layer { + name: "conv3_3" + type: "Convolution" + bottom: "conv3_2" + top: "conv3_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_3" + type: "ReLU" + bottom: "conv3_3" + top: "conv3_3" +} +layer { + name: "pool3" + type: "Pooling" + bottom: "conv3_3" + top: "pool3" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv4_1" + type: "Convolution" + bottom: "pool3" + top: "conv4_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_1" + type: "ReLU" + bottom: "conv4_1" + top: "conv4_1" +} +layer { + name: "conv4_2" + type: "Convolution" + bottom: "conv4_1" + top: "conv4_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_2" + type: "ReLU" + bottom: "conv4_2" + top: "conv4_2" +} +layer { + name: "conv4_3" + type: "Convolution" + bottom: "conv4_2" + top: "conv4_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_3" + type: "ReLU" + bottom: "conv4_3" + top: "conv4_3" +} +layer { + name: "pool4" + type: "Pooling" + bottom: "conv4_3" + top: "pool4" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv5_1" + type: "Convolution" + bottom: "pool4" + top: "conv5_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_1" + type: "ReLU" + bottom: "conv5_1" + top: "conv5_1" +} +layer { + name: "conv5_2" + type: "Convolution" + bottom: "conv5_1" + top: "conv5_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_2" + type: "ReLU" + bottom: "conv5_2" + top: "conv5_2" +} +layer { + name: "conv5_3" + type: "Convolution" + bottom: "conv5_2" + top: "conv5_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_3" + type: "ReLU" + bottom: "conv5_3" + top: "conv5_3" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5_3" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "fc6" + type: "Convolution" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 7 + stride: 1 + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "drop6" + type: "Dropout" + bottom: "fc6" + top: "fc6" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc7" + type: "Convolution" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 1 + stride: 1 + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "drop7" + type: "Dropout" + bottom: "fc7" + top: "fc7" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "score_fr_sem" + type: "Convolution" + bottom: "fc7" + top: "score_fr_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore_sem" + type: "Deconvolution" + bottom: "score_fr_sem" + top: "upscore_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 64 + stride: 32 + } +} +layer { + name: "score_sem" + type: "Crop" + bottom: "upscore_sem" + bottom: "data" + top: "score_sem" + crop_param { + axis: 2 + offset: 19 + } +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "score_sem" + bottom: "sem" + top: "loss" + loss_param { + ignore_label: 255 + normalize: false + } +} +layer { + name: "score_fr_geo" + type: "Convolution" + bottom: "fc7" + top: "score_fr_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore_geo" + type: "Deconvolution" + bottom: "score_fr_geo" + top: "upscore_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 64 + stride: 32 + } +} +layer { + name: "score_geo" + type: "Crop" + bottom: "upscore_geo" + bottom: "data" + top: "score_geo" + crop_param { + axis: 2 + offset: 19 + } +} +layer { + name: "loss_geo" + type: "SoftmaxWithLoss" + bottom: "score_geo" + bottom: "geo" + top: "loss_geo" + loss_param { + ignore_label: 255 + normalize: false + } +} diff --git a/siftflow-fcn32s/trainval.prototxt b/siftflow-fcn32s/trainval.prototxt new file mode 100644 index 0000000000000000000000000000000000000000..57e17dda954be178ce91241332832c4384076106 --- /dev/null +++ b/siftflow-fcn32s/trainval.prototxt @@ -0,0 +1,587 @@ +layer { + name: "data" + type: "Python" + top: "data" + top: "sem" + top: "geo" + python_param { + module: "siftflow_layers" + layer: "SIFTFlowSegDataLayer" + param_str: "{\'siftflow_dir\': \'../../data/sift-flow\', \'seed\': 1337, \'split\': \'trainval\'}" + } +} +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 100 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_1" + type: "ReLU" + bottom: "conv1_1" + top: "conv1_1" +} +layer { + name: "conv1_2" + type: "Convolution" + bottom: "conv1_1" + top: "conv1_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_2" + type: "ReLU" + bottom: "conv1_2" + top: "conv1_2" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1_2" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv2_1" + type: "Convolution" + bottom: "pool1" + top: "conv2_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_1" + type: "ReLU" + bottom: "conv2_1" + top: "conv2_1" +} +layer { + name: "conv2_2" + type: "Convolution" + bottom: "conv2_1" + top: "conv2_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_2" + type: "ReLU" + bottom: "conv2_2" + top: "conv2_2" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "conv2_2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv3_1" + type: "Convolution" + bottom: "pool2" + top: "conv3_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_1" + type: "ReLU" + bottom: "conv3_1" + top: "conv3_1" +} +layer { + name: "conv3_2" + type: "Convolution" + bottom: "conv3_1" + top: "conv3_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_2" + type: "ReLU" + bottom: "conv3_2" + top: "conv3_2" +} +layer { + name: "conv3_3" + type: "Convolution" + bottom: "conv3_2" + top: "conv3_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_3" + type: "ReLU" + bottom: "conv3_3" + top: "conv3_3" +} +layer { + name: "pool3" + type: "Pooling" + bottom: "conv3_3" + top: "pool3" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv4_1" + type: "Convolution" + bottom: "pool3" + top: "conv4_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_1" + type: "ReLU" + bottom: "conv4_1" + top: "conv4_1" +} +layer { + name: "conv4_2" + type: "Convolution" + bottom: "conv4_1" + top: "conv4_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_2" + type: "ReLU" + bottom: "conv4_2" + top: "conv4_2" +} +layer { + name: "conv4_3" + type: "Convolution" + bottom: "conv4_2" + top: "conv4_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_3" + type: "ReLU" + bottom: "conv4_3" + top: "conv4_3" +} +layer { + name: "pool4" + type: "Pooling" + bottom: "conv4_3" + top: "pool4" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv5_1" + type: "Convolution" + bottom: "pool4" + top: "conv5_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_1" + type: "ReLU" + bottom: "conv5_1" + top: "conv5_1" +} +layer { + name: "conv5_2" + type: "Convolution" + bottom: "conv5_1" + top: "conv5_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_2" + type: "ReLU" + bottom: "conv5_2" + top: "conv5_2" +} +layer { + name: "conv5_3" + type: "Convolution" + bottom: "conv5_2" + top: "conv5_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_3" + type: "ReLU" + bottom: "conv5_3" + top: "conv5_3" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5_3" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "fc6" + type: "Convolution" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 7 + stride: 1 + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "drop6" + type: "Dropout" + bottom: "fc6" + top: "fc6" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc7" + type: "Convolution" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 1 + stride: 1 + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "drop7" + type: "Dropout" + bottom: "fc7" + top: "fc7" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "score_fr_sem" + type: "Convolution" + bottom: "fc7" + top: "score_fr_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore_sem" + type: "Deconvolution" + bottom: "score_fr_sem" + top: "upscore_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 64 + stride: 32 + } +} +layer { + name: "score_sem" + type: "Crop" + bottom: "upscore_sem" + bottom: "data" + top: "score_sem" + crop_param { + axis: 2 + offset: 19 + } +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "score_sem" + bottom: "sem" + top: "loss" + loss_param { + ignore_label: 255 + normalize: false + } +} +layer { + name: "score_fr_geo" + type: "Convolution" + bottom: "fc7" + top: "score_fr_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore_geo" + type: "Deconvolution" + bottom: "score_fr_geo" + top: "upscore_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 64 + stride: 32 + } +} +layer { + name: "score_geo" + type: "Crop" + bottom: "upscore_geo" + bottom: "data" + top: "score_geo" + crop_param { + axis: 2 + offset: 19 + } +} +layer { + name: "loss_geo" + type: "SoftmaxWithLoss" + bottom: "score_geo" + bottom: "geo" + top: "loss_geo" + loss_param { + ignore_label: 255 + normalize: false + } +} diff --git a/siftflow-fcn8s/caffemodel-url b/siftflow-fcn8s/caffemodel-url new file mode 100644 index 0000000000000000000000000000000000000000..c83d54b0529bcbad7439d1be9113ac2eb1502767 --- /dev/null +++ b/siftflow-fcn8s/caffemodel-url @@ -0,0 +1 @@ +http://dl.caffe.berkeleyvision.org/siftflow-fcn8s-heavy.caffemodel diff --git a/siftflow-fcn8s/net.py b/siftflow-fcn8s/net.py new file mode 100644 index 0000000000000000000000000000000000000000..1309080b955b52c5735ba9c5455f6f7c1dbcf2ba --- /dev/null +++ b/siftflow-fcn8s/net.py @@ -0,0 +1,127 @@ +import caffe +from caffe import layers as L, params as P +from caffe.coord_map import crop + +def conv_relu(bottom, nout, ks=3, stride=1, pad=1): + conv = L.Convolution(bottom, kernel_size=ks, stride=stride, + num_output=nout, pad=pad, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + return conv, L.ReLU(conv, in_place=True) + +def max_pool(bottom, ks=2, stride=2): + return L.Pooling(bottom, pool=P.Pooling.MAX, kernel_size=ks, stride=stride) + +def fcn(split): + n = caffe.NetSpec() + n.data, n.sem, n.geo = L.Python(module='siftflow_layers', + layer='SIFTFlowSegDataLayer', ntop=3, + param_str=str(dict(siftflow_dir='../data/sift-flow', + split=split, seed=1337))) + + # the base net + n.conv1_1, n.relu1_1 = conv_relu(n.data, 64, pad=100) + n.conv1_2, n.relu1_2 = conv_relu(n.relu1_1, 64) + n.pool1 = max_pool(n.relu1_2) + + n.conv2_1, n.relu2_1 = conv_relu(n.pool1, 128) + n.conv2_2, n.relu2_2 = conv_relu(n.relu2_1, 128) + n.pool2 = max_pool(n.relu2_2) + + n.conv3_1, n.relu3_1 = conv_relu(n.pool2, 256) + n.conv3_2, n.relu3_2 = conv_relu(n.relu3_1, 256) + n.conv3_3, n.relu3_3 = conv_relu(n.relu3_2, 256) + n.pool3 = max_pool(n.relu3_3) + + n.conv4_1, n.relu4_1 = conv_relu(n.pool3, 512) + n.conv4_2, n.relu4_2 = conv_relu(n.relu4_1, 512) + n.conv4_3, n.relu4_3 = conv_relu(n.relu4_2, 512) + n.pool4 = max_pool(n.relu4_3) + + n.conv5_1, n.relu5_1 = conv_relu(n.pool4, 512) + n.conv5_2, n.relu5_2 = conv_relu(n.relu5_1, 512) + n.conv5_3, n.relu5_3 = conv_relu(n.relu5_2, 512) + n.pool5 = max_pool(n.relu5_3) + + # fully conv + n.fc6, n.relu6 = conv_relu(n.pool5, 4096, ks=7, pad=0) + n.drop6 = L.Dropout(n.relu6, dropout_ratio=0.5, in_place=True) + n.fc7, n.relu7 = conv_relu(n.drop6, 4096, ks=1, pad=0) + n.drop7 = L.Dropout(n.relu7, dropout_ratio=0.5, in_place=True) + + n.score_fr_sem = L.Convolution(n.drop7, num_output=33, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + n.upscore2_sem = L.Deconvolution(n.score_fr_sem, + convolution_param=dict(num_output=33, kernel_size=4, stride=2, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_pool4_sem = L.Convolution(n.pool4, num_output=33, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + n.score_pool4_semc = crop(n.score_pool4_sem, n.upscore2_sem) + n.fuse_pool4_sem = L.Eltwise(n.upscore2_sem, n.score_pool4_semc, + operation=P.Eltwise.SUM) + n.upscore_pool4_sem = L.Deconvolution(n.fuse_pool4_sem, + convolution_param=dict(num_output=33, kernel_size=4, stride=2, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_pool3_sem = L.Convolution(n.pool3, num_output=33, kernel_size=1, + pad=0, param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, + decay_mult=0)]) + n.score_pool3_semc = crop(n.score_pool3_sem, n.upscore_pool4_sem) + n.fuse_pool3_sem = L.Eltwise(n.upscore_pool4_sem, n.score_pool3_semc, + operation=P.Eltwise.SUM) + n.upscore8_sem = L.Deconvolution(n.fuse_pool3_sem, + convolution_param=dict(num_output=33, kernel_size=16, stride=8, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_sem = crop(n.upscore8_sem, n.data) + # loss to make score happy (o.w. loss_sem) + n.loss = L.SoftmaxWithLoss(n.score_sem, n.sem, + loss_param=dict(normalize=False, ignore_label=255)) + + n.score_fr_geo = L.Convolution(n.drop7, num_output=3, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + + n.upscore2_geo = L.Deconvolution(n.score_fr_geo, + convolution_param=dict(num_output=3, kernel_size=4, stride=2, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_pool4_geo = L.Convolution(n.pool4, num_output=3, kernel_size=1, pad=0, + param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) + n.score_pool4_geoc = crop(n.score_pool4_geo, n.upscore2_geo) + n.fuse_pool4_geo = L.Eltwise(n.upscore2_geo, n.score_pool4_geoc, + operation=P.Eltwise.SUM) + n.upscore_pool4_geo = L.Deconvolution(n.fuse_pool4_geo, + convolution_param=dict(num_output=3, kernel_size=4, stride=2, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_pool3_geo = L.Convolution(n.pool3, num_output=3, kernel_size=1, + pad=0, param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, + decay_mult=0)]) + n.score_pool3_geoc = crop(n.score_pool3_geo, n.upscore_pool4_geo) + n.fuse_pool3_geo = L.Eltwise(n.upscore_pool4_geo, n.score_pool3_geoc, + operation=P.Eltwise.SUM) + n.upscore8_geo = L.Deconvolution(n.fuse_pool3_geo, + convolution_param=dict(num_output=3, kernel_size=16, stride=8, + bias_term=False), + param=[dict(lr_mult=0)]) + + n.score_geo = crop(n.upscore8_geo, n.data) + n.loss_geo = L.SoftmaxWithLoss(n.score_geo, n.geo, + loss_param=dict(normalize=False, ignore_label=255)) + + return n.to_proto() + +def make_net(): + with open('trainval.prototxt', 'w') as f: + f.write(str(fcn('trainval'))) + + with open('test.prototxt', 'w') as f: + f.write(str(fcn('test'))) + +if __name__ == '__main__': + make_net() diff --git a/siftflow-fcn8s/solve.py b/siftflow-fcn8s/solve.py new file mode 100644 index 0000000000000000000000000000000000000000..8de67e14e080faae4d75f3a856058a6ded2e8f5d --- /dev/null +++ b/siftflow-fcn8s/solve.py @@ -0,0 +1,31 @@ +import caffe +import surgery, score + +import numpy as np +import os + +import setproctitle +setproctitle.setproctitle(os.path.basename(os.getcwd())) + +weights = '../siftflow-fcn16s/siftflow-fcn16s.caffemodel' + +# init +caffe.set_device(int(sys.argv[1])) +caffe.set_mode_gpu() + +solver = caffe.SGDSolver('solver.prototxt') +solver.net.copy_from(weights) + +# surgeries +interp_layers = [k for k in solver.net.params.keys() if 'up' in k] +surgery.interp(solver.net, interp_layers) + +# scoring +test = np.loadtxt('../data/sift-flow/test.txt', dtype=str) + +for _ in range(50): + solver.step(2000) + # N.B. metrics on the semantic labels are off b.c. of missing classes; + # score manually from the histogram instead for proper evaluation + score.seg_tests(solver, False, test, layer='score_sem', gt='sem') + score.seg_tests(solver, False, test, layer='score_geo', gt='geo') diff --git a/siftflow-fcn8s/solver.prototxt b/siftflow-fcn8s/solver.prototxt new file mode 100644 index 0000000000000000000000000000000000000000..09aff3378dca8db28fc768884e919edc345f9126 --- /dev/null +++ b/siftflow-fcn8s/solver.prototxt @@ -0,0 +1,17 @@ +train_net: "trainval.prototxt" +test_net: "test.prototxt" +test_iter: 1111 +# make test net, but don't invoke it from the solver itself +test_interval: 999999999 +display: 20 +average_loss: 20 +lr_policy: "fixed" +# lr for unnormalized softmax +base_lr: 1e-12 +# high momentum +momentum: 0.99 +# no gradient accumulation +iter_size: 1 +max_iter: 300000 +weight_decay: 0.0005 +test_initialization: false diff --git a/siftflow-fcn8s/test.prototxt b/siftflow-fcn8s/test.prototxt new file mode 100644 index 0000000000000000000000000000000000000000..d9acc78c587ac3302f471923e98ae6718ed7cabe --- /dev/null +++ b/siftflow-fcn8s/test.prototxt @@ -0,0 +1,807 @@ +layer { + name: "data" + type: "Python" + top: "data" + top: "sem" + top: "geo" + python_param { + module: "siftflow_layers" + layer: "SIFTFlowSegDataLayer" + param_str: "{\'siftflow_dir\': \'../../data/sift-flow\', \'seed\': 1337, \'split\': \'test\'}" + } +} +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 100 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_1" + type: "ReLU" + bottom: "conv1_1" + top: "conv1_1" +} +layer { + name: "conv1_2" + type: "Convolution" + bottom: "conv1_1" + top: "conv1_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_2" + type: "ReLU" + bottom: "conv1_2" + top: "conv1_2" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1_2" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv2_1" + type: "Convolution" + bottom: "pool1" + top: "conv2_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_1" + type: "ReLU" + bottom: "conv2_1" + top: "conv2_1" +} +layer { + name: "conv2_2" + type: "Convolution" + bottom: "conv2_1" + top: "conv2_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_2" + type: "ReLU" + bottom: "conv2_2" + top: "conv2_2" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "conv2_2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv3_1" + type: "Convolution" + bottom: "pool2" + top: "conv3_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_1" + type: "ReLU" + bottom: "conv3_1" + top: "conv3_1" +} +layer { + name: "conv3_2" + type: "Convolution" + bottom: "conv3_1" + top: "conv3_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_2" + type: "ReLU" + bottom: "conv3_2" + top: "conv3_2" +} +layer { + name: "conv3_3" + type: "Convolution" + bottom: "conv3_2" + top: "conv3_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_3" + type: "ReLU" + bottom: "conv3_3" + top: "conv3_3" +} +layer { + name: "pool3" + type: "Pooling" + bottom: "conv3_3" + top: "pool3" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv4_1" + type: "Convolution" + bottom: "pool3" + top: "conv4_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_1" + type: "ReLU" + bottom: "conv4_1" + top: "conv4_1" +} +layer { + name: "conv4_2" + type: "Convolution" + bottom: "conv4_1" + top: "conv4_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_2" + type: "ReLU" + bottom: "conv4_2" + top: "conv4_2" +} +layer { + name: "conv4_3" + type: "Convolution" + bottom: "conv4_2" + top: "conv4_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_3" + type: "ReLU" + bottom: "conv4_3" + top: "conv4_3" +} +layer { + name: "pool4" + type: "Pooling" + bottom: "conv4_3" + top: "pool4" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv5_1" + type: "Convolution" + bottom: "pool4" + top: "conv5_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_1" + type: "ReLU" + bottom: "conv5_1" + top: "conv5_1" +} +layer { + name: "conv5_2" + type: "Convolution" + bottom: "conv5_1" + top: "conv5_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_2" + type: "ReLU" + bottom: "conv5_2" + top: "conv5_2" +} +layer { + name: "conv5_3" + type: "Convolution" + bottom: "conv5_2" + top: "conv5_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_3" + type: "ReLU" + bottom: "conv5_3" + top: "conv5_3" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5_3" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "fc6" + type: "Convolution" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 7 + stride: 1 + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "drop6" + type: "Dropout" + bottom: "fc6" + top: "fc6" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc7" + type: "Convolution" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 1 + stride: 1 + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "drop7" + type: "Dropout" + bottom: "fc7" + top: "fc7" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "score_fr_sem" + type: "Convolution" + bottom: "fc7" + top: "score_fr_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore2_sem" + type: "Deconvolution" + bottom: "score_fr_sem" + top: "upscore2_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool4_sem" + type: "Convolution" + bottom: "pool4" + top: "score_pool4_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool4_semc" + type: "Crop" + bottom: "score_pool4_sem" + bottom: "upscore2_sem" + top: "score_pool4_semc" + crop_param { + axis: 2 + offset: 5 + } +} +layer { + name: "fuse_pool4_sem" + type: "Eltwise" + bottom: "upscore2_sem" + bottom: "score_pool4_semc" + top: "fuse_pool4_sem" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore_pool4_sem" + type: "Deconvolution" + bottom: "fuse_pool4_sem" + top: "upscore_pool4_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool3_sem" + type: "Convolution" + bottom: "pool3" + top: "score_pool3_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool3_semc" + type: "Crop" + bottom: "score_pool3_sem" + bottom: "upscore_pool4_sem" + top: "score_pool3_semc" + crop_param { + axis: 2 + offset: 9 + } +} +layer { + name: "fuse_pool3_sem" + type: "Eltwise" + bottom: "upscore_pool4_sem" + bottom: "score_pool3_semc" + top: "fuse_pool3_sem" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore8_sem" + type: "Deconvolution" + bottom: "fuse_pool3_sem" + top: "upscore8_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 16 + stride: 8 + } +} +layer { + name: "score_sem" + type: "Crop" + bottom: "upscore8_sem" + bottom: "data" + top: "score_sem" + crop_param { + axis: 2 + offset: 31 + } +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "score_sem" + bottom: "sem" + top: "loss" + loss_param { + ignore_label: 255 + normalize: false + } +} +layer { + name: "score_fr_geo" + type: "Convolution" + bottom: "fc7" + top: "score_fr_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore2_geo" + type: "Deconvolution" + bottom: "score_fr_geo" + top: "upscore2_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool4_geo" + type: "Convolution" + bottom: "pool4" + top: "score_pool4_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool4_geoc" + type: "Crop" + bottom: "score_pool4_geo" + bottom: "upscore2_geo" + top: "score_pool4_geoc" + crop_param { + axis: 2 + offset: 5 + } +} +layer { + name: "fuse_pool4_geo" + type: "Eltwise" + bottom: "upscore2_geo" + bottom: "score_pool4_geoc" + top: "fuse_pool4_geo" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore_pool4_geo" + type: "Deconvolution" + bottom: "fuse_pool4_geo" + top: "upscore_pool4_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool3_geo" + type: "Convolution" + bottom: "pool3" + top: "score_pool3_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool3_geoc" + type: "Crop" + bottom: "score_pool3_geo" + bottom: "upscore_pool4_geo" + top: "score_pool3_geoc" + crop_param { + axis: 2 + offset: 9 + } +} +layer { + name: "fuse_pool3_geo" + type: "Eltwise" + bottom: "upscore_pool4_geo" + bottom: "score_pool3_geoc" + top: "fuse_pool3_geo" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore8_geo" + type: "Deconvolution" + bottom: "fuse_pool3_geo" + top: "upscore8_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 16 + stride: 8 + } +} +layer { + name: "score_geo" + type: "Crop" + bottom: "upscore8_geo" + bottom: "data" + top: "score_geo" + crop_param { + axis: 2 + offset: 31 + } +} +layer { + name: "loss_geo" + type: "SoftmaxWithLoss" + bottom: "score_geo" + bottom: "geo" + top: "loss_geo" + loss_param { + ignore_label: 255 + normalize: false + } +} diff --git a/siftflow-fcn8s/trainval.prototxt b/siftflow-fcn8s/trainval.prototxt new file mode 100644 index 0000000000000000000000000000000000000000..73479cb4b85dded7d08a8754334e8b54cd45ac87 --- /dev/null +++ b/siftflow-fcn8s/trainval.prototxt @@ -0,0 +1,807 @@ +layer { + name: "data" + type: "Python" + top: "data" + top: "sem" + top: "geo" + python_param { + module: "siftflow_layers" + layer: "SIFTFlowSegDataLayer" + param_str: "{\'siftflow_dir\': \'../../data/sift-flow\', \'seed\': 1337, \'split\': \'trainval\'}" + } +} +layer { + name: "conv1_1" + type: "Convolution" + bottom: "data" + top: "conv1_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 100 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_1" + type: "ReLU" + bottom: "conv1_1" + top: "conv1_1" +} +layer { + name: "conv1_2" + type: "Convolution" + bottom: "conv1_1" + top: "conv1_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 64 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu1_2" + type: "ReLU" + bottom: "conv1_2" + top: "conv1_2" +} +layer { + name: "pool1" + type: "Pooling" + bottom: "conv1_2" + top: "pool1" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv2_1" + type: "Convolution" + bottom: "pool1" + top: "conv2_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_1" + type: "ReLU" + bottom: "conv2_1" + top: "conv2_1" +} +layer { + name: "conv2_2" + type: "Convolution" + bottom: "conv2_1" + top: "conv2_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 128 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu2_2" + type: "ReLU" + bottom: "conv2_2" + top: "conv2_2" +} +layer { + name: "pool2" + type: "Pooling" + bottom: "conv2_2" + top: "pool2" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv3_1" + type: "Convolution" + bottom: "pool2" + top: "conv3_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_1" + type: "ReLU" + bottom: "conv3_1" + top: "conv3_1" +} +layer { + name: "conv3_2" + type: "Convolution" + bottom: "conv3_1" + top: "conv3_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_2" + type: "ReLU" + bottom: "conv3_2" + top: "conv3_2" +} +layer { + name: "conv3_3" + type: "Convolution" + bottom: "conv3_2" + top: "conv3_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 256 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu3_3" + type: "ReLU" + bottom: "conv3_3" + top: "conv3_3" +} +layer { + name: "pool3" + type: "Pooling" + bottom: "conv3_3" + top: "pool3" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv4_1" + type: "Convolution" + bottom: "pool3" + top: "conv4_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_1" + type: "ReLU" + bottom: "conv4_1" + top: "conv4_1" +} +layer { + name: "conv4_2" + type: "Convolution" + bottom: "conv4_1" + top: "conv4_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_2" + type: "ReLU" + bottom: "conv4_2" + top: "conv4_2" +} +layer { + name: "conv4_3" + type: "Convolution" + bottom: "conv4_2" + top: "conv4_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu4_3" + type: "ReLU" + bottom: "conv4_3" + top: "conv4_3" +} +layer { + name: "pool4" + type: "Pooling" + bottom: "conv4_3" + top: "pool4" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "conv5_1" + type: "Convolution" + bottom: "pool4" + top: "conv5_1" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_1" + type: "ReLU" + bottom: "conv5_1" + top: "conv5_1" +} +layer { + name: "conv5_2" + type: "Convolution" + bottom: "conv5_1" + top: "conv5_2" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_2" + type: "ReLU" + bottom: "conv5_2" + top: "conv5_2" +} +layer { + name: "conv5_3" + type: "Convolution" + bottom: "conv5_2" + top: "conv5_3" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 512 + pad: 1 + kernel_size: 3 + stride: 1 + } +} +layer { + name: "relu5_3" + type: "ReLU" + bottom: "conv5_3" + top: "conv5_3" +} +layer { + name: "pool5" + type: "Pooling" + bottom: "conv5_3" + top: "pool5" + pooling_param { + pool: MAX + kernel_size: 2 + stride: 2 + } +} +layer { + name: "fc6" + type: "Convolution" + bottom: "pool5" + top: "fc6" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 7 + stride: 1 + } +} +layer { + name: "relu6" + type: "ReLU" + bottom: "fc6" + top: "fc6" +} +layer { + name: "drop6" + type: "Dropout" + bottom: "fc6" + top: "fc6" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "fc7" + type: "Convolution" + bottom: "fc6" + top: "fc7" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 4096 + pad: 0 + kernel_size: 1 + stride: 1 + } +} +layer { + name: "relu7" + type: "ReLU" + bottom: "fc7" + top: "fc7" +} +layer { + name: "drop7" + type: "Dropout" + bottom: "fc7" + top: "fc7" + dropout_param { + dropout_ratio: 0.5 + } +} +layer { + name: "score_fr_sem" + type: "Convolution" + bottom: "fc7" + top: "score_fr_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore2_sem" + type: "Deconvolution" + bottom: "score_fr_sem" + top: "upscore2_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool4_sem" + type: "Convolution" + bottom: "pool4" + top: "score_pool4_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool4_semc" + type: "Crop" + bottom: "score_pool4_sem" + bottom: "upscore2_sem" + top: "score_pool4_semc" + crop_param { + axis: 2 + offset: 5 + } +} +layer { + name: "fuse_pool4_sem" + type: "Eltwise" + bottom: "upscore2_sem" + bottom: "score_pool4_semc" + top: "fuse_pool4_sem" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore_pool4_sem" + type: "Deconvolution" + bottom: "fuse_pool4_sem" + top: "upscore_pool4_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool3_sem" + type: "Convolution" + bottom: "pool3" + top: "score_pool3_sem" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 33 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool3_semc" + type: "Crop" + bottom: "score_pool3_sem" + bottom: "upscore_pool4_sem" + top: "score_pool3_semc" + crop_param { + axis: 2 + offset: 9 + } +} +layer { + name: "fuse_pool3_sem" + type: "Eltwise" + bottom: "upscore_pool4_sem" + bottom: "score_pool3_semc" + top: "fuse_pool3_sem" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore8_sem" + type: "Deconvolution" + bottom: "fuse_pool3_sem" + top: "upscore8_sem" + param { + lr_mult: 0 + } + convolution_param { + num_output: 33 + bias_term: false + kernel_size: 16 + stride: 8 + } +} +layer { + name: "score_sem" + type: "Crop" + bottom: "upscore8_sem" + bottom: "data" + top: "score_sem" + crop_param { + axis: 2 + offset: 31 + } +} +layer { + name: "loss" + type: "SoftmaxWithLoss" + bottom: "score_sem" + bottom: "sem" + top: "loss" + loss_param { + ignore_label: 255 + normalize: false + } +} +layer { + name: "score_fr_geo" + type: "Convolution" + bottom: "fc7" + top: "score_fr_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "upscore2_geo" + type: "Deconvolution" + bottom: "score_fr_geo" + top: "upscore2_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool4_geo" + type: "Convolution" + bottom: "pool4" + top: "score_pool4_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool4_geoc" + type: "Crop" + bottom: "score_pool4_geo" + bottom: "upscore2_geo" + top: "score_pool4_geoc" + crop_param { + axis: 2 + offset: 5 + } +} +layer { + name: "fuse_pool4_geo" + type: "Eltwise" + bottom: "upscore2_geo" + bottom: "score_pool4_geoc" + top: "fuse_pool4_geo" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore_pool4_geo" + type: "Deconvolution" + bottom: "fuse_pool4_geo" + top: "upscore_pool4_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 4 + stride: 2 + } +} +layer { + name: "score_pool3_geo" + type: "Convolution" + bottom: "pool3" + top: "score_pool3_geo" + param { + lr_mult: 1 + decay_mult: 1 + } + param { + lr_mult: 2 + decay_mult: 0 + } + convolution_param { + num_output: 3 + pad: 0 + kernel_size: 1 + } +} +layer { + name: "score_pool3_geoc" + type: "Crop" + bottom: "score_pool3_geo" + bottom: "upscore_pool4_geo" + top: "score_pool3_geoc" + crop_param { + axis: 2 + offset: 9 + } +} +layer { + name: "fuse_pool3_geo" + type: "Eltwise" + bottom: "upscore_pool4_geo" + bottom: "score_pool3_geoc" + top: "fuse_pool3_geo" + eltwise_param { + operation: SUM + } +} +layer { + name: "upscore8_geo" + type: "Deconvolution" + bottom: "fuse_pool3_geo" + top: "upscore8_geo" + param { + lr_mult: 0 + } + convolution_param { + num_output: 3 + bias_term: false + kernel_size: 16 + stride: 8 + } +} +layer { + name: "score_geo" + type: "Crop" + bottom: "upscore8_geo" + bottom: "data" + top: "score_geo" + crop_param { + axis: 2 + offset: 31 + } +} +layer { + name: "loss_geo" + type: "SoftmaxWithLoss" + bottom: "score_geo" + bottom: "geo" + top: "loss_geo" + loss_param { + ignore_label: 255 + normalize: false + } +} diff --git a/siftflow_layers.py b/siftflow_layers.py new file mode 100644 index 0000000000000000000000000000000000000000..5f7c60f12f42f3c367ed4443d4f6f29504dfe616 --- /dev/null +++ b/siftflow_layers.py @@ -0,0 +1,122 @@ +import caffe + +import numpy as np +from PIL import Image +import scipy.io + +import random + +class SIFTFlowSegDataLayer(caffe.Layer): + """ + Load (input image, label image) pairs from SIFT Flow + one-at-a-time while reshaping the net to preserve dimensions. + + This data layer has three tops: + + 1. the data, pre-processed + 2. the semantic labels 0-32 and void 255 + 3. the geometric labels 0-2 and void 255 + + Use this to feed data to a fully convolutional network. + """ + + def setup(self, bottom, top): + """ + Setup data layer according to parameters: + + - siftflow_dir: path to SIFT Flow dir + - split: train / val / test + - randomize: load in random order (default: True) + - seed: seed for randomization (default: None / current time) + + for semantic segmentation of object and geometric classes. + + example: params = dict(siftflow_dir="/path/to/siftflow", split="val") + """ + # config + params = eval(self.param_str) + self.siftflow_dir = params['siftflow_dir'] + self.split = params['split'] + self.mean = np.array((114.578, 115.294, 108.353), dtype=np.float32) + self.random = params.get('randomize', True) + self.seed = params.get('seed', None) + + # three tops: data, semantic, geometric + if len(top) != 3: + raise Exception("Need to define three tops: data, semantic label, and geometric label.") + # data layers have no bottoms + if len(bottom) != 0: + raise Exception("Do not define a bottom.") + + # load indices for images and labels + split_f = '{}/{}.txt'.format(self.siftflow_dir, self.split) + self.indices = open(split_f, 'r').read().splitlines() + self.idx = 0 + + # make eval deterministic + if 'train' not in self.split: + self.random = False + + # randomization: seed and pick + if self.random: + random.seed(self.seed) + self.idx = random.randint(0, len(self.indices)-1) + + def reshape(self, bottom, top): + # load image + label image pair + self.data = self.load_image(self.indices[self.idx]) + self.label_semantic = self.load_label(self.indices[self.idx], label_type='semantic') + self.label_geometric = self.load_label(self.indices[self.idx], label_type='geometric') + # reshape tops to fit (leading 1 is for batch dimension) + top[0].reshape(1, *self.data.shape) + top[1].reshape(1, *self.label_semantic.shape) + top[2].reshape(1, *self.label_geometric.shape) + + def forward(self, bottom, top): + # assign output + top[0].data[...] = self.data + top[1].data[...] = self.label_semantic + top[2].data[...] = self.label_geometric + + # pick next input + if self.random: + self.idx = random.randint(0, len(self.indices)-1) + else: + self.idx += 1 + if self.idx == len(self.indices): + self.idx = 0 + + def backward(self, top, propagate_down, bottom): + pass + + def load_image(self, idx): + """ + Load input image and preprocess for Caffe: + - cast to float + - switch channels RGB -> BGR + - subtract mean + - transpose to channel x height x width order + """ + im = Image.open('{}/Images/spatial_envelope_256x256_static_8outdoorcategories/{}.jpg'.format(self.siftflow_dir, idx)) + in_ = np.array(im, dtype=np.float32) + in_ = in_[:,:,::-1] + in_ -= self.mean + in_ = in_.transpose((2,0,1)) + return in_ + + def load_label(self, idx, label_type=None): + """ + Load label image as 1 x height x width integer array of label indices. + The leading singleton dimension is required by the loss. + """ + if label_type == 'semantic': + label = scipy.io.loadmat('{}/SemanticLabels/spatial_envelope_256x256_static_8outdoorcategories/{}.mat'.format(self.siftflow_dir, idx))['S'] + elif label_type == 'geometric': + label = scipy.io.loadmat('{}/GeoLabels/spatial_envelope_256x256_static_8outdoorcategories/{}.mat'.format(self.siftflow_dir, idx))['S'] + label[label == -1] = 0 + else: + raise Exception("Unknown label type: {}. Pick semantic or geometric.".format(label_type)) + label = label.astype(np.uint8) + label -= 1 # rotate labels so classes start at 0, void is 255 + label = label[np.newaxis, ...] + return label.copy()