From 46946b2bde0bc463ee181b77acb423a27163a433 Mon Sep 17 00:00:00 2001 From: cpaniaguam Date: Mon, 11 Nov 2024 14:37:54 -0500 Subject: [PATCH 1/4] feat: add cv2 via pip --- src/IceFloeTracker.jl | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/IceFloeTracker.jl b/src/IceFloeTracker.jl index bab74d73..e92c4014 100644 --- a/src/IceFloeTracker.jl +++ b/src/IceFloeTracker.jl @@ -78,15 +78,16 @@ include("imcomplement.jl") const sk_measure = PyNULL() const sk_exposure = PyNULL() const getlatlon = PyNULL() - -function get_version_from_toml(pth=dirname(dirname(pathof(IceFloeTracker))))::VersionNumber - toml = TOML.parsefile(joinpath(pth, "Project.toml")) - return VersionNumber(toml["version"]) -end - -const IFTVERSION = get_version_from_toml() +const cv2 = PyNull function __init__() + try + copy!(cv2, pyimport("cv2")) + catch e + pyimport("subprocess").run([ + "python", "-m", "pip", "install", "opencv-python==4.10.0.84" + ]) + end copy!(sk_measure, pyimport_conda("skimage.measure", "scikit-image=0.24.0")) copy!(sk_exposure, pyimport_conda("skimage.exposure", "scikit-image=0.24.0")) pyimport_conda("pyproj", "pyproj=3.6.0") @@ -98,6 +99,14 @@ function __init__() return nothing end +function get_version_from_toml(pth=dirname(dirname(pathof(IceFloeTracker))))::VersionNumber + toml = TOML.parsefile(joinpath(pth, "Project.toml")) + return VersionNumber(toml["version"]) +end + +const IFTVERSION = get_version_from_toml() + + include("regionprops.jl") include("segmentation_a_direct.jl") include("segmentation_b.jl") From 5ec8d333ed653695fca8f6929dc75ae6d536a9cd Mon Sep 17 00:00:00 2001 From: cpaniaguam Date: Mon, 11 Nov 2024 14:52:04 -0500 Subject: [PATCH 2/4] fix: PyNull --- src/IceFloeTracker.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IceFloeTracker.jl b/src/IceFloeTracker.jl index e92c4014..2e8701bc 100644 --- a/src/IceFloeTracker.jl +++ b/src/IceFloeTracker.jl @@ -78,7 +78,7 @@ include("imcomplement.jl") const sk_measure = PyNULL() const sk_exposure = PyNULL() const getlatlon = PyNULL() -const cv2 = PyNull +const cv2 = PyNULL() function __init__() try From f027c954cd51c80fba8b65305918b3de672c9e5f Mon Sep 17 00:00:00 2001 From: Carlos Paniagua Date: Tue, 12 Nov 2024 15:23:19 -0500 Subject: [PATCH 3/4] fix: cv2 4.9.0.80 --- src/IceFloeTracker.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IceFloeTracker.jl b/src/IceFloeTracker.jl index 2e8701bc..b99e11c0 100644 --- a/src/IceFloeTracker.jl +++ b/src/IceFloeTracker.jl @@ -85,7 +85,7 @@ function __init__() copy!(cv2, pyimport("cv2")) catch e pyimport("subprocess").run([ - "python", "-m", "pip", "install", "opencv-python==4.10.0.84" + "python", "-m", "pip", "install", "opencv-python==4.9.0.80" ]) end copy!(sk_measure, pyimport_conda("skimage.measure", "scikit-image=0.24.0")) From b69880285e8f1130fa3e20c9b6d3a750d3a55a14 Mon Sep 17 00:00:00 2001 From: Carlos Paniagua Date: Tue, 12 Nov 2024 15:24:56 -0500 Subject: [PATCH 4/4] Update requirements.txt --- requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index d42bbdb8..355bef64 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ +opencv-python==4.9.0.80 jinja2==3.1 -numpy==1.23.2 pandas==2.1 -pyproj==3.6.0 +pyproj==3.7.0 rasterio==1.3.7 -scikit-image==0.20.0 +scikit-image==0.24.0 requests==2.31.0 -skyfield==1.45.0 \ No newline at end of file +skyfield==1.45.0