Skip to content

Commit

Permalink
Bump dependabot security alerts (opencv, torch, lightning, jupyterlab) (
Browse files Browse the repository at this point in the history
#61)

* Bump opencv-python from 4.7.0.72 to 4.8.1.78

Bumps [opencv-python](https://github.com/opencv/opencv-python) from 4.7.0.72 to 4.8.1.78.
- [Release notes](https://github.com/opencv/opencv-python/releases)
- [Commits](https://github.com/opencv/opencv-python/commits)

---
updated-dependencies:
- dependency-name: opencv-python
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Patched all package versions flagged by dependabot security alerts

* Fixed malpolon.models.standard_prediction_system.predict_point not casting input to gpu correctly for certain data types.
Updated test_examples to correctly run all train, transfer_learning and inference runs

* Updated python package requirements to make the whole project compatible with dependabot security alerts

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: aerodynamic-sauce-pan <[email protected]>
  • Loading branch information
dependabot[bot] and tlarcher authored Sep 8, 2024
1 parent 93fd2c3 commit 9b4245c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def main(cfg: DictConfig) -> None:
test_data_point = test_data_point.resize_(1, *test_data_point.shape)

prediction = model_loaded.predict_point(cfg.run.checkpoint_path,
test_data_point])
test_data_point)
preds, probas = datamodule.predict_logits_to_class(prediction,
datamodule.get_test_dataset().unique_labels)
datamodule.export_predict_csv(preds, probas,
Expand Down
2 changes: 1 addition & 1 deletion malpolon/models/standard_prediction_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def predict_point(
self.load_state_dict(ckpt['state_dict'])
self.model.eval()
with torch.no_grad():
if '__iter__' in dir(data):
if isinstance(data, (tuple, list, set, dict)):
for i, d in enumerate(data):
data[i] = d.to(device) if isinstance(d, torch.Tensor) else d
prediction = self.model(*data)
Expand Down
8 changes: 4 additions & 4 deletions malpolon/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
],
}

# @pytest.mark.skip(reason="Slow or no guarantee of having the data available.")
@pytest.mark.skip(reason="Slow or no guarantee of having the data available.")
def test_train_inference_examples():
ckpt_path = ''
for expe_name, v in EXAMPLE_PATHS.items():
Expand Down Expand Up @@ -304,7 +304,7 @@ def test_train_inference_examples():
print(f'\n{INFO}[INFO] Done. {RESET}')


@pytest.mark.skip(reason="Slow or no guarantee of having the data available.")
# @pytest.mark.skip(reason="Slow or no guarantee of having the data available.")
def test_GLC22_examples():
ckpt_path = ''
for expe_name, v in GLC22_EXAMPLE_PATHS.items():
Expand Down Expand Up @@ -353,7 +353,7 @@ def test_GLC22_examples():
print(f'\n{INFO}[INFO] Done. {RESET}')


# @pytest.mark.skip(reason="Slow or no guarantee of having the data available.")
@pytest.mark.skip(reason="Slow or no guarantee of having the data available.")
def test_GLC23_examples():
ckpt_path = ''
for expe_name, v in GLC23_EXAMPLE_PATHS.items():
Expand Down Expand Up @@ -402,7 +402,7 @@ def test_GLC23_examples():
print(f'\n{INFO}[INFO] Done. {RESET}')


@pytest.mark.skip(reason="Impossible for pytest to run because user input is needed to validate data download.")
# @pytest.mark.skip(reason="Impossible for pytest to run because user input is needed to validate data download.")
def test_GLC24_pre_extracted_examples():
ckpt_path = ''
for expe_name, v in GLC24_PRE_EXTRACTED_EXAMPLE_PATHS.items():
Expand Down
10 changes: 5 additions & 5 deletions requirements_python3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ipykernel==6.18.2
ipython==8.17.2
jupyter==1.0.0
jupyter-server==2.11.2
jupyterlab==3.6.7
jupyterlab==3.6.8
kaggle==1.5.16
lightning==2.0.9.post0
Markdown==3.4.1
Expand All @@ -19,7 +19,7 @@ numpy==1.26.4
odc-geo==0.3.2
odc-stac==0.3.3
omegaconf==2.3.0
opencv-python==4.7.0.72
opencv-python==4.8.1.78
pandas==2.2.1
Pillow==10.3.0
planetary-computer==1.0.0
Expand All @@ -30,7 +30,7 @@ pyproj==3.6.1
pystac==1.6.1
pystac-client==0.5.1
pytest==7.2.2
pytorch-lightning==2.1.0
pytorch-lightning==2.3.3
PyYAML==6.0.1
rasterio==1.3.8.post1
scikit-learn==1.5.0
Expand All @@ -42,10 +42,10 @@ tensorboard==2.14.1
protobuf==4.25
tifffile==2022.10.10
timm==0.9.2
torch==2.1.0
torch==2.2.0
torchgeo==0.5.0
torchmetrics==1.2.0
torchvision==0.16.0
torchvision==0.17.0
tqdm==4.66.3
verde==1.8.0
yarl==1.9.2

0 comments on commit 9b4245c

Please sign in to comment.