dchaley / deepcell-imaging

Tools & guidance to scale DeepCell imaging on Google Cloud Batch
8 stars 2 forks source link

Improve deep_watershed memory usage #359

Open dchaley opened 1 month ago

dchaley commented 1 month ago

Part of: #322

Issues we've identified:

  1. Float32 → Float64 copy The scikit watershed function creates a full copy of the input as type float64. We think this is because the cython code only works on float64. So, it has to do this.

DeepCell seems to use float32, so we're creating a copy just to add precision that's not there…

  1. Watershed makes copy of markers (but original is unused) The deep_watershed function passes the markers into the watershed function, which then creates another copy (the output buffer). Neither use the original copy. That means we're holding on to a full copy through watershed even though we don't need to.