Skip to content

Commit 079d563

Browse files
Merge pull request #7 from supathdhitalGEO/main
fixes minor issues, update package with uv compatible
2 parents b213f9e + 15aa70b commit 079d563

52 files changed

Lines changed: 4065 additions & 4163 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ fimeval/
3434
├── src/
3535
│ └── fimeval/
3636
│ ├──BuildingFootprint/ # Contains the evaluation of model predicted FIM with microsoft building footprint
37+
│ │ └── microsoftBF.py
3738
│ │ └── evaluationwithBF.py
3839
│ └── ContingencyMap/ # Contains all the metrics calculation and contingency map generation
3940
│ │ ├── evaluationFIM.py # main evaluation moodule
@@ -59,7 +60,8 @@ This framework is published as a python package in PyPI (https://pypi.org/projec
5960

6061
```bash
6162
#Install to use this framework
62-
pip install fimeval
63+
pip install uv #Makes the downloading much faster
64+
uv pip install fimeval
6365

6466
#Use this framework in your workflows using poetry
6567
poetry add fimeval
@@ -132,17 +134,17 @@ Table 1: Modules in `fimeval` are in order of execution.
132134
| `EvaluateFIM` | It runs all the evaluation of FIM between B-FIM and M-FIMs. | `main_dir`: Main directory containing the case study folders, <br> `method_name`: How users wants to evaluate their FIM, <br> `outpur_dir`: Output directory where all the results and the intermidiate files will be saved for further calculation, <br> *`PWB_dir`*: The permanenet water bodies vectory file directory if user wants to user their own boundary, <br> *`target_crs`*: this fimeval framework needs the floodmaps to be in projected CRS so define the projected CRS in epsg code format, <br> *`target_resolution`*: sometime if the benchmark is very high resolution than candidate FIMs, it needs heavy computational time, so user can define the resolution if there FIMs are in different spatial resolution, else it will use the coarser resolution among all FIMS within that case. |The outputs includes generated files in TIFF, SHP, CSV, and PNG formats, all stored within the output folder. Users can visualize the TIFF files using any geospatial platform. The TIFF files consist of the binary Benchmark-FIM (Benchmark.tif), Model-FIM (Candidate.tif), and Agreement-FIM (Contingency.tif). The shp files contain the boundary of the generated flood extent.|
133135
| `PlotContingencyMap` | For better understanding, It will print the agreement maps derived in first step. | `main_dir`, `method_name`, `output_dir` : Based on the those arguments, once all the evaluation is done, it will dynamically get the corresponding contingency raster for printing.| This prints the contingency map showing different class of evaluation (TP, FP, no data, PWB etc). The outputs look like- Figure 4 first row.|
134136
| `PlotEvaluationMetrics` | For quick understanding of the evaluation metrics, to plot bar of evaluation scores. | `main_dir`, `method_name`, `output_dir` : Based on the those arguments, once all the evaluation is done, it will dynamically get the corresponding file for printing based on all those info.| This prints the bar plots which includes different performance metrics calculated by EvaluateFIM module. The outputs look like- Figure 4 second row.|
135-
| `EvaluationWithBuildingFootprint` | For Building Footprint Analysis, user can specify shapefile of building footprints as .shp or .gpkg format. By default it consider global Microsoft building footprint dataset. Those data are hosted in Google Earth Engine (GEE) so, It pops up to authenticate the GEE account, please allow it and it will download the data based on evaluation boundary and evaluation is done. | `main_dir`, `method_name`, `output_dir`: Those arguments are as it is, same as all other modules. <br> *`building_footprint`*: If user wants to use their own building footprint file then pass the directory here, *`country`*: It is the 3 letter based country ISO code (eg. 'USA', NEP' etc), for the building data automation using GEE based on the evaluation extent, *`shapefile_dir`*: this is the directory of user defined AOI if user is working with their own boundary and automatic Building footprint download and evaluation. | It will calculate the different metrics (e.g. TP, FP, CSI, F1, Accuracy etc) based on hit and miss of building on different M-FIM and B-FIM. Those all metrics will be saved as CSV format in `output_dir` and finally using that info it prints the counts of building foorpint in each FIMs as well as scenario on the evaluation end via bar plot.|
137+
| `EvaluationWithBuildingFootprint` | For Building Footprint Analysis, user can specify shapefile of building footprints as .shp or .gpkg format. By default it consider global Microsoft building footprint dataset. Those data are hosted in Google Earth Engine (GEE) so, It pops up to authenticate the GEE account, please allow it and it will download the data based on evaluation boundary and evaluation is done. | `main_dir`, `method_name`, `output_dir`: Those arguments are as it is, same as all other modules. <br> *`building_footprint`*: If user wants to use their own building footprint file then pass the directory here, *`country`*: It is the 3 letter based country ISO code (eg. 'USA', NEP' etc), for the building data automation using GEE based on the evaluation extent, *`shapefile_dir`*: this is the directory of user defined AOI if user is working with their own boundary and automatic Building footprint download and evaluation, *`geeprojectID`*: this is the google earth engine google cloud project ID, which helps to access the GEE data and resources to work with building footprint download and process. | It will calculate the different metrics (e.g. TP, FP, CSI, F1, Accuracy etc) based on hit and miss of building on different M-FIM and B-FIM. Those all metrics will be saved as CSV format in `output_dir` and finally using that info it prints the counts of building foorpint in each FIMs as well as scenario on the evaluation end via bar plot.|
136138

137139
<p align="center">
138140
<img src="./Images/methodsresults_combined.jpg" width="750" />
139141
</p>
140142

141143
Figure 4: Combined raw output from framework for different two method. First row (subplot a and b) and second row (subplot c and d) is contingency maps and evaluation metrics of FIM derived using `PrintContingencyMaP` and `PlotEvaluationMetrics` module. Third row (subplot e and f) is the output after processing and calculating of evaluation with BF by unsing `EvaluateWithBuildingFoorprint` module.
142144

143-
## 🔧 Installation Instructions
145+
## Installation Instructions
144146

145-
### 1. Prerequisites
147+
### 1. Prerequisites
146148

147149
Before installing `fimeval`, ensure the following software are installed:
148150

@@ -162,28 +164,24 @@ If Anaconda is not installed, download and install it from the [official website
162164

163165
---
164166

165-
### 3. 🌐 Set Up Virtual Environment
167+
### 3. Set Up Virtual Environment
166168

167-
#### 💻 For Mac Users
169+
#### For Mac Users
168170

169171
Open **Terminal** and run:
170172
```bash
171-
172173
# Create a new environment named 'fimeval'
173174
conda create --name fimeval python=3.10
174175

175176
# Activate the environment
176177
conda activate fimeval
177178

178-
# Install Jupyter Notebook
179-
pip install notebook
180-
181179
# Install fimeval package
182-
pip install fimeval
183-
180+
pip install uv
181+
uv pip install fimeval
184182
```
185183

186-
### ☁️ Google Colab Version
184+
### Google Colab Version
187185

188186
To use fimeval in Google Colab, follow the steps below:
189187

@@ -196,7 +194,6 @@ In a new Colab notebook, mount the Google Drive
196194
```bash
197195
pip install fimeval
198196
```
199-
200197
### **Acknowledgements**
201198
| | |
202199
| --- | --- |
-33.6 KB
Binary file not shown.

dist/fimeval-0.1.43.tar.gz

-33.7 KB
Binary file not shown.
-33.6 KB
Binary file not shown.

dist/fimeval-0.1.44.tar.gz

-34.4 KB
Binary file not shown.
-33.6 KB
Binary file not shown.

dist/fimeval-0.1.45.tar.gz

-34.4 KB
Binary file not shown.
-33.7 KB
Binary file not shown.

dist/fimeval-0.1.46.tar.gz

-33.7 KB
Binary file not shown.
-33.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)