Skip to content

Cai pytorch 7 - #1588

Open
manuelpaeza wants to merge 7 commits into
flatironinstitute:devfrom
manuelpaeza:cai-pytorch-7
Open

manuelpaeza wants to merge 7 commits into
flatironinstitute:devfrom
manuelpaeza:cai-pytorch-7

Conversation

@manuelpaeza

Copy link
Copy Markdown
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Improved Mask R-CNN input handling, prediction filtering, checkpoint saving, and protection against overwriting existing training artifacts.
  • Restored the reference training/validation split and updated the training notebook documentation.
  • Fixed VolPy mask contours, the spike-extraction dilation footprint, and initial component display.
  • Fixed CNMF 3D visualization, nested filenames in the Ring CNN demo, and image export and mask processing in the seeded CNMF demo.
  • Updated public demo download URLs and removed machine-specific paths and notebook metadata.
  • Added regression coverage in test_mrcnn.py and test_volpy.py.

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Change sin documentation or new examples for demos and/or cases

Branching

  • All PRs should be made against the dev branch. The main branch is not often merged back to dev.
  • If you want to get your PR out to the world faster (urgent bugfix), poke pgunn to cut a release; this will get it onto github and into conda faster

Has your PR been tested?

If you're fixing a bug or introducing a new feature it is recommended you run the tests by typing

caimanmanager test

and

caimanmanager demotest

prior to submitting your pull request.

Please describe any additional tests that you ran to verify your changes. If they are fast you can also
include them in the folder 'caiman/tests/and name themtest_***.py` so they can be included in our lists of tests.

test_volpy.py included to check on the following: spike extraction creates the correct 2D dilation footprint and The component viewer displays its first component immediately.

Restore the reference VolPy split and shuffled training loader, fix mask contours and morphology, and repair seeded CNMF, Ring CNN and 3D visualization demos. Use public demo downloads and remove machine-specific example metadata. Keep notebook split documentation consistent with configuration.

Validation: user reported caimanmanager test passed on the SSH environment. Python syntax, notebook JSON/output checks and git diff --check passed locally. Demotest was incomplete (process killed with exit 137) and skipped at user request. Temporary comparison and test artifacts are excluded.
Use upstream dilation and OpenCV DFT compatibility fixes. Combine upstream pipeline tests with footprint and initial-view regression tests. Syntax and whitespace checks pass; local pytest collection is blocked by missing pims.
@manuelpaeza
manuelpaeza marked this pull request as draft September 23, 2026 19:26
@manuelpaeza
manuelpaeza marked this pull request as ready for review September 23, 2026 19:26
Comment thread caiman/utils/utils.py Outdated

file_dict = {'mask_rcnn': 'https://caiman.flatironinstitute.org/~neuro/caiman_downloadables/model/mrcnn_epoch_100.pt'}
file_dict = {
'mask_rcnn': (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding a new download key with the new path, leaving the old key/name still available.

@pgunn pgunn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the docs improvements!

# Paths
DATA_DIR = r'~/volpy_training_data/' #Edit to your data directory
MODEL_SAVE_DIR = r'~/volpy_models/' #Edit to your model directory
DATA_DIR = os.path.expanduser(os.environ.get(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this

Comment on lines +13 to +16
import pickle
import warnings

import torch

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep these alphabetical?

" # Paths\n",
" DATASET_PATH = r'~./volpy_training_data/'\n",
" MODEL_SAVE_DIR = r'~/volpy_models/'\n",
" DATA_DIR = caiman_datadir()/volpy_training_data\n",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.path.join() ?

Comment on lines 12 to -17
import matplotlib.pyplot as plt
import os
import sys
import tempfile
import numpy as np
from skimage.color import gray2rgb
import skimage.draw

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we can make these alphabetical (I know they were not before)

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

2 participants