Visitar URL original
Miscellaneous imports and code fixes by C-Achard · Pull Request #3411 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0b3e0f3
Fix bone likelihood in analyzebone to use both bodyparts
claude Jul 15, 2026
b253a90
Fix SORTSkeleton removing the wrong tracker on cleanup
claude Jul 15, 2026
8fed1c4
Fix CTD tracklet-age reset writing to a non-existent attribute
claude Jul 15, 2026
05c3e1f
Fix destfolder leaking across videos in filter/skeleton loops
claude Jul 15, 2026
44b61a6
Fix except clause catching a ValueError instance instead of the type
claude Jul 15, 2026
3e577d3
Import scipy.ndimage functions directly (drop removed measurements na…
claude Jul 15, 2026
7e5ce73
Replace removed np.object alias with builtin object
claude Jul 15, 2026
5b93ead
Fix operator precedence in condition NaN/non-positive mask
claude Jul 15, 2026
b79c7f9
Fix scipy.stats.mode usage for keepdims=False default (scipy>=1.11)
claude Jul 15, 2026
e374837
Merge branch 'main' into fix/skeleton-bone-likelihood
Denny-Hwang Jul 15, 2026
b2d21cb
Merge pull request #3401 from Denny-Hwang/fix/skeleton-bone-likelihood
C-Achard Jul 16, 2026
c94fdd0
Merge pull request #3405 from Denny-Hwang/fix/except-valueerror-call
C-Achard Jul 16, 2026
cffb979
Merge pull request #3406 from Denny-Hwang/fix/scipy-ndimage-measurements
C-Achard Jul 16, 2026
252cf16
Merge pull request #3407 from Denny-Hwang/fix/np-object-removed
C-Achard Jul 16, 2026
e0f4abf
Merge pull request #3409 from Denny-Hwang/fix/scipy-mode-keepdims
C-Achard Jul 16, 2026
2271e6d
Merge pull request #3408 from Denny-Hwang/fix/conds-mask-precedence
C-Achard Jul 16, 2026
3755158
Merge pull request #3403 from Denny-Hwang/fix/sortskeleton-pop-index
C-Achard Jul 16, 2026
d35dd81
Merge pull request #3404 from Denny-Hwang/fix/ctd-track-ages-reset
C-Achard Jul 16, 2026
f726fb7
Merge pull request #3410 from Denny-Hwang/fix/destfolder-per-video
C-Achard Jul 16, 2026
bc940fa
Merge branch 'main' into external/hwang-misc-fixes
C-Achard Jul 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Import scipy.ndimage functions directly (drop removed measurements na…
…mespace)

predict_multianimal.py imported 'from scipy.ndimage import
measurements'. The scipy.ndimage.measurements submodule was deprecated
in scipy 1.8 and removed in scipy 1.14; since the project pins
scipy>=1.9 with no upper bound, a fresh install resolves a scipy where
this import raises ImportError at module load. Because the module is
imported at the top of the TensorFlow multi-animal inference path,
analyze_videos on a TF maDLC project failed immediately on import.

Import label and center_of_mass directly from scipy.ndimage (their
canonical public location) and call them without the measurements
prefix.
  • Loading branch information
claude committed Jul 15, 2026
commit 3e577d398a4f4013a5e6d05b5f42cac180824553
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import numpy as np
import tensorflow as tf
from scipy.ndimage import measurements
from scipy.ndimage import center_of_mass, label
from skimage.feature import peak_local_max


Expand Down Expand Up @@ -262,8 +262,8 @@ def find_local_maxima(scmap, radius, threshold):
peak_idx = peak_local_max(scmap, min_distance=radius, threshold_abs=threshold, exclude_border=False)
grid = np.zeros_like(scmap, dtype=bool)
grid[tuple(peak_idx.T)] = True
labels = measurements.label(grid)[0]
xy = measurements.center_of_mass(grid, labels, range(1, np.max(labels) + 1))
labels = label(grid)[0]
xy = center_of_mass(grid, labels, range(1, np.max(labels) + 1))
return np.asarray(xy, dtype=int).reshape((-1, 2))


Expand Down
Loading