KPLabs commited on
Commit
d846da7
·
verified ·
1 Parent(s): 1005482

Upload 6 files

Browse files

feat: adding models and code

README.MD ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ This is a code for reproducibility of the Bare Soil models
3
+
4
+
5
+ - data / dataset_01_all.parquet - the bare soil dataset
6
+
7
+ - ecml_bare_soil_models.ipynb - bare soil detectors models code, the config for all variants is included in the notebook
8
+
9
+ - ecml_conda.yml - the Anacoda configuration file for the virtual environment we utilized
10
+
11
+ - utils / helpers.py - additional functions, i.e.: for indices computation
12
+
13
+
14
+
15
+
data/dataset_01_all.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c5c436929118d2984b4d2303db198969d2e6c76a98b2933a711b7fd1fdd72dd
3
+ size 312244099
ecml_bare_soil_models.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
ecml_conda.yml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: ecml_bare
2
+ channels:
3
+ - conda-forge
4
+ - defaults
5
+ dependencies:
6
+ - click=8.0.4
7
+ - jupyter=1.0.0
8
+ - pandas=1.4.1
9
+ - plotly=5.6.0
10
+ - pyarrow=8.0.0
11
+ - python=3.9.13
12
+ - scikit-learn=1.1.3
13
+ - scipy=1.9.3
14
+ - seaborn=0.13.2
15
+ - setuptools=59.5.0
16
+ - setuptools-git=1.2
17
+ - statsmodels=0.14.4
18
+ - streamlit=1.10.0
19
+ - tqdm=4.63.0
20
+ - xgboost=1.5.0
21
+ - yaml=0.2.5
22
+ - pip:
23
+ - eli5==0.11.0
24
+ - pytest==7.2.0
utils/__init__.py ADDED
File without changes
utils/helpers.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ import seaborn as sns
3
+ import matplotlib.pyplot as plt
4
+
5
+
6
+ EPS = 1e-10
7
+
8
+
9
+ def set_style() -> None:
10
+ sns.set(font='serif')
11
+ sns.set_style("darkgrid", {
12
+ "font.family": "serif",
13
+ "font.serif": ["umr10", "Times", "Palatino", "serif"]
14
+ })
15
+ plt.rcParams.update({"mathtext.fontset": "cm", "mathtext.rm": "serif"})
16
+
17
+
18
+ # 138, 74, 18, 43
19
+ def bsi(nir, red, blue, green):
20
+ return ((nir+green-(red+blue))/(nir+green+red+blue+EPS))
21
+
22
+
23
+ # 138, 74
24
+ def sr(nir, red):
25
+ return (nir)/(red+EPS)
26
+
27
+
28
+ # 138, 74
29
+ def ndvi(nir, red):
30
+ return (nir-red)/(nir+red+EPS)
31
+
32
+ # 138, 74, 18
33
+ def evi(nir, red, blue):
34
+ return (2.5*(nir-red))/(nir+6*red-7.5*blue+1+EPS)
35
+
36
+
37
+ # 138, 74, 18
38
+ def osavi(nir, red, blue):
39
+ return (nir-red)/(nir+red+0.16+EPS)
40
+
41
+
42
+ def osavi2(nir, red, blue):
43
+ n = improve_img_levels(nir)
44
+ r = improve_img_levels(red)
45
+ b = improve_img_levels(blue)
46
+ return (1+0.16)*((nir-red)/(nir+red+0.16+EPS))