-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
When optimizing for GPU, (C, H, W) gives contigent memory if we transfer data between GPU and CPU. But we currently use (H, W, C) to save image.
The following is the potential plan, but we do not have to implement it right now.
Implementation: Change codex_patches.py to save/load as (C, H, W) instead of (H, W, C)
Current: patch_img[:, :, idx] → non-contiguous
Proposed: patch_img[idx, :, :] → contiguous!
Pros:
- Zero runtime overhead - slices are naturally contiguous
- Most efficient long-term solution
Cons:
- Breaking change - existing saved patches incompatible
- Requires re-running segmentation or migration code
- Many libraries expect (H, W, C): scikit-image, matplotlib, OpenCV
- Segmentation models (DeepCell) expect (H, W, C) input
- High risk of bugs throughout pipeline
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels