Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@

# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
.idea/

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# End of https://www.toptal.com/developers/gitignore/api/python
10 changes: 10 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[LOGGING]

# Format style used to check logging format string. `old` means using %
# formatting, while `new` is for `{}` formatting.
#logging-format-style=fstr

[MESSAGE CONTROL]
disable=
logging-fstring-interpolation,
logging-format-interpolation
17 changes: 17 additions & 0 deletions README-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# DSen2
## Setup
Create a new virtual environment e.g. using [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/):
```bash
mkvirtualenv --python=$(which python3.7) dsen2
```
Install requirements:
```bash
pip install -r requirements.txt
pip install -r requirements-dev.txt
```

## Testing
To run tests:
```bash
bash test.sh
```
15 changes: 15 additions & 0 deletions S2L1C_test_img_ids.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
S2B_MSIL1C_20200131T050029_N0208_R119_T45RTK_20200131T074329
S2B_MSIL1C_20200101T082239_N0208_R121_T34HCJ_20200101T102510
S2B_MSIL1C_20200103T024319_N0208_R003_T49JFM_20200103T054632
S2B_MSIL1C_20200112T143449_N0208_R139_T23VMG_20200112T162018
S2B_MSIL1C_20200116T155609_N0208_R054_T18TVK_20200116T192635
S2B_MSIL1C_20200112T144659_N0208_R139_T19LED_20200112T181024
S2B_MSIL1C_20200210T064019_N0209_R120_T43WEP_20200210T102521
S2B_MSIL1C_20200105T132229_N0208_R038_T22JEP_20200105T140318
S2A_MSIL1C_20200102T223701_N0208_R072_T59GLM_20200102T233015
S2B_MSIL1C_20200117T102249_N0208_R065_T33UVA_20200117T113858
S2B_MSIL1C_20200112T111329_N0208_R137_T30UWB_20200112T114220
S2B_MSIL1C_20200131T050029_N0208_R119_T45RTK_20200131T074329
S2A_MSIL1C_20200104T160641_N0208_R097_T16PET_20200104T193742
S2A_MSIL1C_20200105T021051_N0208_R103_T52SEC_20200105T040308
S2A_MSIL1C_20200104T074311_N0208_R092_T37NDF_20200104T092554
44 changes: 44 additions & 0 deletions S2L1C_training_img_ids.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
S2B_MSIL1C_20200708T070629_N0209_R106_T39RVJ_20200708T100303
S2A_MSIL1C_20200620T183921_N0209_R070_T11UQV_20200620T222330
S2B_MSIL1C_20200702T032539_N0209_R018_T47NQG_20200702T070403
S2A_MSIL1C_20200622T155911_N0209_R097_T17RMN_20200622T211519
S2A_MSIL1C_20200228T135111_N0209_R024_T22MDE_20200228T153108
S2B_MSIL1C_20200509T022329_N0209_R103_T51PVN_20200509T035328
S2A_MSIL1C_20200702T092031_N0209_R093_T34SFH_20200702T105153
S2A_MSIL1C_20200513T023551_N0209_R089_T50RQV_20200513T042651
S2A_MSIL1C_20200623T103031_N0209_R108_T32TLT_20200623T124659
S2B_MSIL1C_20200322T110639_N0209_R137_T28PGQ_20200322T131534
S2A_MSIL1C_20200527T185921_N0209_R013_T10TER_20200528T002151
S2A_MSIL1C_20200707T071211_N0209_R020_T38KNF_20200707T095401
S2B_MSIL1C_20200706T180919_N0209_R084_T12SUF_20200706T214131
S2B_MSIL1C_20200707T092029_N0209_R093_T33QYE_20200707T114047
S2B_MSIL1C_20200518T143729_N0209_R096_T19HCC_20200518T175905
S2A_MSIL1C_20200703T170901_N0209_R112_T14SPB_20200703T204911
S2B_MSIL1C_20200119T131859_N0208_R095_T19DFF_20200119T142732
S2A_MSIL1C_20200628T000251_N0209_R030_T56HKH_20200628T012541
S2A_MSIL1C_20200427T035541_N0209_R004_T48UXU_20200427T065744
S2A_MSIL1C_20200708T075611_N0209_R035_T38UMU_20200708T093146
S2B_MSIL1C_20200624T040549_N0209_R047_T47SNB_20200624T065011
S2B_MSIL1C_20200302T093029_N0209_R136_T32MPE_20200302T115907
S2A_MSIL1C_20200705T074621_N0209_R135_T37QED_20200705T095040
S2A_MSIL1C_20200610T003711_N0209_R059_T55LBD_20200610T021551
S2A_MSIL1C_20200610T003711_N0209_R059_T54HUG_20200610T021551
S2A_MSIL1C_20200518T101031_N0209_R022_T33UVR_20200518T121146
S2B_MSIL1C_20200703T161829_N0209_R040_T17TLH_20200703T195539
S2A_MSIL1C_20200706T141741_N0209_R010_T18FXG_20200706T174147
S2A_MSIL1C_20200704T151711_N0209_R125_T19PCN_20200704T183937
S2B_MSIL1C_20200705T140059_N0209_R067_T21LYJ_20200705T171900
S2B_MSIL1C_20200620T060639_N0209_R134_T42SWH_20200620T085814
S2B_MSIL1C_20200707T105619_N0209_R094_T30SVH_20200707T130404
S2B_MSIL1C_20200705T165849_N0209_R069_T14RNN_20200705T203718
S2B_MSIL1C_20200703T161829_N0209_R040_T17UPT_20200703T195539
S2A_MSIL1C_20200627T032541_N0209_R018_T48QWH_20200627T062952
S2B_MSIL1C_20200708T170849_N0209_R112_T15TTF_20200708T203645
S2A_MSIL1C_20200628T013721_N0209_R031_T52LEH_20200628T030413
S2A_MSIL1C_20200126T032011_N0208_R118_T48NUG_20200126T061348
S2A_MSIL1C_20200524T052651_N0209_R105_T43QCA_20200524T090700
S2B_MSIL1C_20200703T112119_N0209_R037_T29SNC_20200703T132109
S2A_MSIL1C_20200702T092031_N0209_R093_T34SDA_20200702T112247
S2A_MSIL1C_20200622T105631_N0209_R094_T30TXQ_20200622T130553
S2A_MSIL1C_20200402T050601_N0209_R076_T44NNN_20200402T074005
S2B_MSIL1C_20200509T102559_N0209_R108_T32TMT_20200509T124301
15 changes: 15 additions & 0 deletions S2L2A_test_img_ids.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
S2B_MSIL2A_20200805T044709_N0214_R076_T45RTK_20200805T090405
S2B_MSIL2A_20200808T081609_N0214_R121_T34HDK_20200808T122511
S2A_MSIL2A_20200805T024331_N0214_R003_T49JEN_20200805T042709
S2B_MSIL2A_20200806T141739_N0214_R096_T23VNH_20200806T164315
S2A_MSIL2A_20200805T153911_N0214_R011_T18TWK_20200805T200607
S2B_MSIL2A_20200809T144729_N0214_R139_T19LFE_20200809T190255
S2A_MSIL2A_20200806T064631_N0214_R020_T43WEP_20200806T083125
S2A_MSIL2A_20200807T132241_N0214_R038_T22JFP_20200807T154317
S2A_MSIL2A_20200809T223721_N0214_R072_T59GMN_20200810T002854
S2A_MSIL2A_20200809T102031_N0214_R065_T33UWA_20200809T130506
S2B_MSIL2A_20200809T110629_N0214_R137_T30UXC_20200809T140506
S2B_MSIL2A_20200805T044709_N0214_R076_T45RTK_20200805T090405
S2A_MSIL2A_20200804T160911_N0214_R140_T16PET_20200804T215526
S2B_MSIL2A_20200804T015659_N0214_R060_T52SED_20200804T044656
S2A_MSIL2A_20200801T073621_N0214_R092_T37NCE_20200801T102406
44 changes: 44 additions & 0 deletions S2L2A_training_img_ids.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
S2B_MSIL2A_20200119T131859_N0213_R095_T19DFF_20200119T145349
S2A_MSIL2A_20200126T032011_N0213_R118_T48NUG_20200126T071110
S2A_MSIL2A_20200228T135111_N0214_R024_T22MDE_20200228T162124
S2B_MSIL2A_20200302T093029_N0214_R136_T32MPE_20200302T124106
S2B_MSIL2A_20200322T110639_N0214_R137_T28PGQ_20200322T140428
S2A_MSIL2A_20200402T050601_N0214_R076_T44NNN_20200402T080805
S2A_MSIL2A_20200427T035541_N0214_R004_T48UXU_20200427T080955
S2A_MSIL2A_20200513T023551_N0214_R089_T50RQV_20200513T045417
S2A_MSIL2A_20200518T101031_N0214_R022_T33UVR_20200518T130110
S2B_MSIL2A_20200518T143729_N0214_R096_T19HCC_20200518T184649
S2A_MSIL2A_20200524T052651_N0214_R105_T43QCA_20200524T094211
S2A_MSIL2A_20200527T185921_N0214_R013_T10TER_20200528T010342
S2B_MSIL2A_20200509T022329_N0214_R103_T51PVN_20200509T041832
S2B_MSIL2A_20200509T102559_N0214_R108_T32TMT_20200509T135055
S2A_MSIL2A_20200610T003711_N0214_R059_T54HUG_20200610T032520
S2A_MSIL2A_20200610T003711_N0214_R059_T55LBD_20200610T032520
S2A_MSIL2A_20200620T183921_N0214_R070_T11UQV_20200620T232224
S2B_MSIL2A_20200620T060639_N0214_R134_T42SWH_20200620T095034
S2A_MSIL2A_20200622T105631_N0214_R094_T30TXQ_20200622T135503
S2A_MSIL2A_20200622T155911_N0214_R097_T17RMN_20200622T222624
S2A_MSIL2A_20200623T103031_N0214_R108_T32TLT_20200623T142851
S2B_MSIL2A_20200624T040549_N0214_R047_T47SNB_20200624T074104
S2A_MSIL2A_20200627T032541_N0214_R018_T48QWH_20200627T073329
S2A_MSIL2A_20200628T000251_N0214_R030_T56HKH_20200628T020102
S2A_MSIL2A_20200628T013721_N0214_R031_T52LEH_20200628T033123
S2A_MSIL2A_20200702T092031_N0214_R093_T34SDA_20200702T121048
S2A_MSIL2A_20200702T092031_N0214_R093_T34SFH_20200702T114806
S2B_MSIL2A_20200702T032539_N0214_R018_T47NQG_20200702T073845
S2A_MSIL2A_20200703T170901_N0214_R112_T14SPB_20200703T213059
S2B_MSIL2A_20200703T112119_N0214_R037_T29SNC_20200703T140926
S2B_MSIL2A_20200703T161829_N0214_R040_T17TLH_20200703T203651
S2B_MSIL2A_20200703T161829_N0214_R040_T17UPT_20200703T203651
S2A_MSIL2A_20200704T151711_N0214_R125_T19PCN_20200704T192121
S2A_MSIL2A_20200705T074621_N0214_R135_T37QED_20200705T103234
S2B_MSIL2A_20200705T140059_N0214_R067_T21LYJ_20200705T180214
S2B_MSIL2A_20200705T165849_N0214_R069_T14RNN_20200705T211456
S2A_MSIL2A_20200706T141741_N0214_R010_T18FXG_20200706T183007
S2B_MSIL2A_20200706T180919_N0214_R084_T12SUF_20200706T222223
S2A_MSIL2A_20200707T071211_N0214_R020_T38KNF_20200707T102832
S2B_MSIL2A_20200707T092029_N0214_R093_T33QYE_20200707T122716
S2B_MSIL2A_20200707T105619_N0214_R094_T30SVH_20200707T135135
S2A_MSIL2A_20200708T075611_N0214_R035_T38UMU_20200708T111246
S2B_MSIL2A_20200708T070629_N0214_R106_T39RVJ_20200708T111714
S2B_MSIL2A_20200708T170849_N0214_R112_T15TTF_20200708T210844
Binary file added models/aesr_20m_s2_038_lr_1e-04.hdf5
Binary file not shown.
Binary file added models/aesr_60m_s2_038_lr_1e-04.hdf5
Binary file not shown.
44 changes: 44 additions & 0 deletions pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[MASTER]
init-hook='import glob; [sys.path.append(d) for d in glob.glob("*/") if not d.startswith("_")]'

[MESSAGE CONTROL]
disable=
missing-docstring,
no-else-return,
too-few-public-methods,
missing-final-newline,
too-many-boolean-expressions,
bad-continuation,
invalid-name,
super-init-not-called,
inconsistent-return-statements,
too-many-arguments,
too-many-locals,
protected-access,
redefined-outer-name,
too-many-instance-attributes,
fixme,
wrong-import-position,
logging-fstring-interpolation,
logging-format-interpolation

[FORMAT]
max-line-length=120
single-line-if-stmt=yes
include-naming-hint=yes
function-rgx=[a-z_][a-z0-9_]*$
argument-rgx=[a-z_][a-z0-9_]*$
variable-rgx=[a-z_][a-z0-9_]*$
# "logger" and "api" are common module-level globals, and not true 'constants'
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__)|logger|api|_api)$

[DESIGN]
max-args=6
ignored-argument-names=_.*|self

[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=20 # TODO: Reset lower when pylint bug fixed #214.
ignore-comments=yes
ignore-docstrings=yes
ignore-imports=no
10 changes: 10 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
black
pylint==2.5.0
pytest
pytest-pylint
pytest-sugar
mypy
mypy-extensions
pytest-cov
pytest-mypy
coverage-badge
11 changes: 11 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
numpy
tensorflow
keras
scikit-image
imageio
rasterio
pyproj
matplotlib
pydot
up42-blockutils
image-similarity-measures
8 changes: 8 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

rm -r .pytest_cache
black .
python -m pytest --pylint --pylint-rcfile=pylintrc --mypy --mypy-ignore-missing-imports --durations=5
coverage-badge -f -o coverage.svg
RET_VALUE=$?
exit $RET_VALUE
Loading