-
Notifications
You must be signed in to change notification settings - Fork 15
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
Enable loading custom models in the QuPath extension #8
Comments
That sounds great! It looks like the use of an Then hopefully adding more models becomes easy, and doesn't require any change to the extension. |
Hi @constantinpape, thank you for the PR! On the client side (i.e., QuPath), in addition to the preset model options ( I will work on it later today. |
I'm not sure My guess is that the client supporting a list of models returned by the server would be easier to develop and manage, so that any extra URLs are handled when starting up the server. |
Hi @petebankhead, thank you for the feedback. I was expecting that Following your suggestion, I will implement an endpoint for getting a list of the available models on the server side. |
I forgot about PathPrefs.createPersistentJsonPreference() :) |
Thanks for the quick replies @ksugar and @petebankhead! From what I understand you will take care of this for now @ksugar :). Let me know if you need any more info, or once it's ready to be tested! |
Hi @constantinpape and @petebankhead, I have implemented the function for loading custom model weights from URL. Please try qupath-extension-sam-0.4.0-SNAPSHOT.jar with the updated version of samapi from the python -m pip install -U git+https://github.com/ksugar/samapi.git@dev Since this version, it is important to launch the server with export PYTORCH_ENABLE_MPS_FALLBACK=1 # Required for running on Apple silicon
uvicorn samapi.main:app --workers 2 The relevant documentation is found here. |
Thanks @ksugar ! I will try it out as soon as possible and let you know what I find. |
I tested it now @ksugar and it all works as expected! |
Thank you @constantinpape for testing it! I will release it soon.
|
Yes, that would be great! |
Hi @ksugar,
we would like to implement loading of custom SAM models (e.g. from
micro_sam
) in the QuPath plugin.This should be easy on the server side, and I think my PR in ksugar/samapi#11 already adds everything that's necessary there.
But I am not so sure what needs to be changed here. From a quick check I think I would need to add the option for a custom URL here:
qupath-extension-sam/src/main/java/org/elephant/sam/SAMCommand.java
Lines 101 to 102 in 609289d
Is that correct, or is there some other relevant place in the code? Also, how should the default (no custom URL) be represented? In python it's just
None
.Thanks!
The text was updated successfully, but these errors were encountered: