Python vggish_params.PCA_MEANS_NAME Examples

The following are 9 code examples of vggish_params.PCA_MEANS_NAME(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module vggish_params , or try the search function .
Example #1
Source File: vggish_postprocess.py    From Tensorflow-Audio-Classification with Apache License 2.0 6 votes vote down vote up
def __init__(self, pca_params_npz_path):
    """Constructs a postprocessor.

    Args:
      pca_params_npz_path: Path to a NumPy-format .npz file that
        contains the PCA parameters used in postprocessing.
    """
    params = np.load(pca_params_npz_path)
    self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
    # Load means into a column vector for easier broadcasting later.
    self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
    assert self._pca_matrix.shape == (
        vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
            'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
    assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
        'Bad PCA means shape: %r' % (self._pca_means.shape,)) 
Example #2
Source File: vggish_postprocess.py    From yolo_v2 with Apache License 2.0 6 votes vote down vote up
def __init__(self, pca_params_npz_path):
    """Constructs a postprocessor.

    Args:
      pca_params_npz_path: Path to a NumPy-format .npz file that
        contains the PCA parameters used in postprocessing.
    """
    params = np.load(pca_params_npz_path)
    self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
    # Load means into a column vector for easier broadcasting later.
    self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
    assert self._pca_matrix.shape == (
        vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
            'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
    assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
        'Bad PCA means shape: %r' % (self._pca_means.shape,)) 
Example #3
Source File: vggish_postprocess.py    From Gun-Detector with Apache License 2.0 6 votes vote down vote up
def __init__(self, pca_params_npz_path):
    """Constructs a postprocessor.

    Args:
      pca_params_npz_path: Path to a NumPy-format .npz file that
        contains the PCA parameters used in postprocessing.
    """
    params = np.load(pca_params_npz_path)
    self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
    # Load means into a column vector for easier broadcasting later.
    self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
    assert self._pca_matrix.shape == (
        vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
            'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
    assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
        'Bad PCA means shape: %r' % (self._pca_means.shape,)) 
Example #4
Source File: vggish_postprocess.py    From object_detection_kitti with Apache License 2.0 6 votes vote down vote up
def __init__(self, pca_params_npz_path):
    """Constructs a postprocessor.

    Args:
      pca_params_npz_path: Path to a NumPy-format .npz file that
        contains the PCA parameters used in postprocessing.
    """
    params = np.load(pca_params_npz_path)
    self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
    # Load means into a column vector for easier broadcasting later.
    self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
    assert self._pca_matrix.shape == (
        vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
            'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
    assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
        'Bad PCA means shape: %r' % (self._pca_means.shape,)) 
Example #5
Source File: vggish_postprocess.py    From object_detection_with_tensorflow with MIT License 6 votes vote down vote up
def __init__(self, pca_params_npz_path):
    """Constructs a postprocessor.

    Args:
      pca_params_npz_path: Path to a NumPy-format .npz file that
        contains the PCA parameters used in postprocessing.
    """
    params = np.load(pca_params_npz_path)
    self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
    # Load means into a column vector for easier broadcasting later.
    self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
    assert self._pca_matrix.shape == (
        vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
            'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
    assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
        'Bad PCA means shape: %r' % (self._pca_means.shape,)) 
Example #6
Source File: vggish_postprocess.py    From audioset_classification with MIT License 6 votes vote down vote up
def __init__(self, pca_params_npz_path):
    """Constructs a postprocessor.

    Args:
      pca_params_npz_path: Path to a NumPy-format .npz file that
        contains the PCA parameters used in postprocessing.
    """
    params = np.load(pca_params_npz_path)
    self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
    # Load means into a column vector for easier broadcasting later.
    self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
    assert self._pca_matrix.shape == (
        vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
            'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
    assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
        'Bad PCA means shape: %r' % (self._pca_means.shape,)) 
Example #7
Source File: vggish_postprocess.py    From g-tensorflow-models with Apache License 2.0 6 votes vote down vote up
def __init__(self, pca_params_npz_path):
    """Constructs a postprocessor.

    Args:
      pca_params_npz_path: Path to a NumPy-format .npz file that
        contains the PCA parameters used in postprocessing.
    """
    params = np.load(pca_params_npz_path)
    self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
    # Load means into a column vector for easier broadcasting later.
    self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
    assert self._pca_matrix.shape == (
        vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
            'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
    assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
        'Bad PCA means shape: %r' % (self._pca_means.shape,)) 
Example #8
Source File: vggish_postprocess.py    From models with Apache License 2.0 6 votes vote down vote up
def __init__(self, pca_params_npz_path):
    """Constructs a postprocessor.

    Args:
      pca_params_npz_path: Path to a NumPy-format .npz file that
        contains the PCA parameters used in postprocessing.
    """
    params = np.load(pca_params_npz_path)
    self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
    # Load means into a column vector for easier broadcasting later.
    self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
    assert self._pca_matrix.shape == (
        vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
            'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
    assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
        'Bad PCA means shape: %r' % (self._pca_means.shape,)) 
Example #9
Source File: vggish_postprocess.py    From multilabel-image-classification-tensorflow with MIT License 6 votes vote down vote up
def __init__(self, pca_params_npz_path):
    """Constructs a postprocessor.

    Args:
      pca_params_npz_path: Path to a NumPy-format .npz file that
        contains the PCA parameters used in postprocessing.
    """
    params = np.load(pca_params_npz_path)
    self._pca_matrix = params[vggish_params.PCA_EIGEN_VECTORS_NAME]
    # Load means into a column vector for easier broadcasting later.
    self._pca_means = params[vggish_params.PCA_MEANS_NAME].reshape(-1, 1)
    assert self._pca_matrix.shape == (
        vggish_params.EMBEDDING_SIZE, vggish_params.EMBEDDING_SIZE), (
            'Bad PCA matrix shape: %r' % (self._pca_matrix.shape,))
    assert self._pca_means.shape == (vggish_params.EMBEDDING_SIZE, 1), (
        'Bad PCA means shape: %r' % (self._pca_means.shape,))