This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This example code is made for describe how to convert OpenCV's Mat class to Boost Numpy's ndarray class and vice versa. | |
* As far as I know, there was some library or boilerplate code about converting Mat to ndarray. But to me those methods were too expensive and difficult to understand. | |
* Recently, I have found that Boost Python has Numpy extension and it gives ndarray class properly. | |
* No other modules are used for conversion, only Boost Python, Boost Numpy, and OpenCV. (Version : Windows7, Python3.5, BoostPython 1.68, OpenCV 4.0.0) | |
* This code is designed to show you a specific case like converting 'CV_8UC3' type Mat image to 'uint8' dtype ndarray. And it contains a minimum of code to explain. | |
* I hope you get the idea of converting ndarray to fit your case properly through this example. | |
*/ | |
#define BOOST_PYTHON_STATIC_LIB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import librosa | |
import matplotlib.pyplot as plt | |
import torch | |
from torchaudio.transforms import MelSpectrogram | |
n_fft = 2048 | |
win_len = None | |
hop_len = 512 | |
n_mels = 128 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |