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 diff --git a/src/IceFloeTracker.jl b/src/IceFloeTracker.jl index 7c605e28..c695aa1f 100644 --- a/src/IceFloeTracker.jl +++ b/src/IceFloeTracker.jl @@ -83,12 +83,21 @@ end const IFTVERSION = get_version_from_toml() + const sk_measure = PyNULL() const sk_morphology = PyNULL() const sk_exposure = PyNULL() const getlatlon = PyNULL() +const cv2 = PyNULL() function __init__() + try + copy!(cv2, pyimport("cv2")) + catch e + pyimport("subprocess").run([ + "python", "-m", "pip", "install", "opencv-python==4.9.0.80" + ]) + end skimage = "scikit-image=0.24.0" copy!(sk_measure, pyimport_conda("skimage.measure", skimage)) copy!(sk_exposure, pyimport_conda("skimage.exposure", skimage)) @@ -102,6 +111,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")