Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cv2 via pip #508

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
skyfield==1.45.0
17 changes: 17 additions & 0 deletions src/IceFloeTracker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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")
Expand Down
Loading