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

Remove python dependencies #469

Open
3 tasks
hollandjg opened this issue Oct 30, 2024 · 1 comment
Open
3 tasks

Remove python dependencies #469

hollandjg opened this issue Oct 30, 2024 · 1 comment

Comments

@hollandjg
Copy link
Collaborator

When working on the pipeline, I was having trouble with building the docker because of the PyCall dependency. I wanted to see how easy it was to replace PyCall with PythonCall which has a better way of handling dependencies.

Turns out it's also hard:

  • PythonCall doesn't have an obvious way to import a custom file (latlon.py)
  • We have to package that separately, and the import it using Pip in Conda.
  • Using Pip in Conda reinstalls the dependencies from the package installed using Pip.
  • We'd need to make latlon.py into a conda package and push it to a registry to make this easier.

I don't think we should merge this PR – it just makes things complicated in a different way. I think we should do our best to remove the python dependencies from this package.

  • LatLon: Test functionality from JuliaGeo libraries Rasters.jl and Project.jl to replace Python code in getlatlon.py #457
    • We could replace it with something based on Proj.jl (preferred)
    • We could have a separate command-line tool which does the reprojection and read the values in from a flat file
  • Scikit-image: region props:
    • We could have a small command line tool based on a part of ebseg which takes an integer labeled image and produces the region props as we need them
    • We could have a small command line tool (new) which takes in a binary mask and labels the contiguous blocks using integers, and then feed that into the first command line tool.
    • Then we read all the region props back into the julia pipeline
  • Scikit-image: Exposure correction:
    • we could have a small command line tool (new) which does the exposure correction on a full image, and then pass that image back into the main pipeline.

I tried to get around this by updating the Conda environments, but found that by default the PyCall installs python3.12 which isn't compatible with our dependencies.

@danielmwatkins
Copy link
Contributor

We might be able to take advantage of the relatively new Julia wrappers for OpenCV: https://github.com/JuliaImages/OpenCV.jl

This would potentially remove the need to call Python for the skimage stuff, however there may be new issues if the OpenCV bindings don't work well on all systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants