Skip to content

Commit

Permalink
support latest versions of onnxruntime
Browse files Browse the repository at this point in the history
  • Loading branch information
MWieland committed Nov 30, 2022
1 parent 4f5875e commit 9a72276
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The easiest way to install ukis-csmask is through pip. The default installation
pip install ukis-csmask
```

To install ukis-csmask with GPU support run the following instead. This requires that you have a GPU with CUDA runtime libraries (CUDA 10.2 and cuDNN 8.0.3) installed on the system.
To install ukis-csmask with GPU support run the following instead. This requires that you have a GPU with CUDA runtime libraries installed on the system.

```shell
pip install ukis-csmask[gpu]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
numpy
onnxruntime
onnxruntime>=1.13
scipy
4 changes: 2 additions & 2 deletions tests/test_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def test_csmask_valid(data):
csmask = CSmask(img=data["img"], band_order=["Blue", "Green", "Red", "NIR", "SWIR1", "SWIR2"])
y_pred = csmask.valid
y_true = reclassify(data["msk"], {"reclass_value_from": [0, 1, 2, 3, 4], "reclass_value_to": [0, 1, 1, 1, 0]})
y_true_inverted = ~y_true.astype(np.bool)
y_true = (~ndimage.binary_dilation(y_true_inverted, iterations=4).astype(np.bool)).astype(np.uint8)
y_true_inverted = ~y_true.astype(bool)
y_true = (~ndimage.binary_dilation(y_true_inverted, iterations=4).astype(bool)).astype(np.uint8)
y_true = y_true.ravel()
y_pred = y_pred.ravel()
kappa = round(cohen_kappa_score(y_true, y_pred), 2)
Expand Down
4 changes: 2 additions & 2 deletions ukis_csmask/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def _valid(self, invalid_buffer):

# dilate the inverse of the binary valid pixel mask (invalid=0)
# this effectively buffers the invalid pixels
valid_i = ~valid.astype(np.bool)
valid = (~ndimage.binary_dilation(valid_i, iterations=invalid_buffer).astype(np.bool)).astype(np.uint8)
valid_i = ~valid.astype(bool)
valid = (~ndimage.binary_dilation(valid_i, iterations=invalid_buffer).astype(bool)).astype(np.uint8)

if self.nodata_value is not None:
# add image nodata pixels to valid pixel mask
Expand Down

0 comments on commit 9a72276

Please sign in to comment.