findpeaks is for the detection of peaks and valleys in a 1D vector and 2D array (image).
pip install findpeaks