SaeidDadkhah / Shot-Boundary-Detection

Shot boundary detection (SBD) python program: Internship (Summer 2016) project
33 stars 9 forks source link

Matrix must be 2d error #5

Open the0dark0one opened 1 year ago

the0dark0one commented 1 year ago

I've just downloaded your code and Python 3.11. This is the output while trying to detect boundaries of an mov. Thoughts?

C:\Shot-Boundary-Detection-master>py SBDGUI.py C:\Program Files\Python\Lib\site-packages\numpy\matrixlib\defmatrix.py:145: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. arr = N.array(data, dtype=dtype, copy=copy) Exception ignored in thread started by: <bound method ShotBoundaryDetection.detect of <ShotBoundaryDetection.ShotBoundaryDetection object at 0x0000017C1F299990>> Traceback (most recent call last): File "C:\Shot-Boundary-Detection-master\ShotBoundaryDetection.py", line 351, in detect cuts, gradual_transitions = self.detect_multi_step_comparison_scheme(set_progress=set_progress) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Shot-Boundary-Detection-master\ShotBoundaryDetection.py", line 303, in detect_multi_step_comparison_scheme phi, eta = calc_phi_eta(cut_l) ^^^^^^^^^^^^^^^^^^^ File "C:\Shot-Boundary-Detection-master\ShotBoundaryDetection.py", line 215, in calc_phi_eta mu = np.matrix(mu) ^^^^^^^^^^^^^ File "C:\Program Files\Python\Lib\site-packages\numpy\matrixlib\defmatrix.py", line 149, in new raise ValueError("matrix must be 2-dimensional") ValueError: matrix must be 2-dimensional

jiangzihan2002 commented 1 year ago
        def calc_local_mean():
            start_l = n - 2 * alg_atr_l
            start_l = start_l if start_l > 0 else 0
            end_l = n + 2 * alg_atr_l
            end_l = end_l if end_l < len(sigma) else len(sigma)
            two_summation = np.sum(sigma[range(start_l, end_l)])
            two_summation = np.sum(two_summation)
            return two_summation / ((end_l - start_l + 1) * (alg_atr_l + 1))
SaeidDadkhah commented 1 year ago

Hi @the0dark0one, I developed this module long ago, and I don't maintain it anymore. I hope @jiangzihan2002 's comment works for you.