diff --git a/.gitignore b/.gitignore index 8af3d42a..933e5ebc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *~ *.pyc .DS_Store -DRIVE_datasets_training_testing \ No newline at end of file +DRIVE_datasets_training_testing diff --git a/DRIVE/test/1st_manual/01_manual1.gif b/DRIVE/test/1st_manual/01_manual1.gif new file mode 100644 index 00000000..b176725e Binary files /dev/null and b/DRIVE/test/1st_manual/01_manual1.gif differ diff --git a/DRIVE/test/1st_manual/02_manual1.gif b/DRIVE/test/1st_manual/02_manual1.gif new file mode 100644 index 00000000..6184f53e Binary files /dev/null and b/DRIVE/test/1st_manual/02_manual1.gif differ diff --git a/DRIVE/test/1st_manual/03_manual1.gif b/DRIVE/test/1st_manual/03_manual1.gif new file mode 100644 index 00000000..74a1b50e Binary files /dev/null and b/DRIVE/test/1st_manual/03_manual1.gif differ diff --git a/DRIVE/test/1st_manual/04_manual1.gif b/DRIVE/test/1st_manual/04_manual1.gif new file mode 100644 index 00000000..1c9e9c1d Binary files /dev/null and b/DRIVE/test/1st_manual/04_manual1.gif differ diff --git a/DRIVE/test/1st_manual/05_manual1.gif b/DRIVE/test/1st_manual/05_manual1.gif new file mode 100644 index 00000000..6f101462 Binary files /dev/null and b/DRIVE/test/1st_manual/05_manual1.gif differ diff --git a/DRIVE/test/1st_manual/06_manual1.gif b/DRIVE/test/1st_manual/06_manual1.gif new file mode 100644 index 00000000..ffdfec01 Binary files /dev/null and b/DRIVE/test/1st_manual/06_manual1.gif differ diff --git a/DRIVE/test/1st_manual/07_manual1.gif b/DRIVE/test/1st_manual/07_manual1.gif new file mode 100644 index 00000000..9199db81 Binary files /dev/null and b/DRIVE/test/1st_manual/07_manual1.gif differ diff --git a/DRIVE/test/1st_manual/08_manual1.gif b/DRIVE/test/1st_manual/08_manual1.gif new file mode 100644 index 00000000..86275de8 Binary files /dev/null and b/DRIVE/test/1st_manual/08_manual1.gif differ diff --git a/DRIVE/test/1st_manual/09_manual1.gif b/DRIVE/test/1st_manual/09_manual1.gif new file mode 100644 index 00000000..a5c9ec00 Binary files /dev/null and b/DRIVE/test/1st_manual/09_manual1.gif differ diff --git a/DRIVE/test/1st_manual/10_manual1.gif b/DRIVE/test/1st_manual/10_manual1.gif new file mode 100644 index 00000000..da252254 Binary files /dev/null and b/DRIVE/test/1st_manual/10_manual1.gif differ diff --git a/DRIVE/test/1st_manual/11_manual1.gif b/DRIVE/test/1st_manual/11_manual1.gif new file mode 100644 index 00000000..240f9fc6 Binary files /dev/null and b/DRIVE/test/1st_manual/11_manual1.gif differ diff --git a/DRIVE/test/1st_manual/12_manual1.gif b/DRIVE/test/1st_manual/12_manual1.gif new file mode 100644 index 00000000..58f3c7ff Binary files /dev/null and b/DRIVE/test/1st_manual/12_manual1.gif differ diff --git a/DRIVE/test/1st_manual/13_manual1.gif b/DRIVE/test/1st_manual/13_manual1.gif new file mode 100644 index 00000000..856d78b2 Binary files /dev/null and b/DRIVE/test/1st_manual/13_manual1.gif differ diff --git a/DRIVE/test/1st_manual/14_manual1.gif b/DRIVE/test/1st_manual/14_manual1.gif new file mode 100644 index 00000000..f9aabcef Binary files /dev/null and b/DRIVE/test/1st_manual/14_manual1.gif differ diff --git a/DRIVE/test/1st_manual/15_manual1.gif b/DRIVE/test/1st_manual/15_manual1.gif new file mode 100644 index 00000000..f3d28925 Binary files /dev/null and b/DRIVE/test/1st_manual/15_manual1.gif differ diff --git a/DRIVE/test/1st_manual/16_manual1.gif b/DRIVE/test/1st_manual/16_manual1.gif new file mode 100644 index 00000000..1573b9b2 Binary files /dev/null and b/DRIVE/test/1st_manual/16_manual1.gif differ diff --git a/DRIVE/test/1st_manual/17_manual1.gif b/DRIVE/test/1st_manual/17_manual1.gif new file mode 100644 index 00000000..1c87c56f Binary files /dev/null and b/DRIVE/test/1st_manual/17_manual1.gif differ diff --git a/DRIVE/test/1st_manual/18_manual1.gif b/DRIVE/test/1st_manual/18_manual1.gif new file mode 100644 index 00000000..b82cd323 Binary files /dev/null and b/DRIVE/test/1st_manual/18_manual1.gif differ diff --git a/DRIVE/test/1st_manual/19_manual1.gif b/DRIVE/test/1st_manual/19_manual1.gif new file mode 100644 index 00000000..4c535bfa Binary files /dev/null and b/DRIVE/test/1st_manual/19_manual1.gif differ diff --git a/DRIVE/test/1st_manual/20_manual1.gif b/DRIVE/test/1st_manual/20_manual1.gif new file mode 100644 index 00000000..c53e4a1a Binary files /dev/null and b/DRIVE/test/1st_manual/20_manual1.gif differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(1).jpg b/DRIVE/test/1st_manual/jpg format/vessel(1).jpg new file mode 100644 index 00000000..14590234 Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(1).jpg differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(10).jpg b/DRIVE/test/1st_manual/jpg format/vessel(10).jpg new file mode 100644 index 00000000..c57c8796 Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(10).jpg differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(2).jpg b/DRIVE/test/1st_manual/jpg format/vessel(2).jpg new file mode 100644 index 00000000..02ba019f Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(2).jpg differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(3).jpg b/DRIVE/test/1st_manual/jpg format/vessel(3).jpg new file mode 100644 index 00000000..51ab5ffe Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(3).jpg differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(4).jpg b/DRIVE/test/1st_manual/jpg format/vessel(4).jpg new file mode 100644 index 00000000..26539b8e Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(4).jpg differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(5).jpg b/DRIVE/test/1st_manual/jpg format/vessel(5).jpg new file mode 100644 index 00000000..a584cfa8 Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(5).jpg differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(6).jpg b/DRIVE/test/1st_manual/jpg format/vessel(6).jpg new file mode 100644 index 00000000..c7d1b4d5 Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(6).jpg differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(7).jpg b/DRIVE/test/1st_manual/jpg format/vessel(7).jpg new file mode 100644 index 00000000..11ec4e51 Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(7).jpg differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(8).jpg b/DRIVE/test/1st_manual/jpg format/vessel(8).jpg new file mode 100644 index 00000000..832f1d96 Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(8).jpg differ diff --git a/DRIVE/test/1st_manual/jpg format/vessel(9).jpg b/DRIVE/test/1st_manual/jpg format/vessel(9).jpg new file mode 100644 index 00000000..40e244d2 Binary files /dev/null and b/DRIVE/test/1st_manual/jpg format/vessel(9).jpg differ diff --git a/DRIVE/test/2nd_manual/05_manual2.gif b/DRIVE/test/2nd_manual/05_manual2.gif new file mode 100644 index 00000000..d30255b2 Binary files /dev/null and b/DRIVE/test/2nd_manual/05_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/06_manual2.gif b/DRIVE/test/2nd_manual/06_manual2.gif new file mode 100644 index 00000000..8146dc1a Binary files /dev/null and b/DRIVE/test/2nd_manual/06_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/07_manual2.gif b/DRIVE/test/2nd_manual/07_manual2.gif new file mode 100644 index 00000000..be08c5db Binary files /dev/null and b/DRIVE/test/2nd_manual/07_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/08_manual2.gif b/DRIVE/test/2nd_manual/08_manual2.gif new file mode 100644 index 00000000..d3a7effe Binary files /dev/null and b/DRIVE/test/2nd_manual/08_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/09_manual2.gif b/DRIVE/test/2nd_manual/09_manual2.gif new file mode 100644 index 00000000..e79aead6 Binary files /dev/null and b/DRIVE/test/2nd_manual/09_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/10_manual2.gif b/DRIVE/test/2nd_manual/10_manual2.gif new file mode 100644 index 00000000..d3ae246a Binary files /dev/null and b/DRIVE/test/2nd_manual/10_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/11_manual2.gif b/DRIVE/test/2nd_manual/11_manual2.gif new file mode 100644 index 00000000..f1f4e699 Binary files /dev/null and b/DRIVE/test/2nd_manual/11_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/12_manual2.gif b/DRIVE/test/2nd_manual/12_manual2.gif new file mode 100644 index 00000000..217ad3e1 Binary files /dev/null and b/DRIVE/test/2nd_manual/12_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/13_manual2.gif b/DRIVE/test/2nd_manual/13_manual2.gif new file mode 100644 index 00000000..50fb8e28 Binary files /dev/null and b/DRIVE/test/2nd_manual/13_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/15_manual2.gif b/DRIVE/test/2nd_manual/15_manual2.gif new file mode 100644 index 00000000..5acb5374 Binary files /dev/null and b/DRIVE/test/2nd_manual/15_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/16_manual2.gif b/DRIVE/test/2nd_manual/16_manual2.gif new file mode 100644 index 00000000..91fd9e55 Binary files /dev/null and b/DRIVE/test/2nd_manual/16_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/17_manual2.gif b/DRIVE/test/2nd_manual/17_manual2.gif new file mode 100644 index 00000000..6f5c07c2 Binary files /dev/null and b/DRIVE/test/2nd_manual/17_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/18_manual2.gif b/DRIVE/test/2nd_manual/18_manual2.gif new file mode 100644 index 00000000..43550710 Binary files /dev/null and b/DRIVE/test/2nd_manual/18_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/19_manual2.gif b/DRIVE/test/2nd_manual/19_manual2.gif new file mode 100644 index 00000000..463a7211 Binary files /dev/null and b/DRIVE/test/2nd_manual/19_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/20_manual2.gif b/DRIVE/test/2nd_manual/20_manual2.gif new file mode 100644 index 00000000..887f0298 Binary files /dev/null and b/DRIVE/test/2nd_manual/20_manual2.gif differ diff --git a/DRIVE/test/2nd_manual/vessel(1).gif b/DRIVE/test/2nd_manual/vessel(1).gif new file mode 100644 index 00000000..cbb82407 Binary files /dev/null and b/DRIVE/test/2nd_manual/vessel(1).gif differ diff --git a/DRIVE/test/2nd_manual/vessel(14).gif b/DRIVE/test/2nd_manual/vessel(14).gif new file mode 100644 index 00000000..83f3322b Binary files /dev/null and b/DRIVE/test/2nd_manual/vessel(14).gif differ diff --git a/DRIVE/test/2nd_manual/vessel(2).gif b/DRIVE/test/2nd_manual/vessel(2).gif new file mode 100644 index 00000000..49a899c9 Binary files /dev/null and b/DRIVE/test/2nd_manual/vessel(2).gif differ diff --git a/DRIVE/test/2nd_manual/vessel(3).gif b/DRIVE/test/2nd_manual/vessel(3).gif new file mode 100644 index 00000000..22a38b00 Binary files /dev/null and b/DRIVE/test/2nd_manual/vessel(3).gif differ diff --git a/DRIVE/test/2nd_manual/vessel(4).gif b/DRIVE/test/2nd_manual/vessel(4).gif new file mode 100644 index 00000000..f71e7960 Binary files /dev/null and b/DRIVE/test/2nd_manual/vessel(4).gif differ diff --git a/DRIVE/test/images/01_test.tif b/DRIVE/test/images/01_test.tif new file mode 100644 index 00000000..bd3e2dc1 Binary files /dev/null and b/DRIVE/test/images/01_test.tif differ diff --git a/DRIVE/test/images/02_test.tif b/DRIVE/test/images/02_test.tif new file mode 100644 index 00000000..cfa314da Binary files /dev/null and b/DRIVE/test/images/02_test.tif differ diff --git a/DRIVE/test/images/03_test.tif b/DRIVE/test/images/03_test.tif new file mode 100644 index 00000000..ca7921e1 Binary files /dev/null and b/DRIVE/test/images/03_test.tif differ diff --git a/DRIVE/test/images/04_test.tif b/DRIVE/test/images/04_test.tif new file mode 100644 index 00000000..d604ecbb Binary files /dev/null and b/DRIVE/test/images/04_test.tif differ diff --git a/DRIVE/test/images/05_test.tif b/DRIVE/test/images/05_test.tif new file mode 100644 index 00000000..e9313650 Binary files /dev/null and b/DRIVE/test/images/05_test.tif differ diff --git a/DRIVE/test/images/06_test.tif b/DRIVE/test/images/06_test.tif new file mode 100644 index 00000000..18a0e747 Binary files /dev/null and b/DRIVE/test/images/06_test.tif differ diff --git a/DRIVE/test/images/07_test.tif b/DRIVE/test/images/07_test.tif new file mode 100644 index 00000000..df71d13b Binary files /dev/null and b/DRIVE/test/images/07_test.tif differ diff --git a/DRIVE/test/images/08_test.tif b/DRIVE/test/images/08_test.tif new file mode 100644 index 00000000..e5abb0cd Binary files /dev/null and b/DRIVE/test/images/08_test.tif differ diff --git a/DRIVE/test/images/09_test.tif b/DRIVE/test/images/09_test.tif new file mode 100644 index 00000000..d93dfd54 Binary files /dev/null and b/DRIVE/test/images/09_test.tif differ diff --git a/DRIVE/test/images/10_test.tif b/DRIVE/test/images/10_test.tif new file mode 100644 index 00000000..bc7c0734 Binary files /dev/null and b/DRIVE/test/images/10_test.tif differ diff --git a/DRIVE/test/images/11_test.tif b/DRIVE/test/images/11_test.tif new file mode 100644 index 00000000..874fed58 Binary files /dev/null and b/DRIVE/test/images/11_test.tif differ diff --git a/DRIVE/test/images/12_test.tif b/DRIVE/test/images/12_test.tif new file mode 100644 index 00000000..a8e538f1 Binary files /dev/null and b/DRIVE/test/images/12_test.tif differ diff --git a/DRIVE/test/images/13_test.tif b/DRIVE/test/images/13_test.tif new file mode 100644 index 00000000..0170485f Binary files /dev/null and b/DRIVE/test/images/13_test.tif differ diff --git a/DRIVE/test/images/14_test.tif b/DRIVE/test/images/14_test.tif new file mode 100644 index 00000000..f4b308d9 Binary files /dev/null and b/DRIVE/test/images/14_test.tif differ diff --git a/DRIVE/test/images/15_test.tif b/DRIVE/test/images/15_test.tif new file mode 100644 index 00000000..b784038b Binary files /dev/null and b/DRIVE/test/images/15_test.tif differ diff --git a/DRIVE/test/images/16_test.tif b/DRIVE/test/images/16_test.tif new file mode 100644 index 00000000..ccdd97e7 Binary files /dev/null and b/DRIVE/test/images/16_test.tif differ diff --git a/DRIVE/test/images/17_test.tif b/DRIVE/test/images/17_test.tif new file mode 100644 index 00000000..a4355109 Binary files /dev/null and b/DRIVE/test/images/17_test.tif differ diff --git a/DRIVE/test/images/18_test.tif b/DRIVE/test/images/18_test.tif new file mode 100644 index 00000000..e8d41090 Binary files /dev/null and b/DRIVE/test/images/18_test.tif differ diff --git a/DRIVE/test/images/19_test.tif b/DRIVE/test/images/19_test.tif new file mode 100644 index 00000000..78a56e0c Binary files /dev/null and b/DRIVE/test/images/19_test.tif differ diff --git a/DRIVE/test/images/20_test.tif b/DRIVE/test/images/20_test.tif new file mode 100644 index 00000000..d22597bc Binary files /dev/null and b/DRIVE/test/images/20_test.tif differ diff --git a/DRIVE/test/mask/01_test_mask.gif b/DRIVE/test/mask/01_test_mask.gif new file mode 100644 index 00000000..05013b3e Binary files /dev/null and b/DRIVE/test/mask/01_test_mask.gif differ diff --git a/DRIVE/test/mask/02_test_mask.gif b/DRIVE/test/mask/02_test_mask.gif new file mode 100644 index 00000000..10c018a3 Binary files /dev/null and b/DRIVE/test/mask/02_test_mask.gif differ diff --git a/DRIVE/test/mask/03_test_mask.gif b/DRIVE/test/mask/03_test_mask.gif new file mode 100644 index 00000000..ba3889d8 Binary files /dev/null and b/DRIVE/test/mask/03_test_mask.gif differ diff --git a/DRIVE/test/mask/04_test_mask.gif b/DRIVE/test/mask/04_test_mask.gif new file mode 100644 index 00000000..2d26ccfb Binary files /dev/null and b/DRIVE/test/mask/04_test_mask.gif differ diff --git a/DRIVE/test/mask/05_test_mask.gif b/DRIVE/test/mask/05_test_mask.gif new file mode 100644 index 00000000..85665e1c Binary files /dev/null and b/DRIVE/test/mask/05_test_mask.gif differ diff --git a/DRIVE/test/mask/06_test_mask.gif b/DRIVE/test/mask/06_test_mask.gif new file mode 100644 index 00000000..9bf1e439 Binary files /dev/null and b/DRIVE/test/mask/06_test_mask.gif differ diff --git a/DRIVE/test/mask/07_test_mask.gif b/DRIVE/test/mask/07_test_mask.gif new file mode 100644 index 00000000..9f3a95cb Binary files /dev/null and b/DRIVE/test/mask/07_test_mask.gif differ diff --git a/DRIVE/test/mask/08_test_mask.gif b/DRIVE/test/mask/08_test_mask.gif new file mode 100644 index 00000000..a54babbe Binary files /dev/null and b/DRIVE/test/mask/08_test_mask.gif differ diff --git a/DRIVE/test/mask/09_test_mask.gif b/DRIVE/test/mask/09_test_mask.gif new file mode 100644 index 00000000..f915c447 Binary files /dev/null and b/DRIVE/test/mask/09_test_mask.gif differ diff --git a/DRIVE/test/mask/10_test_mask.gif b/DRIVE/test/mask/10_test_mask.gif new file mode 100644 index 00000000..e12f5bf7 Binary files /dev/null and b/DRIVE/test/mask/10_test_mask.gif differ diff --git a/DRIVE/test/mask/11_test_mask.gif b/DRIVE/test/mask/11_test_mask.gif new file mode 100644 index 00000000..22ba1cb5 Binary files /dev/null and b/DRIVE/test/mask/11_test_mask.gif differ diff --git a/DRIVE/test/mask/12_test_mask.gif b/DRIVE/test/mask/12_test_mask.gif new file mode 100644 index 00000000..94a0c465 Binary files /dev/null and b/DRIVE/test/mask/12_test_mask.gif differ diff --git a/DRIVE/test/mask/13_test_mask.gif b/DRIVE/test/mask/13_test_mask.gif new file mode 100644 index 00000000..00052fe7 Binary files /dev/null and b/DRIVE/test/mask/13_test_mask.gif differ diff --git a/DRIVE/test/mask/14_test_mask.gif b/DRIVE/test/mask/14_test_mask.gif new file mode 100644 index 00000000..72ebd926 Binary files /dev/null and b/DRIVE/test/mask/14_test_mask.gif differ diff --git a/DRIVE/test/mask/15_test_mask.gif b/DRIVE/test/mask/15_test_mask.gif new file mode 100644 index 00000000..bd8172ac Binary files /dev/null and b/DRIVE/test/mask/15_test_mask.gif differ diff --git a/DRIVE/test/mask/16_test_mask.gif b/DRIVE/test/mask/16_test_mask.gif new file mode 100644 index 00000000..8424b709 Binary files /dev/null and b/DRIVE/test/mask/16_test_mask.gif differ diff --git a/DRIVE/test/mask/17_test_mask.gif b/DRIVE/test/mask/17_test_mask.gif new file mode 100644 index 00000000..0d516027 Binary files /dev/null and b/DRIVE/test/mask/17_test_mask.gif differ diff --git a/DRIVE/test/mask/18_test_mask.gif b/DRIVE/test/mask/18_test_mask.gif new file mode 100644 index 00000000..03ee4a79 Binary files /dev/null and b/DRIVE/test/mask/18_test_mask.gif differ diff --git a/DRIVE/test/mask/19_test_mask.gif b/DRIVE/test/mask/19_test_mask.gif new file mode 100644 index 00000000..d4238326 Binary files /dev/null and b/DRIVE/test/mask/19_test_mask.gif differ diff --git a/DRIVE/test/mask/20_test_mask.gif b/DRIVE/test/mask/20_test_mask.gif new file mode 100644 index 00000000..cbd02fb3 Binary files /dev/null and b/DRIVE/test/mask/20_test_mask.gif differ diff --git a/DRIVE/training/1st_manual/21_manual1.gif b/DRIVE/training/1st_manual/21_manual1.gif new file mode 100644 index 00000000..0997889e Binary files /dev/null and b/DRIVE/training/1st_manual/21_manual1.gif differ diff --git a/DRIVE/training/1st_manual/22_manual1.gif b/DRIVE/training/1st_manual/22_manual1.gif new file mode 100644 index 00000000..1ae17d6e Binary files /dev/null and b/DRIVE/training/1st_manual/22_manual1.gif differ diff --git a/DRIVE/training/1st_manual/23_manual1.gif b/DRIVE/training/1st_manual/23_manual1.gif new file mode 100644 index 00000000..247b1f05 Binary files /dev/null and b/DRIVE/training/1st_manual/23_manual1.gif differ diff --git a/DRIVE/training/1st_manual/24_manual1.gif b/DRIVE/training/1st_manual/24_manual1.gif new file mode 100644 index 00000000..bd4e4b10 Binary files /dev/null and b/DRIVE/training/1st_manual/24_manual1.gif differ diff --git a/DRIVE/training/1st_manual/25_manual1.gif b/DRIVE/training/1st_manual/25_manual1.gif new file mode 100644 index 00000000..d8077652 Binary files /dev/null and b/DRIVE/training/1st_manual/25_manual1.gif differ diff --git a/DRIVE/training/1st_manual/26_manual1.gif b/DRIVE/training/1st_manual/26_manual1.gif new file mode 100644 index 00000000..ceea66c4 Binary files /dev/null and b/DRIVE/training/1st_manual/26_manual1.gif differ diff --git a/DRIVE/training/1st_manual/27_manual1.gif b/DRIVE/training/1st_manual/27_manual1.gif new file mode 100644 index 00000000..036fd197 Binary files /dev/null and b/DRIVE/training/1st_manual/27_manual1.gif differ diff --git a/DRIVE/training/1st_manual/28_manual1.gif b/DRIVE/training/1st_manual/28_manual1.gif new file mode 100644 index 00000000..fa297a82 Binary files /dev/null and b/DRIVE/training/1st_manual/28_manual1.gif differ diff --git a/DRIVE/training/1st_manual/29_manual1.gif b/DRIVE/training/1st_manual/29_manual1.gif new file mode 100644 index 00000000..0816c479 Binary files /dev/null and b/DRIVE/training/1st_manual/29_manual1.gif differ diff --git a/DRIVE/training/1st_manual/30_manual1.gif b/DRIVE/training/1st_manual/30_manual1.gif new file mode 100644 index 00000000..b3891159 Binary files /dev/null and b/DRIVE/training/1st_manual/30_manual1.gif differ diff --git a/DRIVE/training/1st_manual/31_manual1.gif b/DRIVE/training/1st_manual/31_manual1.gif new file mode 100644 index 00000000..dc207cff Binary files /dev/null and b/DRIVE/training/1st_manual/31_manual1.gif differ diff --git a/DRIVE/training/1st_manual/32_manual1.gif b/DRIVE/training/1st_manual/32_manual1.gif new file mode 100644 index 00000000..84e4c7c7 Binary files /dev/null and b/DRIVE/training/1st_manual/32_manual1.gif differ diff --git a/DRIVE/training/1st_manual/33_manual1.gif b/DRIVE/training/1st_manual/33_manual1.gif new file mode 100644 index 00000000..cb369d51 Binary files /dev/null and b/DRIVE/training/1st_manual/33_manual1.gif differ diff --git a/DRIVE/training/1st_manual/34_manual1.gif b/DRIVE/training/1st_manual/34_manual1.gif new file mode 100644 index 00000000..3d768a14 Binary files /dev/null and b/DRIVE/training/1st_manual/34_manual1.gif differ diff --git a/DRIVE/training/1st_manual/35_manual1.gif b/DRIVE/training/1st_manual/35_manual1.gif new file mode 100644 index 00000000..4b9f09a8 Binary files /dev/null and b/DRIVE/training/1st_manual/35_manual1.gif differ diff --git a/DRIVE/training/1st_manual/36_manual1.gif b/DRIVE/training/1st_manual/36_manual1.gif new file mode 100644 index 00000000..6ff40fcf Binary files /dev/null and b/DRIVE/training/1st_manual/36_manual1.gif differ diff --git a/DRIVE/training/1st_manual/37_manual1.gif b/DRIVE/training/1st_manual/37_manual1.gif new file mode 100644 index 00000000..6d5f906c Binary files /dev/null and b/DRIVE/training/1st_manual/37_manual1.gif differ diff --git a/DRIVE/training/1st_manual/38_manual1.gif b/DRIVE/training/1st_manual/38_manual1.gif new file mode 100644 index 00000000..60272326 Binary files /dev/null and b/DRIVE/training/1st_manual/38_manual1.gif differ diff --git a/DRIVE/training/1st_manual/39_manual1.gif b/DRIVE/training/1st_manual/39_manual1.gif new file mode 100644 index 00000000..9963c694 Binary files /dev/null and b/DRIVE/training/1st_manual/39_manual1.gif differ diff --git a/DRIVE/training/1st_manual/40_manual1.gif b/DRIVE/training/1st_manual/40_manual1.gif new file mode 100644 index 00000000..e1d4a2ad Binary files /dev/null and b/DRIVE/training/1st_manual/40_manual1.gif differ diff --git a/DRIVE/training/images/21_training.tif b/DRIVE/training/images/21_training.tif new file mode 100644 index 00000000..c1c469d8 Binary files /dev/null and b/DRIVE/training/images/21_training.tif differ diff --git a/DRIVE/training/images/22_training.tif b/DRIVE/training/images/22_training.tif new file mode 100644 index 00000000..8741bbf8 Binary files /dev/null and b/DRIVE/training/images/22_training.tif differ diff --git a/DRIVE/training/images/23_training.tif b/DRIVE/training/images/23_training.tif new file mode 100644 index 00000000..bc743536 Binary files /dev/null and b/DRIVE/training/images/23_training.tif differ diff --git a/DRIVE/training/images/24_training.tif b/DRIVE/training/images/24_training.tif new file mode 100644 index 00000000..902ff26e Binary files /dev/null and b/DRIVE/training/images/24_training.tif differ diff --git a/DRIVE/training/images/25_training.tif b/DRIVE/training/images/25_training.tif new file mode 100644 index 00000000..15b64ca9 Binary files /dev/null and b/DRIVE/training/images/25_training.tif differ diff --git a/DRIVE/training/images/26_training.tif b/DRIVE/training/images/26_training.tif new file mode 100644 index 00000000..052d008d Binary files /dev/null and b/DRIVE/training/images/26_training.tif differ diff --git a/DRIVE/training/images/27_training.tif b/DRIVE/training/images/27_training.tif new file mode 100644 index 00000000..b1dd6588 Binary files /dev/null and b/DRIVE/training/images/27_training.tif differ diff --git a/DRIVE/training/images/28_training.tif b/DRIVE/training/images/28_training.tif new file mode 100644 index 00000000..325bdfd7 Binary files /dev/null and b/DRIVE/training/images/28_training.tif differ diff --git a/DRIVE/training/images/29_training.tif b/DRIVE/training/images/29_training.tif new file mode 100644 index 00000000..3a80abcf Binary files /dev/null and b/DRIVE/training/images/29_training.tif differ diff --git a/DRIVE/training/images/30_training.tif b/DRIVE/training/images/30_training.tif new file mode 100644 index 00000000..5b3bf14e Binary files /dev/null and b/DRIVE/training/images/30_training.tif differ diff --git a/DRIVE/training/images/31_training.tif b/DRIVE/training/images/31_training.tif new file mode 100644 index 00000000..f68407f3 Binary files /dev/null and b/DRIVE/training/images/31_training.tif differ diff --git a/DRIVE/training/images/32_training.tif b/DRIVE/training/images/32_training.tif new file mode 100644 index 00000000..1a44996d Binary files /dev/null and b/DRIVE/training/images/32_training.tif differ diff --git a/DRIVE/training/images/33_training.tif b/DRIVE/training/images/33_training.tif new file mode 100644 index 00000000..f41b00b1 Binary files /dev/null and b/DRIVE/training/images/33_training.tif differ diff --git a/DRIVE/training/images/34_training.tif b/DRIVE/training/images/34_training.tif new file mode 100644 index 00000000..0cfc125d Binary files /dev/null and b/DRIVE/training/images/34_training.tif differ diff --git a/DRIVE/training/images/35_training.tif b/DRIVE/training/images/35_training.tif new file mode 100644 index 00000000..55b1ffdd Binary files /dev/null and b/DRIVE/training/images/35_training.tif differ diff --git a/DRIVE/training/images/36_training.tif b/DRIVE/training/images/36_training.tif new file mode 100644 index 00000000..e4decfc8 Binary files /dev/null and b/DRIVE/training/images/36_training.tif differ diff --git a/DRIVE/training/images/37_training.tif b/DRIVE/training/images/37_training.tif new file mode 100644 index 00000000..80a18c08 Binary files /dev/null and b/DRIVE/training/images/37_training.tif differ diff --git a/DRIVE/training/images/38_training.tif b/DRIVE/training/images/38_training.tif new file mode 100644 index 00000000..34fd1cff Binary files /dev/null and b/DRIVE/training/images/38_training.tif differ diff --git a/DRIVE/training/images/39_training.tif b/DRIVE/training/images/39_training.tif new file mode 100644 index 00000000..60132ce7 Binary files /dev/null and b/DRIVE/training/images/39_training.tif differ diff --git a/DRIVE/training/images/40_training.tif b/DRIVE/training/images/40_training.tif new file mode 100644 index 00000000..918828dd Binary files /dev/null and b/DRIVE/training/images/40_training.tif differ diff --git a/DRIVE/training/mask/21_training_mask.gif b/DRIVE/training/mask/21_training_mask.gif new file mode 100644 index 00000000..661dc73b Binary files /dev/null and b/DRIVE/training/mask/21_training_mask.gif differ diff --git a/DRIVE/training/mask/22_training_mask.gif b/DRIVE/training/mask/22_training_mask.gif new file mode 100644 index 00000000..4f776bc7 Binary files /dev/null and b/DRIVE/training/mask/22_training_mask.gif differ diff --git a/DRIVE/training/mask/23_training_mask.gif b/DRIVE/training/mask/23_training_mask.gif new file mode 100644 index 00000000..d6869a3c Binary files /dev/null and b/DRIVE/training/mask/23_training_mask.gif differ diff --git a/DRIVE/training/mask/24_training_mask.gif b/DRIVE/training/mask/24_training_mask.gif new file mode 100644 index 00000000..7f2110c5 Binary files /dev/null and b/DRIVE/training/mask/24_training_mask.gif differ diff --git a/DRIVE/training/mask/25_training_mask.gif b/DRIVE/training/mask/25_training_mask.gif new file mode 100644 index 00000000..14d154a1 Binary files /dev/null and b/DRIVE/training/mask/25_training_mask.gif differ diff --git a/DRIVE/training/mask/26_training_mask.gif b/DRIVE/training/mask/26_training_mask.gif new file mode 100644 index 00000000..fdaa0f36 Binary files /dev/null and b/DRIVE/training/mask/26_training_mask.gif differ diff --git a/DRIVE/training/mask/27_training_mask.gif b/DRIVE/training/mask/27_training_mask.gif new file mode 100644 index 00000000..4b026f2f Binary files /dev/null and b/DRIVE/training/mask/27_training_mask.gif differ diff --git a/DRIVE/training/mask/28_training_mask.gif b/DRIVE/training/mask/28_training_mask.gif new file mode 100644 index 00000000..ebd06843 Binary files /dev/null and b/DRIVE/training/mask/28_training_mask.gif differ diff --git a/DRIVE/training/mask/29_training_mask.gif b/DRIVE/training/mask/29_training_mask.gif new file mode 100644 index 00000000..4316249d Binary files /dev/null and b/DRIVE/training/mask/29_training_mask.gif differ diff --git a/DRIVE/training/mask/30_training_mask.gif b/DRIVE/training/mask/30_training_mask.gif new file mode 100644 index 00000000..be99b460 Binary files /dev/null and b/DRIVE/training/mask/30_training_mask.gif differ diff --git a/DRIVE/training/mask/31_training_mask.gif b/DRIVE/training/mask/31_training_mask.gif new file mode 100644 index 00000000..d1cd5ab8 Binary files /dev/null and b/DRIVE/training/mask/31_training_mask.gif differ diff --git a/DRIVE/training/mask/32_training_mask.gif b/DRIVE/training/mask/32_training_mask.gif new file mode 100644 index 00000000..68c4739f Binary files /dev/null and b/DRIVE/training/mask/32_training_mask.gif differ diff --git a/DRIVE/training/mask/33_training_mask.gif b/DRIVE/training/mask/33_training_mask.gif new file mode 100644 index 00000000..26e99513 Binary files /dev/null and b/DRIVE/training/mask/33_training_mask.gif differ diff --git a/DRIVE/training/mask/34_training_mask.gif b/DRIVE/training/mask/34_training_mask.gif new file mode 100644 index 00000000..8d2ec1e3 Binary files /dev/null and b/DRIVE/training/mask/34_training_mask.gif differ diff --git a/DRIVE/training/mask/35_training_mask.gif b/DRIVE/training/mask/35_training_mask.gif new file mode 100644 index 00000000..43e7324d Binary files /dev/null and b/DRIVE/training/mask/35_training_mask.gif differ diff --git a/DRIVE/training/mask/36_training_mask.gif b/DRIVE/training/mask/36_training_mask.gif new file mode 100644 index 00000000..6c7bbbff Binary files /dev/null and b/DRIVE/training/mask/36_training_mask.gif differ diff --git a/DRIVE/training/mask/37_training_mask.gif b/DRIVE/training/mask/37_training_mask.gif new file mode 100644 index 00000000..5fa6cc70 Binary files /dev/null and b/DRIVE/training/mask/37_training_mask.gif differ diff --git a/DRIVE/training/mask/38_training_mask.gif b/DRIVE/training/mask/38_training_mask.gif new file mode 100644 index 00000000..7a929415 Binary files /dev/null and b/DRIVE/training/mask/38_training_mask.gif differ diff --git a/DRIVE/training/mask/39_training_mask.gif b/DRIVE/training/mask/39_training_mask.gif new file mode 100644 index 00000000..8e4390d8 Binary files /dev/null and b/DRIVE/training/mask/39_training_mask.gif differ diff --git a/DRIVE/training/mask/40_training_mask.gif b/DRIVE/training/mask/40_training_mask.gif new file mode 100644 index 00000000..7b004599 Binary files /dev/null and b/DRIVE/training/mask/40_training_mask.gif differ diff --git a/Readme.md b/Readme.md index e4ebf793..a2ef306e 100644 --- a/Readme.md +++ b/Readme.md @@ -75,6 +75,14 @@ The following dependencies are needed: - ConfigParser >=3.5.0b2 - scikit-learn >= 0.17.1 +Version used +- python3 = 3.9.13 +- numpy = 1.19.5 +- PIL =8.2.0 +- opencv =4.5.2 +- h5py =3.1.0 +- configparser =3.10.6 +- scikit-learn = 0.24.2 Also, you will need the DRIVE database, which can be freely downloaded as explained in the next section. diff --git a/lib/extract_patches.py b/lib/extract_patches.py index 1b350d9b..5acd334d 100644 --- a/lib/extract_patches.py +++ b/lib/extract_patches.py @@ -1,6 +1,6 @@ import numpy as np import random -import ConfigParser +#import ConfigParser from help_functions import load_hdf5 from help_functions import visualize @@ -34,18 +34,18 @@ def get_data_training(DRIVE_train_imgs_original, #check masks are within 0-1 assert(np.min(train_masks)==0 and np.max(train_masks)==1) - print "\ntrain images/masks shape:" - print train_imgs.shape - print "train images range (min-max): " +str(np.min(train_imgs)) +' - '+str(np.max(train_imgs)) - print "train masks are within 0-1\n" + print ("\ntrain images/masks shape:") + print (train_imgs.shape) + print ("train images range (min-max): " +str(np.min(train_imgs)) +' - '+str(np.max(train_imgs))) + print ("train masks are within 0-1\n") #extract the TRAINING patches from the full images patches_imgs_train, patches_masks_train = extract_random(train_imgs,train_masks,patch_height,patch_width,N_subimgs,inside_FOV) data_consistency_check(patches_imgs_train, patches_masks_train) - print "\ntrain PATCHES images/masks shape:" - print patches_imgs_train.shape - print "train PATCHES images range (min-max): " +str(np.min(patches_imgs_train)) +' - '+str(np.max(patches_imgs_train)) + print ("\ntrain PATCHES images/masks shape:") + print (patches_imgs_train.shape) + print ("train PATCHES images range (min-max): " +str(np.min(patches_imgs_train)) +' - '+str(np.max(patches_imgs_train))) return patches_imgs_train, patches_masks_train#, patches_imgs_test, patches_masks_test @@ -70,19 +70,19 @@ def get_data_testing(DRIVE_test_imgs_original, DRIVE_test_groudTruth, Imgs_to_te #check masks are within 0-1 assert(np.max(test_masks)==1 and np.min(test_masks)==0) - print "\ntest images/masks shape:" - print test_imgs.shape - print "test images range (min-max): " +str(np.min(test_imgs)) +' - '+str(np.max(test_imgs)) - print "test masks are within 0-1\n" + print ("\ntest images/masks shape:") + print (test_imgs.shape) + print ("test images range (min-max): " +str(np.min(test_imgs)) +' - '+str(np.max(test_imgs))) + print ("test masks are within 0-1\n") #extract the TEST patches from the full images patches_imgs_test = extract_ordered(test_imgs,patch_height,patch_width) patches_masks_test = extract_ordered(test_masks,patch_height,patch_width) data_consistency_check(patches_imgs_test, patches_masks_test) - print "\ntest PATCHES images/masks shape:" - print patches_imgs_test.shape - print "test PATCHES images range (min-max): " +str(np.min(patches_imgs_test)) +' - '+str(np.max(patches_imgs_test)) + print ("\ntest PATCHES images/masks shape:") + print (patches_imgs_test.shape) + print ("test PATCHES images range (min-max): " +str(np.min(patches_imgs_test)) +' - '+str(np.max(patches_imgs_test))) return patches_imgs_test, patches_masks_test @@ -106,19 +106,19 @@ def get_data_testing_overlap(DRIVE_test_imgs_original, DRIVE_test_groudTruth, Im #check masks are within 0-1 assert(np.max(test_masks)==1 and np.min(test_masks)==0) - print "\ntest images shape:" - print test_imgs.shape - print "\ntest mask shape:" - print test_masks.shape - print "test images range (min-max): " +str(np.min(test_imgs)) +' - '+str(np.max(test_imgs)) - print "test masks are within 0-1\n" + print ("\ntest images shape:") + print (test_imgs.shape) + print ("\ntest mask shape:") + print (test_masks.shape) + print ("test images range (min-max): " +str(np.min(test_imgs)) +' - '+str(np.max(test_imgs))) + print ("test masks are within 0-1\n") #extract the TEST patches from the full images patches_imgs_test = extract_ordered_overlap(test_imgs,patch_height,patch_width,stride_height,stride_width) - print "\ntest PATCHES images shape:" - print patches_imgs_test.shape - print "test PATCHES images range (min-max): " +str(np.min(patches_imgs_test)) +' - '+str(np.max(patches_imgs_test)) + print ("\ntest PATCHES images shape:") + print (patches_imgs_test.shape) + print ("test PATCHES images range (min-max): " +str(np.min(patches_imgs_test)) +' - '+str(np.max(patches_imgs_test))) return patches_imgs_test, test_imgs.shape[2], test_imgs.shape[3], test_masks @@ -137,7 +137,7 @@ def data_consistency_check(imgs,masks): # -- Inside OR in full image def extract_random(full_imgs,full_masks, patch_h,patch_w, N_patches, inside=True): if (N_patches%full_imgs.shape[0] != 0): - print "N_patches: plase enter a multiple of 20" + print ("N_patches: plase enter a multiple of 20") exit() assert (len(full_imgs.shape)==4 and len(full_masks.shape)==4) #4D arrays assert (full_imgs.shape[1]==1 or full_imgs.shape[1]==3) #check the channel is 1 or 3 @@ -149,7 +149,7 @@ def extract_random(full_imgs,full_masks, patch_h,patch_w, N_patches, inside=True img_w = full_imgs.shape[3] #width of the full image # (0,0) in the center of the image patch_per_img = int(N_patches/full_imgs.shape[0]) #N_patches equally divided in the full images - print "patches per full image: " +str(patch_per_img) + print ("patches per full image: " +str(patch_per_img)) iter_tot = 0 #iter over the total numbe rof patches (N_patches) for i in range(full_imgs.shape[0]): #loop over the full images k=0 @@ -191,11 +191,11 @@ def extract_ordered(full_imgs, patch_h, patch_w): img_w = full_imgs.shape[3] #width of the full image N_patches_h = int(img_h/patch_h) #round to lowest int if (img_h%patch_h != 0): - print "warning: " +str(N_patches_h) +" patches in height, with about " +str(img_h%patch_h) +" pixels left over" + print ("warning: " +str(N_patches_h) +" patches in height, with about " +str(img_h%patch_h) +" pixels left over") N_patches_w = int(img_w/patch_w) #round to lowest int if (img_h%patch_h != 0): - print "warning: " +str(N_patches_w) +" patches in width, with about " +str(img_w%patch_w) +" pixels left over" - print "number of patches per image: " +str(N_patches_h*N_patches_w) + print ("warning: " +str(N_patches_w) +" patches in width, with about " +str(img_w%patch_w) +" pixels left over") + print ("number of patches per image: " +str(N_patches_h*N_patches_w)) N_patches_tot = (N_patches_h*N_patches_w)*full_imgs.shape[0] patches = np.empty((N_patches_tot,full_imgs.shape[1],patch_h,patch_w)) @@ -218,22 +218,22 @@ def paint_border_overlap(full_imgs, patch_h, patch_w, stride_h, stride_w): leftover_h = (img_h-patch_h)%stride_h #leftover on the h dim leftover_w = (img_w-patch_w)%stride_w #leftover on the w dim if (leftover_h != 0): #change dimension of img_h - print "\nthe side H is not compatible with the selected stride of " +str(stride_h) - print "img_h " +str(img_h) + ", patch_h " +str(patch_h) + ", stride_h " +str(stride_h) - print "(img_h - patch_h) MOD stride_h: " +str(leftover_h) - print "So the H dim will be padded with additional " +str(stride_h - leftover_h) + " pixels" + print ("\nthe side H is not compatible with the selected stride of " +str(stride_h)) + print ("img_h " +str(img_h) + ", patch_h " +str(patch_h) + ", stride_h " +str(stride_h)) + print ("(img_h - patch_h) MOD stride_h: " +str(leftover_h)) + print ("So the H dim will be padded with additional " +str(stride_h - leftover_h) + " pixels") tmp_full_imgs = np.zeros((full_imgs.shape[0],full_imgs.shape[1],img_h+(stride_h-leftover_h),img_w)) tmp_full_imgs[0:full_imgs.shape[0],0:full_imgs.shape[1],0:img_h,0:img_w] = full_imgs full_imgs = tmp_full_imgs if (leftover_w != 0): #change dimension of img_w - print "the side W is not compatible with the selected stride of " +str(stride_w) - print "img_w " +str(img_w) + ", patch_w " +str(patch_w) + ", stride_w " +str(stride_w) - print "(img_w - patch_w) MOD stride_w: " +str(leftover_w) - print "So the W dim will be padded with additional " +str(stride_w - leftover_w) + " pixels" + print ("the side W is not compatible with the selected stride of " +str(stride_w)) + print ("img_w " +str(img_w) + ", patch_w " +str(patch_w) + ", stride_w " +str(stride_w)) + print ("(img_w - patch_w) MOD stride_w: " +str(leftover_w)) + print ("So the W dim will be padded with additional " +str(stride_w - leftover_w) + " pixels") tmp_full_imgs = np.zeros((full_imgs.shape[0],full_imgs.shape[1],full_imgs.shape[2],img_w+(stride_w - leftover_w))) tmp_full_imgs[0:full_imgs.shape[0],0:full_imgs.shape[1],0:full_imgs.shape[2],0:img_w] = full_imgs full_imgs = tmp_full_imgs - print "new full images shape: \n" +str(full_imgs.shape) + print ("new full images shape: \n" +str(full_imgs.shape)) return full_imgs #Divide all the full_imgs in pacthes @@ -245,9 +245,9 @@ def extract_ordered_overlap(full_imgs, patch_h, patch_w,stride_h,stride_w): assert ((img_h-patch_h)%stride_h==0 and (img_w-patch_w)%stride_w==0) N_patches_img = ((img_h-patch_h)//stride_h+1)*((img_w-patch_w)//stride_w+1) #// --> division between integers N_patches_tot = N_patches_img*full_imgs.shape[0] - print "Number of patches on h : " +str(((img_h-patch_h)//stride_h+1)) - print "Number of patches on w : " +str(((img_w-patch_w)//stride_w+1)) - print "number of patches per image: " +str(N_patches_img) +", totally for this dataset: " +str(N_patches_tot) + print ("Number of patches on h : " +str(((img_h-patch_h)//stride_h+1))) + print ("Number of patches on w : " +str(((img_w-patch_w)//stride_w+1))) + print ("number of patches per image: " +str(N_patches_img) +", totally for this dataset: " +str(N_patches_tot)) patches = np.empty((N_patches_tot,full_imgs.shape[1],patch_h,patch_w)) iter_tot = 0 #iter over the total number of patches (N_patches) for i in range(full_imgs.shape[0]): #loop over the full images @@ -268,12 +268,12 @@ def recompone_overlap(preds, img_h, img_w, stride_h, stride_w): N_patches_h = (img_h-patch_h)//stride_h+1 N_patches_w = (img_w-patch_w)//stride_w+1 N_patches_img = N_patches_h * N_patches_w - print "N_patches_h: " +str(N_patches_h) - print "N_patches_w: " +str(N_patches_w) - print "N_patches_img: " +str(N_patches_img) + print ("N_patches_h: " +str(N_patches_h)) + print ("N_patches_w: " +str(N_patches_w)) + print ("N_patches_img: " +str(N_patches_img)) assert (preds.shape[0]%N_patches_img==0) N_full_imgs = preds.shape[0]//N_patches_img - print "According to the dimension inserted, there are " +str(N_full_imgs) +" full images (of " +str(img_h)+"x" +str(img_w) +" each)" + print ("According to the dimension inserted, there are " +str(N_full_imgs) +" full images (of " +str(img_h)+"x" +str(img_w) +" each)") full_prob = np.zeros((N_full_imgs,preds.shape[1],img_h,img_w)) #itialize to zero mega array with sum of Probabilities full_sum = np.zeros((N_full_imgs,preds.shape[1],img_h,img_w)) @@ -287,7 +287,7 @@ def recompone_overlap(preds, img_h, img_w, stride_h, stride_w): assert(k==preds.shape[0]) assert(np.min(full_sum)>=1.0) #at least one final_avg = full_prob/full_sum - print final_avg.shape + print (final_avg.shape) assert(np.max(final_avg)<=1.0) #max value for a pixel is 1.0 assert(np.min(final_avg)>=0.0) #min value for a pixel is 0.0 return final_avg diff --git a/lib/help_functions.py b/lib/help_functions.py index 47129a9b..4a949505 100644 --- a/lib/help_functions.py +++ b/lib/help_functions.py @@ -85,7 +85,7 @@ def pred_to_imgs(pred, patch_height, patch_width, mode="original"): else: pred_images[i,pix]=0 else: - print "mode " +str(mode) +" not recognized, it can be 'original' or 'threshold'" + print ("mode " +str(mode) +" not recognized, it can be 'original' or 'threshold'") exit() pred_images = np.reshape(pred_images,(pred_images.shape[0],1, patch_height, patch_width)) return pred_images diff --git a/prepare_datasets_DRIVE.py b/prepare_datasets_DRIVE.py index 8c20947e..eba76d70 100644 --- a/prepare_datasets_DRIVE.py +++ b/prepare_datasets_DRIVE.py @@ -40,12 +40,12 @@ def get_datasets(imgs_dir,groundTruth_dir,borderMasks_dir,train_test="null"): for path, subdirs, files in os.walk(imgs_dir): #list all files, directories in the path for i in range(len(files)): #original - print "original image: " +files[i] + print ("original image: " +files[i]) img = Image.open(imgs_dir+files[i]) imgs[i] = np.asarray(img) #corresponding ground truth groundTruth_name = files[i][0:2] + "_manual1.gif" - print "ground truth name: " + groundTruth_name + print ("ground truth name: " + groundTruth_name) g_truth = Image.open(groundTruth_dir + groundTruth_name) groundTruth[i] = np.asarray(g_truth) #corresponding border masks @@ -55,17 +55,17 @@ def get_datasets(imgs_dir,groundTruth_dir,borderMasks_dir,train_test="null"): elif train_test=="test": border_masks_name = files[i][0:2] + "_test_mask.gif" else: - print "specify if train or test!!" + print ("specify if train or test!!") exit() - print "border masks name: " + border_masks_name + print ("border masks name: " + border_masks_name) b_mask = Image.open(borderMasks_dir + border_masks_name) border_masks[i] = np.asarray(b_mask) - print "imgs max: " +str(np.max(imgs)) - print "imgs min: " +str(np.min(imgs)) + print ("imgs max: " +str(np.max(imgs))) + print ("imgs min: " +str(np.min(imgs))) assert(np.max(groundTruth)==255 and np.max(border_masks)==255) assert(np.min(groundTruth)==0 and np.min(border_masks)==0) - print "ground truth and border masks are correctly withih pixel value range 0-255 (black-white)" + print ("ground truth and border masks are correctly withih pixel value range 0-255 (black-white)") #reshaping for my standard tensors imgs = np.transpose(imgs,(0,3,1,2)) assert(imgs.shape == (Nimgs,channels,height,width)) @@ -79,14 +79,14 @@ def get_datasets(imgs_dir,groundTruth_dir,borderMasks_dir,train_test="null"): os.makedirs(dataset_path) #getting the training datasets imgs_train, groundTruth_train, border_masks_train = get_datasets(original_imgs_train,groundTruth_imgs_train,borderMasks_imgs_train,"train") -print "saving train datasets" +print ("saving train datasets") write_hdf5(imgs_train, dataset_path + "DRIVE_dataset_imgs_train.hdf5") write_hdf5(groundTruth_train, dataset_path + "DRIVE_dataset_groundTruth_train.hdf5") write_hdf5(border_masks_train,dataset_path + "DRIVE_dataset_borderMasks_train.hdf5") #getting the testing datasets imgs_test, groundTruth_test, border_masks_test = get_datasets(original_imgs_test,groundTruth_imgs_test,borderMasks_imgs_test,"test") -print "saving test datasets" +print ("saving test datasets") write_hdf5(imgs_test,dataset_path + "DRIVE_dataset_imgs_test.hdf5") write_hdf5(groundTruth_test, dataset_path + "DRIVE_dataset_groundTruth_test.hdf5") write_hdf5(border_masks_test,dataset_path + "DRIVE_dataset_borderMasks_test.hdf5") diff --git a/run_testing.py b/run_testing.py index 3f5e57ca..52401290 100644 --- a/run_testing.py +++ b/run_testing.py @@ -5,11 +5,11 @@ ################################################## import os, sys -import ConfigParser +import configparser #config file to read from -config = ConfigParser.RawConfigParser() +config = configparser.RawConfigParser() config.readfp(open(r'./configuration.txt')) #=========================================== #name of the experiment!! @@ -20,7 +20,7 @@ #create a folder for the results if not existing already result_dir = name_experiment -print "\n1. Create directory for the results (if not already existing)" +print ("\n1. Create directory for the results (if not already existing)") if os.path.exists(result_dir): pass elif sys.platform=='win32': @@ -31,8 +31,8 @@ # finally run the prediction if nohup: - print "\n2. Run the prediction on GPU with nohup" + print ("\n2. Run the prediction on GPU with nohup") os.system(run_GPU +' nohup python -u ./src/retinaNN_predict.py > ' +'./'+name_experiment+'/'+name_experiment+'_prediction.nohup') else: - print "\n2. Run the prediction on GPU (no nohup)" + print ("\n2. Run the prediction on GPU (no nohup)") os.system(run_GPU +' python ./src/retinaNN_predict.py') diff --git a/run_training.py b/run_training.py index 1ae8f34f..eeffb4fb 100644 --- a/run_training.py +++ b/run_training.py @@ -5,12 +5,12 @@ ################################################## import os, sys -import ConfigParser +import configparser #config file to read from -config = ConfigParser.RawConfigParser() -config.readfp(open(r'./configuration.txt')) +config = configparser.RawConfigParser() +config.read_file(open(r'./configuration.txt')) #=========================================== #name of the experiment name_experiment = config.get('experiment name', 'name') @@ -20,15 +20,15 @@ #create a folder for the results result_dir = name_experiment -print "\n1. Create directory for the results (if not already existing)" +print ("\n1. Create directory for the results (if not already existing)") if os.path.exists(result_dir): - print "Dir already existing" + print ("Dir already existing") elif sys.platform=='win32': os.system('mkdir ' + result_dir) else: os.system('mkdir -p ' +result_dir) -print "copy the configuration file in the results folder" +print ("copy the configuration file in the results folder") if sys.platform=='win32': os.system('copy configuration.txt .\\' +name_experiment+'\\'+name_experiment+'_configuration.txt') else: @@ -36,10 +36,10 @@ # run the experiment if nohup: - print "\n2. Run the training on GPU with nohup" - os.system(run_GPU +' nohup python -u ./src/retinaNN_training.py > ' +'./'+name_experiment+'/'+name_experiment+'_training.nohup') + print ("\n2. Run the training on GPU with nohup") + os.system(run_GPU +' start /min python3 -u ./src/retinaNN_training.py > ' +'./'+name_experiment+'/'+name_experiment+'_training.nohup') else: - print "\n2. Run the training on GPU (no nohup)" - os.system(run_GPU +' python ./src/retinaNN_training.py') + print ("\n2. Run the training on GPU (no nohup)") + os.system(run_GPU +' python3 ./src/retinaNN_training.py') #Prediction/testing is run with a different script diff --git a/src/retinaNN_predict.py b/src/retinaNN_predict.py index ce810dda..52595ceb 100644 --- a/src/retinaNN_predict.py +++ b/src/retinaNN_predict.py @@ -8,7 +8,7 @@ #Python import numpy as np -import ConfigParser +import configparser from matplotlib import pyplot as plt #Keras from keras.models import model_from_json @@ -37,7 +37,7 @@ #========= CONFIG FILE TO READ FROM ======= -config = ConfigParser.RawConfigParser() +config = configparser.RawConfigParser() config.read('configuration.txt') #=========================================== #run the training on invariant or local @@ -112,8 +112,8 @@ model.load_weights(path_experiment+name_experiment + '_'+best_last+'_weights.h5') #Calculate the predictions predictions = model.predict(patches_imgs_test, batch_size=32, verbose=2) -print "predicted images size :" -print predictions.shape +print ("predicted images size :") +print (predictions.shape) #===== Convert the prediction arrays in corresponding images pred_patches = pred_to_imgs(predictions, patch_height, patch_width, "original") @@ -138,9 +138,9 @@ orig_imgs = orig_imgs[:,:,0:full_img_height,0:full_img_width] pred_imgs = pred_imgs[:,:,0:full_img_height,0:full_img_width] gtruth_masks = gtruth_masks[:,:,0:full_img_height,0:full_img_width] -print "Orig imgs shape: " +str(orig_imgs.shape) -print "pred imgs shape: " +str(pred_imgs.shape) -print "Gtruth imgs shape: " +str(gtruth_masks.shape) +print ("Orig imgs shape: " +str(orig_imgs.shape)) +print ("pred imgs shape: " +str(pred_imgs.shape)) +print ("Gtruth imgs shape: " +str(gtruth_masks.shape)) visualize(group_images(orig_imgs,N_visual),path_experiment+"all_originals")#.show() visualize(group_images(pred_imgs,N_visual),path_experiment+"all_predictions")#.show() visualize(group_images(gtruth_masks,N_visual),path_experiment+"all_groundTruths")#.show() @@ -158,18 +158,18 @@ #====== Evaluate the results -print "\n\n======== Evaluate the results =======================" +print ("\n\n======== Evaluate the results =======================") #predictions only inside the FOV y_scores, y_true = pred_only_FOV(pred_imgs,gtruth_masks, test_border_masks) #returns data only inside the FOV -print "Calculating results only inside the FOV:" -print "y scores pixels: " +str(y_scores.shape[0]) +" (radius 270: 270*270*3.14==228906), including background around retina: " +str(pred_imgs.shape[0]*pred_imgs.shape[2]*pred_imgs.shape[3]) +" (584*565==329960)" -print "y true pixels: " +str(y_true.shape[0]) +" (radius 270: 270*270*3.14==228906), including background around retina: " +str(gtruth_masks.shape[2]*gtruth_masks.shape[3]*gtruth_masks.shape[0])+" (584*565==329960)" +print ("Calculating results only inside the FOV:") +print ("y scores pixels: " +str(y_scores.shape[0]) +" (radius 270: 270*270*3.14==228906), including background around retina: " +str(pred_imgs.shape[0]*pred_imgs.shape[2]*pred_imgs.shape[3]) +" (584*565==329960)") +print ("y true pixels: " +str(y_true.shape[0]) +" (radius 270: 270*270*3.14==228906), including background around retina: " +str(gtruth_masks.shape[2]*gtruth_masks.shape[3]*gtruth_masks.shape[0])+" (584*565==329960)") #Area under the ROC curve fpr, tpr, thresholds = roc_curve((y_true), y_scores) AUC_ROC = roc_auc_score(y_true, y_scores) # test_integral = np.trapz(tpr,fpr) #trapz is numpy integration -print "\nArea under the ROC curve: " +str(AUC_ROC) +print ("\nArea under the ROC curve: " +str(AUC_ROC)) roc_curve =plt.figure() plt.plot(fpr,tpr,'-',label='Area Under the Curve (AUC = %0.4f)' % AUC_ROC) plt.title('ROC curve') @@ -183,7 +183,7 @@ precision = np.fliplr([precision])[0] #so the array is increasing (you won't get negative AUC) recall = np.fliplr([recall])[0] #so the array is increasing (you won't get negative AUC) AUC_prec_rec = np.trapz(precision,recall) -print "\nArea under Precision-Recall curve: " +str(AUC_prec_rec) +print ("\nArea under Precision-Recall curve: " +str(AUC_prec_rec)) prec_rec_curve = plt.figure() plt.plot(recall,precision,'-',label='Area Under the Curve (AUC = %0.4f)' % AUC_prec_rec) plt.title('Precision - Recall curve') @@ -194,7 +194,7 @@ #Confusion matrix threshold_confusion = 0.5 -print "\nConfusion matrix: Custom threshold (for positive) of " +str(threshold_confusion) +print ("\nConfusion matrix: Custom threshold (for positive) of " +str(threshold_confusion)) y_pred = np.empty((y_scores.shape[0])) for i in range(y_scores.shape[0]): if y_scores[i]>=threshold_confusion: @@ -202,31 +202,31 @@ else: y_pred[i]=0 confusion = confusion_matrix(y_true, y_pred) -print confusion +print (confusion) accuracy = 0 if float(np.sum(confusion))!=0: accuracy = float(confusion[0,0]+confusion[1,1])/float(np.sum(confusion)) -print "Global Accuracy: " +str(accuracy) +print ("Global Accuracy: " +str(accuracy)) specificity = 0 if float(confusion[0,0]+confusion[0,1])!=0: specificity = float(confusion[0,0])/float(confusion[0,0]+confusion[0,1]) -print "Specificity: " +str(specificity) +print ("Specificity: " +str(specificity)) sensitivity = 0 if float(confusion[1,1]+confusion[1,0])!=0: sensitivity = float(confusion[1,1])/float(confusion[1,1]+confusion[1,0]) -print "Sensitivity: " +str(sensitivity) +print ("Sensitivity: " +str(sensitivity)) precision = 0 if float(confusion[1,1]+confusion[0,1])!=0: precision = float(confusion[1,1])/float(confusion[1,1]+confusion[0,1]) -print "Precision: " +str(precision) +print ("Precision: " +str(precision)) #Jaccard similarity index jaccard_index = jaccard_similarity_score(y_true, y_pred, normalize=True) -print "\nJaccard similarity score: " +str(jaccard_index) +print ("\nJaccard similarity score: " +str(jaccard_index)) #F1 score F1_score = f1_score(y_true, y_pred, labels=None, average='binary', sample_weight=None) -print "\nF1 score (F-measure): " +str(F1_score) +print ("\nF1 score (F-measure): " +str(F1_score)) #Save the results file_perf = open(path_experiment+'performances.txt', 'w') diff --git a/src/retinaNN_training.py b/src/retinaNN_training.py index 391f079c..92307dd3 100644 --- a/src/retinaNN_training.py +++ b/src/retinaNN_training.py @@ -9,7 +9,7 @@ import numpy as np -import ConfigParser +import configparser from keras.models import Model from keras.layers import Input, concatenate, Conv2D, MaxPooling2D, UpSampling2D, Reshape, core, Dropout @@ -166,8 +166,8 @@ def get_gnet(n_ch,patch_height,patch_width): patch_height = patches_imgs_train.shape[2] patch_width = patches_imgs_train.shape[3] model = get_unet(n_ch, patch_height, patch_width) #the U-net model -print "Check: final output of the network:" -print model.output_shape +print ("Check: final output of the network:") +print (model.output_shape) plot(model, to_file='./'+name_experiment+'/'+name_experiment + '_model.png') #check how the model looks like json_string = model.to_json() open('./'+name_experiment+'/'+name_experiment +'_architecture.json', 'w').write(json_string) diff --git a/test/test_configuration.txt b/test/test_configuration.txt index a4f90af3..27397330 100644 --- a/test/test_configuration.txt +++ b/test/test_configuration.txt @@ -36,11 +36,11 @@ nohup = True best_last = best #number of full images for the test (max 20) full_images_to_test = 20 -#How many original-groundTrutuh-prediction images are visualized in each image -N_group_visual = 5 +#How many original-groundTruth-prediction images are visualized in each image +N_group_visual = 1 #Compute average in the prediction, improve results but require more patches to be predicted average_mode = True -#Only if average_mode==True. Stride of the average, lower value require more patches to be predicted +#Only if average_mode==True. Stride for patch extraction, lower value require more patches to be predicted stride_height = 5 stride_width = 5 #if running with nohup diff --git a/test/test_training.nohup b/test/test_training.nohup new file mode 100644 index 00000000..e69de29b