Changed from len(index.shape) to index.ndim
This commit is contained in:
parent
4a6c02627a
commit
f2806ca3ca
@ -99,9 +99,9 @@ def shifted_correlation(
|
|||||||
return get_correlation(frames, start_frame, index, shifted_idx)
|
return get_correlation(frames, start_frame, index, shifted_idx)
|
||||||
else:
|
else:
|
||||||
index = selector(frames[start_frame])
|
index = selector(frames[start_frame])
|
||||||
if len(index.shape) == 1:
|
if index.ndim == 1:
|
||||||
return get_correlation(frames, start_frame, index, shifted_idx)
|
return get_correlation(frames, start_frame, index, shifted_idx)
|
||||||
elif len(index.shape) == 2:
|
elif index.ndim == 2:
|
||||||
correlations = []
|
correlations = []
|
||||||
for ind in index:
|
for ind in index:
|
||||||
correlations.append(
|
correlations.append(
|
||||||
@ -110,7 +110,7 @@ def shifted_correlation(
|
|||||||
return correlations
|
return correlations
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Index list of selector has {len(index.shape)} dimensions, "
|
f"Index list of selector has {index.ndim} dimensions, "
|
||||||
"but should have 1 or 2"
|
"but should have 1 or 2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user