code: def bss_eval_images_framewise(reference_sources, estimated_sources,
                                window=30*44100, hop=15*44100,
                                compute_permutation=False):
      estimated_sources = np.atleast_3d(estimated_sources)
      reference_sources = np.atleast_3d(reference_sources)
      validate(reference_sources, estimated_sources)
      if reference_sources.size == 0 or estimated_sources.size == 0:
          return np.array([]), np.array([]), np.array([]), np.array([])
      nsrc = reference_sources.shape[0]
      nwin = int(
          np.floor((reference_sources.shape[1] - window + hop) / hop)
      )
      if nwin < 2:
          result = bss_eval_images(reference_sources,
                                   estimated_sources,
                                   compute_permutation)
          return [np.expand_dims(score, -1) for score in result]
      sdr = np.empty((nsrc, nwin))
      isr = np.empty((nsrc, nwin))
      sir = np.empty((nsrc, nwin))
      sar = np.empty((nsrc, nwin))
      perm = np.empty((nsrc, nwin))
      for k in range(nwin):
          win_slice = slice(k * hop, k * hop + window)
          ref_slice = reference_sources[:, win_slice, :]
          est_slice = estimated_sources[:, win_slice, :]
          if (not _any_source_silent(ref_slice) and
                  not _any_source_silent(est_slice)):
              sdr[:, k], isr[:, k], sir[:, k], sar[:, k], perm[:, k] = \
                  bss_eval_images(
                      ref_slice, est_slice, compute_permutation
                  )
          else:
              sdr[:, k] = sir[:, k] = sar[:, k] = perm[:, k] = np.nan
      return sdr, isr, sir, sar, perm