Adding a DeepProfiler plugin #183
Replies: 8 comments 12 replies
-
Overall, very nice work! Is there a way to hook into the underlying DeepProfiler code so you can pass locations, etc directly to functions in order to avoid needing to write the CSV, config, etc out to disk so that you can call with subprocess? That might take more time to set up up front but work more smoothly. If not, we can certainly follow this plan! |
Beta Was this translation helpful? Give feedback.
-
Can you explain a bit more the vision of how this would work, given that CellProfiler will still be grouping at the image level? There is an initial implementation of Distributed-DeepProfiler already, it just needs a few hours of debugging to get it "production-ready". |
Beta Was this translation helpful? Give feedback.
-
You might think about making the user just give you a nicely configured file (that you just move/copy if needed), rather than generating on the fly; it's likely not a huge difference either way but just something to consider. |
Beta Was this translation helpful? Give feedback.
-
So here's the first version of RunDeepProfiler. If you could test on a Mac I'd appreciate it; seems like it only works in test mode on Windows (similar to runilastik issue), so hopefully it works on analysis mode on Mac. @callum-jpg @ErinWeisbart @bethac07 The folder with images, pipeline, config and model files: download here If you want just to download rundeepprofiler.py and paste into your already cloned repo here it's: https://github.com/fefossa/CellProfiler-plugins/blob/run-deepprofiler/active_plugins/rundeepprofiler.py Instructions DeepProfiler 1 - Create an environment
2 - Clone CellProfiler-plugins and DeepProfiler
3 - Activate env
4 - Install DeepProfiler
5 - Install CellProfiler and DeepProfiler dependencies Run next to install cellprofiler:
Run next dependencies:
6 - Run CellProfiler Call cellprofiler and see if you can find RunDeeProfiler by adding a new module:
7 - Select the cellprofiler-plugins folder in Preferences > Save 8 - Use the folder with images and files (here) as an example to run the pipeline |
Beta Was this translation helpful? Give feedback.
-
Working in my hands after the edits I put into the PR review, with a definition of "working" that is "gets as far as getting to the actual execution, then barfs because M1 mac doesn't support an old enough version of tensorflow for this to work, and in ~10 minutes of trying to get the tensorflow and keras versions right I gave up". I think we'll likely need/want a Docker - I asked in Slack if one exists, if the answer is no, let's plan to eventually make one, for now this should work at least for Linux/Windows/non-M1 mac. It's worth noting that the plugin didn't warn me that anything had gone wrong, it was only that I noticed I didn't have output files and went looking for them, so I then tried running the subprocess command on its own and then was told about the TF errors. We want to probably capture the results. Will add to my review.
|
Beta Was this translation helpful? Give feedback.
-
As discussed in person, as a naive user I wouldn't expect that the features would be in their own files - I would expect they would show up in CellProfiler measurements. We could think about in a later version of this plugin introducing a switch that allows the users to either leave the files as is, OR have CellProfiler pull in the npz files and put them as "measurements". Since there are so many, that approach also has its issues for as long as we expect our backends will have 2K column limits due to SQLite, but again, that's why we give options. |
Beta Was this translation helpful? Give feedback.
-
A few updates - so I've added the option to show the DeepProfiler features on CellProfiler measurements. Hopefully, that should work now! Also, I had to change the code inside DeepProfiler so it would check if the user is giving a filename or pathname+filename and just add the root path if there's only a filename. This is necessary because otherwise, we would have to create copies of the images as well. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am trying to install this on linux cluster.
Dr Jamila Iqbal| Research Fellow
Griffith Institute for Drug Discovery
Griffith University Nathan Campus, Building N75,
Don Young Rd, NATHAN, Queensland, AUS, 4111
Email: ***@***.***>.***@***.***
…________________________________
From: Fernanda Fossa ***@***.***>
Sent: Tuesday, 19 December 2023 9:20 PM
To: CellProfiler/CellProfiler-plugins ***@***.***>
Cc: Jamila Iqbal ***@***.***>; Mention ***@***.***>
Subject: Re: [CellProfiler/CellProfiler-plugins] Adding a DeepProfiler plugin (Discussion #183)
Hi @jamila-griffith<https://github.com/jamila-griffith>
Are you on Windows or a Mac?
At this time, I was using CellProfiler 4.2.5 - I will test it with 4.2.6 to see if I find something!
—
Reply to this email directly, view it on GitHub<#183 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWG5JZHQTSWRIUQM24XPA4LYKF2A7AVCNFSM6AAAAAAXUSZINSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TQOJWGM3TE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
While meeting with @fefossa we had some thoughts on the GUI inputs to the DeepProfiler plugin and how the run method will work. In essence, the run method will make subprocess calls to DeepProfiler for each image set. We can later build this out to be more DCP friendly, allowing a user to specify an entire image set list (like a load_data_csv or something).
GUI inputs
Run method
6. Run
deepprofiler setup
to create the output files in the save directory7. Copy model to checkpoint dir in deepprofiler setup folders
8. For the input objects, get the object centers in XY
measurements.get_current_measurement("my_objects", "Location_Center_X")
Metadata_Plate/Well_Site_ObjcetName.csv
input/config
folder (created deepprofiler setup)Beta Was this translation helpful? Give feedback.
All reactions