From 41c118d7412f8a9ffcb5419c91bc308ab2c0f5f4 Mon Sep 17 00:00:00 2001 From: Luca Colomba Date: Tue, 10 Dec 2024 12:00:10 +0100 Subject: [PATCH] added uncompressed test data folder and datamodule test. added versionadded and fixed _verify --- tests/conf/mmflood.yaml | 18 +++ .../activations/EMSR000-0/DEM/EMSR000-0.tif | Bin 0 -> 1486 bytes .../activations/EMSR000-0/DEM/EMSR000-1.tif | Bin 0 -> 1486 bytes .../activations/EMSR000-0/DEM/EMSR000-2.tif | Bin 0 -> 1486 bytes .../activations/EMSR000-0/mask/EMSR000-0.tif | Bin 0 -> 1486 bytes .../activations/EMSR000-0/mask/EMSR000-1.tif | Bin 0 -> 1486 bytes .../activations/EMSR000-0/mask/EMSR000-2.tif | Bin 0 -> 1486 bytes .../EMSR000-0/s1_raw/EMSR000-0.tif | Bin 0 -> 2522 bytes .../EMSR000-0/s1_raw/EMSR000-1.tif | Bin 0 -> 2522 bytes .../EMSR000-0/s1_raw/EMSR000-2.tif | Bin 0 -> 2522 bytes .../activations/EMSR001-0/DEM/EMSR001-0.tif | Bin 0 -> 1486 bytes .../activations/EMSR001-0/DEM/EMSR001-1.tif | Bin 0 -> 1486 bytes .../activations/EMSR001-0/mask/EMSR001-0.tif | Bin 0 -> 1486 bytes .../activations/EMSR001-0/mask/EMSR001-1.tif | Bin 0 -> 1486 bytes .../EMSR001-0/s1_raw/EMSR001-0.tif | Bin 0 -> 2522 bytes .../EMSR001-0/s1_raw/EMSR001-1.tif | Bin 0 -> 2522 bytes .../activations/EMSR003-0/DEM/EMSR003-0.tif | Bin 0 -> 1486 bytes .../activations/EMSR003-0/DEM/EMSR003-1.tif | Bin 0 -> 1486 bytes .../activations/EMSR003-0/mask/EMSR003-0.tif | Bin 0 -> 1486 bytes .../activations/EMSR003-0/mask/EMSR003-1.tif | Bin 0 -> 1486 bytes .../EMSR003-0/s1_raw/EMSR003-0.tif | Bin 0 -> 2522 bytes .../EMSR003-0/s1_raw/EMSR003-1.tif | Bin 0 -> 2522 bytes .../activations/EMSR004-0/DEM/EMSR004-0.tif | Bin 0 -> 1486 bytes .../activations/EMSR004-0/mask/EMSR004-0.tif | Bin 0 -> 1486 bytes .../EMSR004-0/s1_raw/EMSR004-0.tif | Bin 0 -> 2522 bytes tests/data/mmflood/data.py | 2 - tests/datamodules/test_mmflood.py | 72 ------------ tests/datasets/test_mmflood.py | 23 ---- tests/trainers/test_segmentation.py | 1 + torchgeo/datamodules/mmflood.py | 8 +- torchgeo/datasets/mmflood.py | 111 ++++++++++++------ 31 files changed, 96 insertions(+), 139 deletions(-) create mode 100644 tests/conf/mmflood.yaml create mode 100644 tests/data/mmflood/activations/EMSR000-0/DEM/EMSR000-0.tif create mode 100644 tests/data/mmflood/activations/EMSR000-0/DEM/EMSR000-1.tif create mode 100644 tests/data/mmflood/activations/EMSR000-0/DEM/EMSR000-2.tif create mode 100644 tests/data/mmflood/activations/EMSR000-0/mask/EMSR000-0.tif create mode 100644 tests/data/mmflood/activations/EMSR000-0/mask/EMSR000-1.tif create mode 100644 tests/data/mmflood/activations/EMSR000-0/mask/EMSR000-2.tif create mode 100644 tests/data/mmflood/activations/EMSR000-0/s1_raw/EMSR000-0.tif create mode 100644 tests/data/mmflood/activations/EMSR000-0/s1_raw/EMSR000-1.tif create mode 100644 tests/data/mmflood/activations/EMSR000-0/s1_raw/EMSR000-2.tif create mode 100644 tests/data/mmflood/activations/EMSR001-0/DEM/EMSR001-0.tif create mode 100644 tests/data/mmflood/activations/EMSR001-0/DEM/EMSR001-1.tif create mode 100644 tests/data/mmflood/activations/EMSR001-0/mask/EMSR001-0.tif create mode 100644 tests/data/mmflood/activations/EMSR001-0/mask/EMSR001-1.tif create mode 100644 tests/data/mmflood/activations/EMSR001-0/s1_raw/EMSR001-0.tif create mode 100644 tests/data/mmflood/activations/EMSR001-0/s1_raw/EMSR001-1.tif create mode 100644 tests/data/mmflood/activations/EMSR003-0/DEM/EMSR003-0.tif create mode 100644 tests/data/mmflood/activations/EMSR003-0/DEM/EMSR003-1.tif create mode 100644 tests/data/mmflood/activations/EMSR003-0/mask/EMSR003-0.tif create mode 100644 tests/data/mmflood/activations/EMSR003-0/mask/EMSR003-1.tif create mode 100644 tests/data/mmflood/activations/EMSR003-0/s1_raw/EMSR003-0.tif create mode 100644 tests/data/mmflood/activations/EMSR003-0/s1_raw/EMSR003-1.tif create mode 100644 tests/data/mmflood/activations/EMSR004-0/DEM/EMSR004-0.tif create mode 100644 tests/data/mmflood/activations/EMSR004-0/mask/EMSR004-0.tif create mode 100644 tests/data/mmflood/activations/EMSR004-0/s1_raw/EMSR004-0.tif delete mode 100644 tests/datamodules/test_mmflood.py diff --git a/tests/conf/mmflood.yaml b/tests/conf/mmflood.yaml new file mode 100644 index 0000000000..43f3366dcd --- /dev/null +++ b/tests/conf/mmflood.yaml @@ -0,0 +1,18 @@ +model: + class_path: SemanticSegmentationTask + init_args: + loss: 'ce' + model: 'unet' + backbone: 'resnet18' + in_channels: 3 + num_classes: 2 + num_filters: 1 +data: + class_path: MMFloodDataModule + init_args: + batch_size: 1 + dict_kwargs: + root: 'tests/data/mmflood' + patch_size: 8 + normalization: 'median' + include_dem: True diff --git a/tests/data/mmflood/activations/EMSR000-0/DEM/EMSR000-0.tif b/tests/data/mmflood/activations/EMSR000-0/DEM/EMSR000-0.tif new file mode 100644 index 0000000000000000000000000000000000000000..77d718e69f3410709f67b7eb271fd87f316c8fa0 GIT binary patch literal 1486 zcmaiydr(wW9LMi2BBIOkPC!5qVnS#UC0IaVxxX)nrZ9rM#TN>gFu}GWjEEJBE9kDF zWkaTpkW3=#;-gXsA3UrS@C8g#h=Q6AG-byKP&;&gY)b?{|LZanHT;=1u1& za2#jGaRLKQ@Y*=R7#F^AC)Q{1#`SgM$GEv*oPGxGF~fRH{;e@SnYq5Em0>?7AN|G+ zSYBKx;`FVAE%2#Q#EoYj#{8(tfOBG=!(6KpaYE+bF|SbxM|a=MTz|>_=Wb@p0p9ivH1n;ZP@X#mTiuG3ITW5O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vIUUM_3VZk%fmY0*f@1`Q4Apxgtc2n_;7_1u;;O4?!a!GhWC+?<_K}Q>D2K|d(#iNSAhyubUWo+yD>^EF>VVex0x~G}gr(Ud8nPXxrqgqw>8FJB(J7`|$ z2S_vdn8J64(WzPqHF@mlc9Yjz6NACq8e zj3xijdl}jWHj>3OdsxJ|VBaebNQc7cH!m^9LK4Z`nZp6wa6Us1%qdubo?KHBW{L13 zAQ8$TN5r`i-L_i|qZT`?AG09Wb_c$HX)Q&Eq*B{p9(~(!nNJI;q55CN=zMjO|Gmo? z57ISs^&QeBkpp@_urz?SP80Ey5h?vW2CiS47uzAwI`PHeL8E>=B2>;m??R_ zOhZAEmWFb(sY;{cJ42t4;hyO@*E2$?EiKgDwT}!f@6#%$K&b0Huxe8d@33<&?$*C1 zUg?EywuhcjYYdhJ(}`v&J#NgP9GwAX$K+E}-5t7a&tV|d7x!Z?@>we2sc#gj)8etT z?kTO+bx?iV03RIuoNjHHPHz3BM4<=xW7P?;)n6dbN-;{c7VtQ|1z~bM&9q;LEJqp4 yzq-nYgw@bbe^>Hk=Yy=mEx6sP#Es~DMf$TKbk}Ucrm;8(?;DYNUIac*a>hUPYvAty literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR000-0/DEM/EMSR000-2.tif b/tests/data/mmflood/activations/EMSR000-0/DEM/EMSR000-2.tif new file mode 100644 index 0000000000000000000000000000000000000000..eb9a32f0cd7c2f46e559be95effe2a18c1daf4bc GIT binary patch literal 1486 zcmaixeN@eN9LImRo9a?`S7lgAu7p_910~hH-_N_}hY=%&6ou0DFrv0jPSMS(D@0b* z4!KUtCeJ-Ad5D_Sw3!p-*zPRNRLbMYiG7Qm(?2`={m$$6eSJRP&+q&B{=Pqde>=fQ z5CoYZh{S^Eoe82ruJ_)p`JDK@_tzN=^5G)={uP8y&WJ(z4+r^3?)^25oH2v)^WM9d z=cTE}LjP#b8>DPE77V!ia6h3I3)bA@xtFSq1wHQPxSv$(4eb6J_x?-qKX)Uqlk%5C zI2ukPN6H(9a5S7oj#Qt=91W+DBOStHj)v2>+2Td{@77+PqMxE`vPXKo>-yi%3r?QW zfZwJn>iqn!l(hIL{;d=ZoV1}J@byLfYxwc;k#COw3X#wz6B(UU^I5@QAl8hR7?rB~ z=Z6i9f{-4!X}@LB#{Tsb+WBG1g}(EwU7f!ayz0AY*(dQhH9H*1U8WdSaEP+cOR4>e zJAzIhCfeA>K?|li^xrvMsCRmDYK=E$#b0G8Xk|mr&UxK;DZ_YTan`}!+|4fsp^sfNu_;sy(|>0 zYXNB=S5nZuNX$=~h`6Q)w9EZF3iH@Ysop=cEPq3UCV11St?THE6gw!TZYU6<(U7J> zga>unHX2}8G6IradhPqlBIjVqcaZc%JY;eO)+ho3ub1t z1c^Pyc-ZAg9cN6?l(!s{rX8kjHWM&+RTou-TCsE&E%}#4V)0FHWIZuL^uAe0a|%Rp zR3RlBE<(u}7j*vBNBWkbq+1?94U-dWcdZj!GkC2RXkGOxH#I+XImYx<+=^(>)V)xw3RZa=CX@ft~lG?PIp?LP_+F<*y=V=rA~&st)q~e zIt5YEHujC7m@OFQfY85-sp3@~$>qKJCE$ z-wq*Get^m+O@rUJz3kb=R}`DDhu&n15a?r$;|^cbtBzD^%6Utx@}w-ydpkucMj@u% z5%+>?l}DKm1qbO!;$;k5vu^TSf0>Og&!UbUw`pp&E2=$GDY`_8^js?%ZD)ttM?r8Z zRa2*Q8J0HBLeS<2WV+vBGacm^aiE8uCaaM6+6qakM*7p%imH0$ur%$Zo%uH@y>Bxn zSI6SKEQwWnY1!Dh_ozkRkF_-%BkF4OX}1X5vT3N;hKy2lBs zLQ_<>l+dp+L(pft61D2rmNY($EDxEXwj!5qY>#3S&ON1n E0R0!@PXGV_ literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR000-0/mask/EMSR000-0.tif b/tests/data/mmflood/activations/EMSR000-0/mask/EMSR000-0.tif new file mode 100644 index 0000000000000000000000000000000000000000..1901e098a59138a4091e5feb09c5feea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`8f>qz=XO)+<&XsI zcs&aRFNYxaWDmXqC(tb4Lkr##a+HpT<$>4i^lG+(oO_gupB57gA4LMh~J~kp6iy zxxM{JSnz3}AMXDr&2s941hbNfE9skH|wW2XAe}pMF9rd{bP?m3x*XOpeK08kwR8yp^qXndTJrW&%3dn6? zqbO`fIkm6xLB;K@?3}hI+h}D$>FuL2vr`5O!#a}mnW5xz3_3R5qf0+H(`Jt*+V3_7 z`F@6|+Nz4ZBZiQ6*=*Qd-$bRSPEm`WI?Cs2;U2e>Vg#;#R@_JwS?H5JqmuGvk-%{$8InSYps>n~7ct&}u+JyGp*mSR@gVavYt z^qs3W!~%14Wz?{R=UZv#y`M-{k%Z~LoMY}$VOV5xnoOl@DWpgR`2uSexT2HUs}6-& z=!edK!my$#9{ZkVu&zCuL}oR{SUjweH0={n8ySqdA}KCehod8L0D70Gt)Xl2izY|N=G#GZ~ok3|FyFJGAV+Og$>@ zbn##?%BY;J{Bt3B^LIk$qBZT3w^3oP7{UWa7$%m|6CHIr;H3omNfYhSpG1TC?~jte z4oCEDkeJra8hW$HyCE9ug;CIdR6-ZiN<=Edmx?5=n@Pv@JQ+XlA{(b1TGk*&8~-me zxsXHg<;R(*Q=eu%H$$cAA~a{K;YlCR>|afuLD4vScRWRWUc_FkwZy5;gS2OiCkrq4 G#J>U3c9@d@ literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR001-0/DEM/EMSR001-0.tif b/tests/data/mmflood/activations/EMSR001-0/DEM/EMSR001-0.tif new file mode 100644 index 0000000000000000000000000000000000000000..0528d355a6cb1c7c3a09f75d7b2fad9c884d5c3c GIT binary patch literal 1486 zcmaiydrVVT9LH~4L@2d@6`7)}fC!3;JbW=J?fre_>2yq(Vu6a1#tA}YK8mYh2v`NF zFeb(cN{qrLFu+$(kwxYR%QmP_X3(GukEw{dWvElxPSGX&v+Uk{?)jYa``z<9_naFM zF_W|5IL?9N1R_rG#yG(!7ru2li;3R4CC_@4I|{5UGjM|pr%~e*N4Ya|OHMmu%Bb-b zZ(YR3r8yGL(#~N8cIHYrYv!TM>x?2!&U`ELdZUCBGC#|_!6+PAeJgXzrTm|}o#jc{ z%gY!hMms~w3NB-q80`$H73(uhjCO`}4C^yYjMrOShR)rShbROc+RH`GA#bYw_p>=b zA&tB{OW774{#|ufsPf-T!N^XJo%iUOyNn?})|d-tRz7v=FXY({NX_9(wmyI*%VHJ35YT+>S+q z+5de;llXWZa?>XGWX<96EGsl)gEsc80z z!Qr$9I^r}5hSL$qZ%%}KtsSz1CL*o2l<&*iLmzbgO`Z6XLWg?DbI~hOC;UOfN*ShH zdq}+(=fLyeFC_7MAGr=m_|!^?Xmt|GteVKjzKA#M$|jGVGJ0uOO(}8Sblq_cFMb(} zO1DR3j&(yyX%UUTM_3sjK)u!h^jGjv+8;HYt{?2Cl5`!mK5{|T(glz=w^6O1015gF zRFoVJ*=HdLD>+OTU$pXG1%c2il9AX^#c#8nM^kgbO(vyirz#Y0~#rOlB?=|Gtb zeUyfWOP)~Vws34(EyM6YAH^i>qd$+VMMuFj=*tR-$~IxpSAxu_FqBJoQ9nNe1$%uF zo-N{$q~=?HEuuOr4vs^2RQvWQadm=(Zi?dJWUAx6KJ!BUDkr{iW&oySdZJ~S7AFSp zP)+kjY zO4St_5c)#(SWA;n*`ckwmychy9LIx&Xn$^p1v*z6P~=iYRU-D>Z{*GHx#XVdPbPCJ zO*k_Nl{>|>boEO7RN_scdJXhqdvwjVLePV8)Dl)hb(-I3;xi38^49@#)wHC<6?;`; zI(!M_QzydDt$loLYy#N~OvA}BM#@UJ#|@zq3_mJKw#LjC&S>OwtZ(tQ-rvwa#jn^Y literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR001-0/DEM/EMSR001-1.tif b/tests/data/mmflood/activations/EMSR001-0/DEM/EMSR001-1.tif new file mode 100644 index 0000000000000000000000000000000000000000..48645cf75110e0e7052a0a0365246fea1a860f67 GIT binary patch literal 1486 zcmaiyc~BHb6o+RI4g;(Uh)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?sT{1oE>xfD_4})rT9rwcyy;O9?05Jzczs}84u6G{_kzoHL%5Pn>S%5(*9p}h zPgvx1XYYLWVpsQ7FE_SUH`iLFmE}W}?f#vVt%j8x_OxKeaxeAs%{-ZoouO9GYG!@r zE@oNVdF#>tjjd;A?M~inouj75J+^N(eVeyE J&HATZ`36Y)m=OQ~ literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR001-0/s1_raw/EMSR001-0.tif b/tests/data/mmflood/activations/EMSR001-0/s1_raw/EMSR001-0.tif new file mode 100644 index 0000000000000000000000000000000000000000..65dbbda8e48cdd56037ab77e13618ec8c613ad59 GIT binary patch literal 2522 zcmah{dpOnE8s2-mN6P&YJ0TJgVvuD2zV{#u*|xBg%jA+`sUBrg>U31P zk#o~M7#bAIc2*Z2P3^?l#F)_T^wdDA({91cf= z!{N$txGbB7=5J+ zzi?LO1hag!PL3Vw>($tq!*OHH^77R)lH5J-(277A+;6j#cRH^+9V`J5>c`BDqoR>H>aJ)~7!v`q#jse!ps;8F@5foi0Bf9}Z z1f+}Me2kBS!X=p8cR)~~J&p3T+{jjB31Qk4*d%%*Y)~J5AGJ`mxRPl)G9MHBgKfBN zY95_`(MMT@I_NLj&nW!15YgY3lJ?34P!o$Vdr=(zY5Ruw`|U{>Hvw0y$6;5P4tlN% zkk|Z>v=Vugu__7rvDu_LBt#lE3;x3-A!(!q?wAMA z9;ptM%ua-2ggZ1gN$_{ga70BYkDVldrpKWXo%6V&QQ zBS}sHXT*w#3vZxPiJFwKP)7dmKG3>|nW)(3fq^~c)L5m9fDheNFyk(HjGu-%CE=vs zV8L8jYl5N{Rl0vw6O@yIfWk_Wobf=;@`*@WE60>ww}Ri47^u`3VQ!Tj-MkTk+t(k^ zrxqjFvbesDDQ+xdCZ*PrNy&I@YB$G?oIj|UHw%lGrXwcbjmow<;$G4aZI7`<{8N)! zgs+b~-0Q`Zv5kk-)e6`y2&3IQ9Z|920%be$D0Imys(!o_6AZ)XfGizBmrv8di`n#N zmN$w75qN4di{jfBkf|&J+9L_5km;lA?hKSYTu=USv3Sw*gi6}XDN-j1yp$12IG2S? zD=yll%EaHTONJ6LZkETRO?sBRNRLLM9N@Sz5xF%CLW|w3iIZt}s^(0_kn9 z7yRbDVKSYzP@l;(Sl`-C))G6seY=+ac6~Z7sA`e_sW4n#`+zVIhAqns&~F=0?#WU* zlQl%5`e>x`oKd*Ki8SO_(W^sCvD08PsU{tzjzIbu=ki4IsKi#TkA$8grJkS5*sE`$(B}$rGqjxs}??`bl};Y-Y3cB6G-bFOx3~ zfX+7}veMSZjZhxc*D#Qo|3&4AO@h|A05p{vp`%j=f_!`QYhI;$#{Xj6&E-)VCr7)y z-cV`CbLtH?WR9;;q>AY`DbmdjeQDR|+@%QeX_i135`b%Owo>bwvs5^8mqN`$u%k8! z+bxsuxHlcGU7?83$-?5O*(g8bf&-B$bbDtqcJ^E$`4}3c)c>AB&Noo%CPxH80g=(_ zcw*c_@sBn#K~vf&AySSiRlRXuJ_|P;eNY!2fX)S>NQ>6Q)L{)wPC7~DM@$jx6oSE{ zSE=piG&)l$q!Qk1`gGd?d(TVhT|qEfB?NItw_rU#4th;|^bG?m%+1Ko(j7)xugNZd zGpUuPFlyPi=;;DK6bo|b87~b^C*6@9Y=T}7KEf=$QT;HRvY$0DN4v$)PMJ^T!^^R; zaSkaM@@NE9qogP#BZ literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR001-0/s1_raw/EMSR001-1.tif b/tests/data/mmflood/activations/EMSR001-0/s1_raw/EMSR001-1.tif new file mode 100644 index 0000000000000000000000000000000000000000..9b85b5c11988ac51b16fbce62c6910a7b3ce7691 GIT binary patch literal 2522 zcmah}d036x9{zUYZZ3(klS<0aAS#q<@AZ2dq*4jlC8DTQgp?sFLz%W?jB|+4;F1PI zNQN?9Qz%o4)ImZKCBt#fm+L-{f9`X?^}Or%e((CN^{(}M*7uDWGnf-{9H+x^0(nlr zGi@G%U$`94<#^4QZ}LC&?mVSmxQ;;K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dYyx`u|ROTY?elZ2|8~Unu2x5TbSlLgRTT z%yjd~?$Tn~a(N;qcU)u_(x>CdwgdFAt&{|tjN#pPJ>^zqvYcK7X-yF|Cys&Ey&#nM zM`Fo#Wz4bTVEf${yG-3#p`?p#Q1pXz>{+TX5hCkaZ_3y(3w9zYzUd{xAnFyfcs>ob z1AEdy@khEnQyGKrIivg$|1Y?iPQORa!b8s>c4FiPQVW`b1Oxv5!bnm*$d3I3;ed@Q literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR003-0/DEM/EMSR003-0.tif b/tests/data/mmflood/activations/EMSR003-0/DEM/EMSR003-0.tif new file mode 100644 index 0000000000000000000000000000000000000000..52fb7cb2d0278013907d60a67ef97f8b518537f6 GIT binary patch literal 1486 zcmaixc~DbV6o+331Q19;C14dA1yL5af=C4+dFLk(M64o;T8gY-3nYk!*WDkGQzEx>uOpU6Gr5N-@B0I z#p$M;Zk)~n_><+%2q5%w7&+ zC1c+REo$*Z+PtxO$5N zx?N;f{QWh@I(=pTRtkns+K}Ve`U3Vf?D*KoHphO2fO}*vFglaPW;xMtoNH%nbUI5n zZ!$b`Ty|VizRlr8-FmW$rQz~0zhJ3{+h%U`Krw&4DW6K^=7@bV9a$k?P+Iec@ZqDe zvo8r7)!_&}%cI#(%aurUl&Mr)BJj=j0}QstkibZikae2dVjG5x?5P9fgtwRH1lH39Xmu!2)O0dd;CB zvy1diTL7MkozebX2sKZ(2B&ersjYofo#}znC;zVo_*VT6;_B{` z*X>k{@h#yky8fn=A3Tv*v5W4m2|$O*WGGyK5_1zQzfwi3GWC2C>#k9s5J2&q8P;ZE$4nO@5Db7pX-l7-;lFXZ<5GDM*6Lcpm{?_U)mV7wt4|ktX`MG(4ADvGfPIVNS@{rcq9->CEEmT4! zy38DT&6+XPa4r^-)GCr?UZ<0>M(~@J1gATtl*>6`#^75@H%vxPH zz~#CSm3uj&4`v}XcPz%MhA4XBAldR|^xAkWosO&I{VSs=Vqz_YcRwKY@eoQ#DWw%X zN)+|4Me!0P29}tjHdBQR+hl&*Y$+zye@Sbj-4NlEir?lGQ$_Xzn%^3SKP=4A*cpj` E0Iqx3j{pDw literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR003-0/DEM/EMSR003-1.tif b/tests/data/mmflood/activations/EMSR003-0/DEM/EMSR003-1.tif new file mode 100644 index 0000000000000000000000000000000000000000..a2b07cd672ee26253bbc85b9fab1c64ec415e164 GIT binary patch literal 1486 zcmaixeN>ED9LJwAHB)U8EorByb`ec!RVS}C^ZdT4WIH;A=*3ie5khYxtwmvWS7u7* zto2S?PGSqSk!3^)t(^(2VPn~i*rezbXKl8<#h%kY&OXoi-21t|`+M&1KKBL$OyW#9 zj^rD z)C?WNf)xy6s2Mtjg%KMw)C?WN!kCR2YQ~#%$;;~B?R~rj`uMs$YoE7O-`{H8y)EWE zkjk$3`_~?Ao-O+?Q!sGSVvb|$3)tVV<6}MB9J>ku*J>#+IiX^+oM>RI{@B#yxT=5t zgMpsozFe91ja^Yn|9Y~+p<(icej)Z#JwE5gwz%TVqZ|s;KjC})CR6OJ7WtTMBPigP z-Snt4lbjo7VC>Z{Y8aYDCv!Up_6m$&zn@QeGzm^(e~dH)(c0uP+OH0!2$c)6J7+=I zH6Dhl$Nc<>VaRGq!&9{aVaZQvT~R1H9G640ubwn@f6z+PcKPT&9}2jI%tJ^6$UcyTR?tgm84&OmYTDr zxZC3lCr>A2YE$8ow+J2uK6rpVw8LQ(4AOe~s@)VLw$DYYd^O?@=2J_rC$wpDxc~T& zu1<(W)&XCL+ai(gNw^&rOqq4pXv>Q@vYI*@BW`}rS8%Jyds+hZDnEtpTP-cAo`=ks z)zFuEqGWpt=I@<`O*Tj5m;Ss@sghu<30#KizFyk9F&NhthogH|E}gBAqT}jeUZwEE zOLYb$ZN3x`MEGGCL6sHA8(tTYA@Dgl9i4(`K?&c{91WAu0$L#3LoSKg{20S9G_{yf z;291MQZY1N7~`>X8iseiB6!yEk>b-762B1Pmt7$;sQC17Pi(o~Nm+gIn0%&*6e1wB zmP4brJ9d2W8f#-IEpGx4V+P@p3ly0aj)L<6`1$No<6`U6{orHX|)C)<%8Q6YW!&^ED@nG6GI=S8$H$04~ymuL5 zPZi3?)r6qUb1Ox8Wzw=71u47#p$(fGY1gY9N~kX&ucF&DG^&^}>+k5L$_;m{*P<|?js68{eChQ7 literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR003-0/mask/EMSR003-0.tif b/tests/data/mmflood/activations/EMSR003-0/mask/EMSR003-0.tif new file mode 100644 index 0000000000000000000000000000000000000000..342e5daf69e36e35ec886f7b7cd380d992c8c19b GIT binary patch literal 1486 zcmah`F)u?=82xTrRnffEKnEmEY$6s0Q`J(fp-UzF0-HrJ83f5Qy_oz0u^6**Q-sZdKeCM3|-P^X^o|lq{R76}}T+GB7o=bQQUOwTPD;hrG z3OYf)P?JWVGQ0||nGiK&^lrlQ(7n^LC@$iHle4lE!JFW>eqL(ehu}TGEIIHy@V=jm zUjGcPt1;vgBIn_72Nj?~l!psDr~nnByaIYufC^FG2zpe2`Z<{XzW=DL*4^vQ(?xYP zzBPM)SgLy)?+cBWR_pQRt=VAGMZff@2 zACFMve0TqH_G(Y(HLf?e*S6NXwUy#txis4M$u~I zvHJHu_Gv$>=Y0C?iJWJ9<;)Z56RjSFlZ`%+Iil+17Gw4Q&N;+EXXx44uo;TDsS5kV) z6zvB20;ZKeqjVM8W>R2I`JJKm;0I@AvAm1}r{`rUK{uf9VoyToBj|2imI8Dix)&F+ zr+E&sCj#+w~p-*N%?+$(D z^jw~1mdu=G4Y#jrozwF=<7#)tt!+Nfb9b@kjAq?)eLk!9dDHc{hkY`AogbxnOEY(n zxy#Lr+Q+PBJ;xb(dA0VLCF|W<+debYthsL#yF1(rcW8FCtzA#=;SJ_=mc76H3(LWZ AqW}N^ literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR003-0/s1_raw/EMSR003-0.tif b/tests/data/mmflood/activations/EMSR003-0/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1g$yQi7X%rb_xnI~Q=x*@7- z3DPePqCUqd6`DR=uR^^KKPZ4FU-Ico#oWTEvJ3&l_>d21x4&iLib=1E+}ea znwc?FD-FcWi<6jI^}P^rG{u_}?Gg Bh4BCY literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR003-0/s1_raw/EMSR003-1.tif b/tests/data/mmflood/activations/EMSR003-0/s1_raw/EMSR003-1.tif new file mode 100644 index 0000000000000000000000000000000000000000..039ffa35b920afb64f5160ba74ac9a79781c548a GIT binary patch literal 2522 zcmah|eN>Iv9zLg1p@}Bc$mv_6v=)=(;B?OWJW6FkA4(aeNfdpTw8oHA$;3qH8_f)N zCPK*=`ASBEF>C0!+tr$#_5k}lM*Imm$cinfdXaAn}*}wgJ_WrH4-Q6cibR`mr zfkYzJlt@K3QiSv!t|4*_Q8O2Z=39L*Px~EiAk})a?}ez3eyb1e8S_q#k;n&Yw}}|{ zj_&=Ii?YN=q)dl?k)22Oil45q9*c+OuaYxKZyKjrpB9_ zG>ClgOZ`8iP0R}v&Dul+ibicB0=2{_B5;TpMFfhbZ6X47#3&+AY*m|xz@ZY!K$6MR zlkMg%3h6(?YquM@{Kxfw&($9)^gZs_D=*KTd!g*QtMb2@(l=cfi;KQe@it;B#V8(5 z^pQ%sMoM*$W{Rs4?Kl6~Rzr0wG6&a(zljpb=BUIx+5Y&!ddhEn162NQKIYDj>m&x3 zdf^sy8Uu`HL%IRKxe)_v9V6j%uNyU!Qz(~z$OK&(UMA=Yy|_m88d{yks@MQeVNRzZ zHT}QEfbSt;livG0a(NAl!Y6aX!U&a-+JP+|CUhF%N9RuzObAH8)7p_j;iNcxdAeRz z+vLkvdMgEC*J4gCZN_EyZOVhz-(%_+2QF6|GUlEad%r9JpU2a?at0f+eo-aZZbgIs zQDOO`;T&({jm*RmxbU|tD}uDRqhBU0^HOn7Qo68CrAD&Z5x75-;^YuZnoP+SZq+z) z|B73}?N(Rr8viMB*K0BA!Jp`^pGc!gmoRKXE_5AEA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_uQYKs)4=7OOWfI$l!e~P;5*lv+6PIhAT6Sme3>BhK&|7<}L0* ytz{a%y63^knQQ2IT!#gZs^Fh1XW94z(3lp<%oB?cUr~%8&sk`jGZQZ^y5QeY#HI59 literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR004-0/DEM/EMSR004-0.tif b/tests/data/mmflood/activations/EMSR004-0/DEM/EMSR004-0.tif new file mode 100644 index 0000000000000000000000000000000000000000..29e5053d6b8c60763d3ce67de200cf2a4616d083 GIT binary patch literal 1486 zcmaiydr(wW9LMjnxC;V1AcDN4&Ap zR1`DuiKw6xI0|N|7$Kr$q9iFPC?gmK8enR^Q#*?`!#_>;&gY)b`JLZA=iJ}9lP9|g zCW0VX3W7u`NZy(t8RSOqT*=3z@7$0l8{}3JW5WzWKgVWJ+;)(U;BLri;y4Y8>)yGP z#}zr|f}!=~3uNb-3o`B@+>hi*1ts@%?v;7wf)V%cxL4&F4eY*wyWvv*&)vlH6#Qi^ zr-0MMQSb$|oB~c0M`6tSoB~c0M=^x=IR%_o%N(Da>{JG;BtIve-83Tj?W+I%{J~eH z2ES!w{*V{<> zI1sHrPDAZpAK1G4qt}CxRa+RW4}@WykV-LqE^teZL6KZU!{Mjw>Z`V|IxS@5raU z&5^X%&lIIsLU2fYNb@y1G>5dYJ8=Q9nqEg)SphJ8G6voq`{?_)BUf#BW zwoV57KToo>(>{16c}R87O;MEQOtbv1(loUnDx-X1ZC^{beru)e8$F@VU&EF@il*)d zU(p?vH(2F7I=?Ux+F=BX4f7DcSc(nRcC`D**L1M{zIZvbfpX(3=}mJ#h0T0S<0bKU zeC{E8wyKmOb{S)Rxeqjd#A2p=GaY+Ri|%zg=z4*O(W&tFUV=02;h?P`{x zrgIeQQq+-Uk}2sgL}N&?8L`k}x@RSU(Rdxs-abLC(J8!UV2N#x^zpO+#03vWMz{q$ zciN&X#~ZH`GWrrwph{sUbH+05V1NDeAG_OU8EedZ;QkIcBZKNKU(~zgv zS+z$GrEln`g=w>ppz}jS#{-sA+f6IBl+m%v{p2x9#BrH1Z5d@l4ZZcW8L^OB-l6uP zb@cwRKJ_c#C3I@~YP#{FgsS=%BXar-bnJT%7fwh;>x=+gzBq~g8ncr<$Q0mKxth7Q z3`5h^5}NDX!TSGphd;B%mDp|6(&L4aYf;EJS4i^hzW60E6?>vT#jaL8SkP@czQ2*& zCLE%Yz(pwDy%++P!I>>b)6%D8^Vv(<)Rh9OOClZ4)}!#EoIaL*+)(ZW5M?SL`jh% yqV8IvD>I+U#?FS#t|ZLJYNT|VFeF;@|I=NLvgSi{J-(OnU!^0t)E`Cddi(?HpxRRa literal 0 HcmV?d00001 diff --git a/tests/data/mmflood/activations/EMSR004-0/mask/EMSR004-0.tif b/tests/data/mmflood/activations/EMSR004-0/mask/EMSR004-0.tif new file mode 100644 index 0000000000000000000000000000000000000000..a9588d8cf6f918371b50f31399f078720ed8b33c GIT binary patch literal 1486 zcma)3zb`{!6unXI8oE@%UtqHcCW9b(rWcdHKr9CBBC%MA zn4Ukt!eTVqB+l*YNw1gZ$7^oSx#ygFzpt;&=B(sJq$uJ%aWNBTc&5+G@Vq|PT+Z+@ zm(>mOjv6=mgyAJ{%|xgvqqqCqgYF*{L~$Mm93B@W2VMui3Op%;?}2xMf@Hw2!Mj1G zcl!r$eQJMvBIJAww@@J}Lisqbg$hv-%Fm)lg{TPS51~hesL$QWkDJ$Wwc?&O?@vqB z_|%`jZx<^5>dRd1vC+7@e6H7+biFq{EQ0+GzXq=lh|A%xaPn4k`ECGLa=kvB8Oe77 z^+$UsaV1+r&U>!) z|ED$ZJUKUO;E;2p1`fFjj~wzoJaWjnX#L=fLodIrkOur{P=4BVQc%5ea_|6sa9g z;G;s{-urEa>T1Uldd4+-qaY*(N2HD18{RXY!@h5QWZq7mQmZLzg!^Xas7m7#<<@+l zH=1>_rkNR3YpRTJg$dqBc2cUJHXe%4%j!zku+Wlc)D>366637VoYze{e!ei+VoD~3 zVpJ#CB16Rmeil;r&9KLbh$A#4^%K3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4jf%j@`+HdW1y@WT+(C~O<+O2k8qE(8Aa0dWe5)nwt@WYubO&us z`U>;-*=u)Cg87FeQrH*Jy-O~nXO~Sc^d>;Hco{Yt`Jm+z;lwYQvY-dla{}70OdWA9X`Jhp-TcW#-@wK1^YvE`3{@W z>VwLmVw&)MF4Y_fVLw#XGKQS(27>CZ z(P(MD?C#ldC>Bqq$Jyafi>aUyo=!+?-p_tejECleX(-Gd1Cft2JTCl2in&dc>;63p z@-jgDQ8Og3A?U|nWR0~dup2*t`6hUxTwzQ*g8j%av6OaAu4Fq4r5NR3&$5b7laFWw zG~+T^*c?+d8OyL?_yXL1s!k3!XQN{DEHn-Cg;hx$i}fp~-|tD;0)D=mYaH2_#z43a zHD%Y^_s|Ww4`xrAkCTz=c;7q`-eu+_%C^K%s}#~d7z*cQv!V3+YP_}dqT`V#$#>c; z+`Rt6!A7f#F7bE!;1qwX(lUXYeGzp`2|&QgN(#8Toj$~khmqIcth~sKN^^?HIb918 z6&=*I(;h9(=jrd1QmUKoi#_iAySKEHmV^v|%X0o7GO!_k^-PvI-~|PYnvSW)9!#E} z#cJ-kla=lWbQ@=rZ($94vn7cfix zUrfjHXX5oy2`O!wfj;p;u+X?eqBd=8^ None: generate_tar_gz(src='activations', dst='activations.tar.gz') split_tar(path='activations.tar.gz', dst='.', nparts=2) os.remove('activations.tar.gz') - shutil.rmtree('activations') with open(os.path.join(metadatapath, 'activations.json'), 'w') as fp: json.dump(metadata, fp) diff --git a/tests/datamodules/test_mmflood.py b/tests/datamodules/test_mmflood.py deleted file mode 100644 index df96fc1525..0000000000 --- a/tests/datamodules/test_mmflood.py +++ /dev/null @@ -1,72 +0,0 @@ -import os -from itertools import product -from pathlib import Path - -import pytest -from _pytest.fixtures import SubRequest -from pytest import MonkeyPatch -from torch import nn - -from torchgeo.datamodules import MMFloodDataModule -from torchgeo.datasets import MMFlood - - -class TestMMFloodDataModule: - @pytest.fixture(params=product([True, False], ['mean', 'median'])) - def datamodule( - self, monkeypatch: MonkeyPatch, tmp_path: Path, request: SubRequest - ) -> MMFloodDataModule: - dataset_root = os.path.join('tests', 'data', 'mmflood/') - # url = os.path.join(dataset_root) - - # monkeypatch.setattr(MMFlood, 'url', url) - monkeypatch.setattr(MMFlood, '_nparts', 2) - - include_dem, normalization = request.param - # root = tmp_path - return MMFloodDataModule( - batch_size=2, - patch_size=8, - normalization=normalization, - root=dataset_root, - include_dem=include_dem, - transforms=nn.Identity(), - download=True, - checksum=True, - ) - - def test_fit_stage(self, datamodule: MMFloodDataModule) -> None: - datamodule.setup(stage='fit') - datamodule.setup(stage='fit') - if datamodule.trainer: - datamodule.trainer.training = True - batch = next(iter(datamodule.train_dataloader())) - batch = datamodule.on_after_batch_transfer(batch, 0) - nchannels = 3 if datamodule.kwargs['include_dem'] else 2 - assert batch['image'].shape == (2, nchannels, 8, 8) - assert batch['mask'].shape == (2, 8, 8) - return - - def test_validate_stage(self, datamodule: MMFloodDataModule) -> None: - datamodule.setup(stage='validate') - datamodule.setup(stage='validate') - if datamodule.trainer: - datamodule.trainer.validating = True - batch = next(iter(datamodule.val_dataloader())) - batch = datamodule.on_after_batch_transfer(batch, 0) - nchannels = 3 if datamodule.kwargs['include_dem'] else 2 - assert batch['image'].shape == (2, nchannels, 8, 8) - assert batch['mask'].shape == (2, 8, 8) - return - - def test_test_stage(self, datamodule: MMFloodDataModule) -> None: - datamodule.setup(stage='test') - datamodule.setup(stage='test') - if datamodule.trainer: - datamodule.trainer.testing = True - batch = next(iter(datamodule.test_dataloader())) - batch = datamodule.on_after_batch_transfer(batch, 0) - nchannels = 3 if datamodule.kwargs['include_dem'] else 2 - assert batch['image'].shape == (2, nchannels, 8, 8) - assert batch['mask'].shape == (2, 8, 8) - return diff --git a/tests/datasets/test_mmflood.py b/tests/datasets/test_mmflood.py index 3b004a194f..5649e51c5a 100644 --- a/tests/datasets/test_mmflood.py +++ b/tests/datasets/test_mmflood.py @@ -98,26 +98,3 @@ def test_invalid_query(self, dataset: MMFlood) -> None: IndexError, match='query: .* not found in index with bounds:' ): dataset[query] - - def test_check_folders(self, tmp_path: Path, monkeypatch: MonkeyPatch) -> None: - class MockMMFlood(MMFlood): - def _load_folders( - self, check_folders: bool = False - ) -> list[dict[str, str]]: - return super()._load_folders(check_folders=False) - - dataset_root = os.path.join('tests', 'data', 'mmflood/') - url = os.path.join(dataset_root) - - monkeypatch.setattr(MMFlood, 'url', url) - monkeypatch.setattr(MMFlood, '_nparts', 2) - - _ = MockMMFlood( - tmp_path, - split='train', - include_dem=True, - transforms=nn.Identity(), - download=True, - checksum=True, - ) - return diff --git a/tests/trainers/test_segmentation.py b/tests/trainers/test_segmentation.py index 4bdd966a1b..a21f0e5f4c 100644 --- a/tests/trainers/test_segmentation.py +++ b/tests/trainers/test_segmentation.py @@ -65,6 +65,7 @@ class TestSemanticSegmentationTask: 'landcoverai', 'landcoverai100', 'loveda', + 'mmflood', 'naipchesapeake', 'potsdam2d', 'sen12ms_all', diff --git a/torchgeo/datamodules/mmflood.py b/torchgeo/datamodules/mmflood.py index e669f3c19d..6f4a80babf 100644 --- a/torchgeo/datamodules/mmflood.py +++ b/torchgeo/datamodules/mmflood.py @@ -16,7 +16,10 @@ class MMFloodDataModule(GeoDataModule): - """LightningDataModule implementation for the MMFlood dataset.""" + """LightningDataModule implementation for the MMFlood dataset. + + .. versionadded:: 0.7 + """ # Computed over train set mean = torch.tensor([0.1785585, 0.03574104, 168.45529]) @@ -75,8 +78,6 @@ def __init__( K.Normalize(avg, self.std), keepdim=True, data_keys=None ) - return - def setup(self, stage: str) -> None: """Set up datasets. @@ -98,4 +99,3 @@ def setup(self, stage: str) -> None: self.test_sampler = GridGeoSampler( self.test_dataset, self.patch_size, self.patch_size ) - return diff --git a/torchgeo/datasets/mmflood.py b/torchgeo/datasets/mmflood.py index 2e6fd747ba..2cb30eedba 100644 --- a/torchgeo/datasets/mmflood.py +++ b/torchgeo/datasets/mmflood.py @@ -43,6 +43,8 @@ class MMFlood(RasterDataset): If you use this dataset in your research, please cite the following paper: * https://doi.org/10.1109/ACCESS.2022.3205419 + + .. versionadded:: 0.7 """ url = 'https://huggingface.co/datasets/links-ads/mmflood/resolve/24ca097306c9e50ad0711903c11e1ba13ea1bedc/' @@ -122,12 +124,11 @@ def __init__( # self.image_files, self.label_files, self.dem_files attributes self._verify() self.metadata_df = self._load_metadata() - self.folders = self._load_folders(check_folders=True) + self.folders = self._load_folders() paths = [x['s1_raw'] for x in self.folders] # Build the index super().__init__(paths=paths, crs=crs, transforms=transforms, cache=cache) - return def _merge_tar_files(self) -> None: """Merge part tar gz files.""" @@ -143,7 +144,6 @@ def _merge_tar_files(self) -> None: with open(part_path, 'rb') as part_fp: dst_fp.write(part_fp.read()) - return def __getitem__(self, query: BoundingBox) -> dict[str, Tensor]: """Retrieve image/mask and metadata indexed by query. @@ -194,25 +194,35 @@ def _load_metadata(self) -> pd.DataFrame: ).transpose() return df - def _load_folders(self, check_folders: bool = False) -> list[dict[str, str]]: - """Load folder paths. + def _load_tif_files( + self, check_folders: bool = False, load_all: bool = False + ) -> dict[str, list[str]]: + """Load paths of all tif files for Sentinel-1, DEM and masks. Args: - check_folders: if True, verify pairings of all s1, dem and mask data across all the folders + check_folders: if True, verifies pairings of all s1, dem and mask data across all the folders + load_all: if True, loads all tif files contained in the "activations" folder in the root folder specified. Otherwise, only acquisitions for the given split are loaded. Returns: - list of dicts of s1, dem and masks folder paths + dict containing list of paths, with 'image', 'dem' and 'mask' as keys """ + paths = {} + dirpath = os.path.join(self.root, self.metadata['directory']) # initialize tif file lists containing masks, DEM and S1_raw data - folders = self.metadata_df[ - self.metadata_df['subset'] == self.split - ].index.tolist() + if load_all: + # Get all directories + folders = os.listdir(dirpath) + else: + # Assemble regex for glob + folders = ( + self.metadata_df[self.metadata_df['subset'] == self.split].index + '-*' + ).tolist() image_files = [] mask_files = [] dem_files = [] for f in folders: - path = os.path.join(self.root, self.metadata['directory'], f'{f}-*') + path = os.path.join(self.root, self.metadata['directory'], f) image_files += glob(os.path.join(path, 's1_raw', '*.tif')) mask_files += glob(os.path.join(path, 'mask', '*.tif')) dem_files += glob(os.path.join(path, 'DEM', '*.tif')) @@ -221,34 +231,42 @@ def _load_folders(self, check_folders: bool = False) -> list[dict[str, str]]: mask_files = sorted(mask_files) dem_files = sorted(dem_files) + paths['image'] = image_files + paths['mask'] = mask_files + paths['dem'] = dem_files + # Verify image, dem and mask lengths assert ( - len(image_files) > 0 + len(paths['image']) > 0 ), f'No images found, is the given path correct? ({self.root!s})' assert ( - len(image_files) == len(mask_files) - ), f'Length mismatch between tiles and masks: {len(image_files)} != {len(mask_files)}' - assert len(image_files) == len( - dem_files + len(paths['image']) == len(paths['mask']) + ), f'Length mismatch between tiles and masks: {len(paths['image'])} != {len(paths['mask'])}' + assert len(paths['image']) == len( + paths['dem'] ), 'Length mismatch between tiles and DEMs' + if check_folders: + # Verify image, dem and mask pairings + self._verify_pairings(paths['image'], paths['dem'], paths['mask']) + + return paths + + def _load_folders(self) -> list[dict[str, str]]: + """Load folder paths. + + Returns: + list of dicts of s1, dem and masks folder paths + """ + paths = self._load_tif_files(check_folders=False, load_all=False) + res_folders = [ {'s1_raw': img_path, 'mask': mask_path, 'dem': dem_path} - for img_path, mask_path, dem_path in zip(image_files, mask_files, dem_files) + for img_path, mask_path, dem_path in zip( + paths['image'], paths['mask'], paths['dem'] + ) ] - if not check_folders: - return res_folders - - # Verify image, dem and mask pairings - for image, mask, dem in zip(image_files, mask_files, dem_files): - image_tile = pathlib.Path(image).stem - mask_tile = pathlib.Path(mask).stem - dem_tile = pathlib.Path(dem).stem - assert ( - image_tile == mask_tile == dem_tile - ), f'Filenames not matching: image {image_tile}; mask {mask_tile}; dem {dem_tile}' - return res_folders def _load_image(self, index: list[int], query: BoundingBox) -> Tensor: @@ -299,7 +317,7 @@ def _load_target(self, index: list[int], query: BoundingBox) -> Tensor: the target mask """ tensor = self._load_tif(index, modality='mask', query=query).type(torch.uint8) - return tensor.squeeze(dim=0) + return tensor.long().squeeze(dim=0) def _download(self) -> None: """Download the dataset.""" @@ -323,18 +341,12 @@ def _check_and_download(filename: str, url: str) -> None: _check_and_download( self.metadata['metadata_file'], self.url + self.metadata['metadata_file'] ) - return def _extract(self) -> None: - """Extract the dataset. - - Args: - filepath: path to file to be extracted - """ + """Extract the dataset.""" filepath = os.path.join(self.root, self.metadata['filename']) if str(filepath).endswith('.tar.gz'): extract_archive(filepath) - return def _verify(self) -> None: """Verify the integrity of the dataset.""" @@ -342,13 +354,36 @@ def _verify(self) -> None: metadata_filepath = os.path.join(self.root, self.metadata['metadata_file']) # Check if both metadata file and directory exist if os.path.isdir(dirpath) and os.path.isfile(metadata_filepath): + # Check pairings of all files + _ = self._load_tif_files(check_folders=True, load_all=True) return if not self.download: raise DatasetNotFoundError(self) self._download() self._merge_tar_files() self._extract() - return + + def _verify_pairings( + self, s1_paths: list[str], dem_paths: list[str], mask_paths: list[str] + ) -> None: + """Verify all pairings of Sentinel-1, DEM and mask tif files. All inputs must be sorted. + + Args: + s1_paths: list of paths of Sentinel-1 tif files + dem_paths: list of paths of DEM tif files + mask_paths: list of paths of mask tif files + """ + assert ( + len(s1_paths) == len(dem_paths) == len(mask_paths) + ), f'Lengths of s1, dem and mask files do not match! ({len(s1_paths)}, {len(dem_paths)}, {len(mask_paths)})' + + for image, mask, dem in zip(s1_paths, mask_paths, dem_paths): + image_tile = pathlib.Path(image).stem + mask_tile = pathlib.Path(mask).stem + dem_tile = pathlib.Path(dem).stem + assert ( + image_tile == mask_tile == dem_tile + ), f'Filenames not matching: image {image_tile}; mask {mask_tile}; dem {dem_tile}' def plot( self,