Spaces:
Sleeping
Sleeping
Merge pull request #15 from moriyalab/fix
Browse files- lab_tools/spectrogram.py +2 -2
- release_launch.sh +37 -0
- run_dev_env.sh +1 -1
lab_tools/spectrogram.py
CHANGED
|
@@ -44,8 +44,8 @@ def stft_plot_spectrogram(data, Fs, N, freq_limit=None):
|
|
| 44 |
amp = np.abs(Zxx)
|
| 45 |
amp[amp == 0] = np.finfo(float).eps
|
| 46 |
fig, ax = plt.subplots(figsize=(12, 6))
|
| 47 |
-
spectrogram = ax.pcolormesh(times, freqs,
|
| 48 |
-
fig.colorbar(spectrogram, ax=ax, orientation="vertical").set_label("Amplitude
|
| 49 |
ax.set_xlabel("Time [s]")
|
| 50 |
ax.set_ylabel("Frequency [Hz]")
|
| 51 |
if freq_limit:
|
|
|
|
| 44 |
amp = np.abs(Zxx)
|
| 45 |
amp[amp == 0] = np.finfo(float).eps
|
| 46 |
fig, ax = plt.subplots(figsize=(12, 6))
|
| 47 |
+
spectrogram = ax.pcolormesh(times, freqs, amp, shading="auto", vmin=0, vmax=5)
|
| 48 |
+
fig.colorbar(spectrogram, ax=ax, orientation="vertical").set_label("Amplitude")
|
| 49 |
ax.set_xlabel("Time [s]")
|
| 50 |
ax.set_ylabel("Frequency [Hz]")
|
| 51 |
if freq_limit:
|
release_launch.sh
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# https://qiita.com/k_ikasumipowder/items/5e71208b7c7ae3e4fe7c
|
| 4 |
+
|
| 5 |
+
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
| 6 |
+
|
| 7 |
+
# Prevent running as root.
|
| 8 |
+
if [[ $(id -u) -eq 0 ]]; then
|
| 9 |
+
echo "This script cannot be executed with root privileges."
|
| 10 |
+
echo "Please re-run without sudo and follow instructions to configure docker for non-root user if needed."
|
| 11 |
+
exit 1
|
| 12 |
+
fi
|
| 13 |
+
|
| 14 |
+
# Check if user can run docker without root.
|
| 15 |
+
RE="\<docker\>"
|
| 16 |
+
if [[ ! $(groups $USER) =~ $RE ]]; then
|
| 17 |
+
echo "User |$USER| is not a member of the 'docker' group and cannot run docker commands without sudo."
|
| 18 |
+
echo "Run 'sudo usermod -aG docker \$USER && newgrp docker' to add user to 'docker' group, then re-run this script."
|
| 19 |
+
echo "See: https://docs.docker.com/engine/install/linux-postinstall/"
|
| 20 |
+
exit 1
|
| 21 |
+
fi
|
| 22 |
+
|
| 23 |
+
# Check if able to run docker commands.
|
| 24 |
+
if [[ -z "$(docker ps)" ]] ; then
|
| 25 |
+
echo "Unable to run docker commands. If you have recently added |$USER| to 'docker' group, you may need to log out and log back in for it to take effect."
|
| 26 |
+
echo "Otherwise, please check your Docker installation."
|
| 27 |
+
exit 1
|
| 28 |
+
fi
|
| 29 |
+
|
| 30 |
+
PLATFORM="$(uname -m)"
|
| 31 |
+
|
| 32 |
+
if [ $PLATFORM = "x86_64" ]; then
|
| 33 |
+
docker pull ghcr.io/moriyalab/lab_tool:latest
|
| 34 |
+
docker run --rm -p 7860:7860 ghcr.io/moriyalab/lab_tool:latest
|
| 35 |
+
else
|
| 36 |
+
echo "Not Support Platform. Only support x86."
|
| 37 |
+
fi
|
run_dev_env.sh
CHANGED
|
@@ -31,7 +31,7 @@ PLATFORM="$(uname -m)"
|
|
| 31 |
|
| 32 |
if [ $PLATFORM = "x86_64" ]; then
|
| 33 |
echo "x86"
|
| 34 |
-
docker pull ghcr.io/moriyalab/
|
| 35 |
docker run -it --rm -v $ROOT:/app -w /app --network host ghcr.io/moriyalab/lab_tool_dev:latest /bin/bash
|
| 36 |
else
|
| 37 |
echo "Not Support Platform. Only support x86."
|
|
|
|
| 31 |
|
| 32 |
if [ $PLATFORM = "x86_64" ]; then
|
| 33 |
echo "x86"
|
| 34 |
+
docker pull ghcr.io/moriyalab/lab_tool_dev:latest
|
| 35 |
docker run -it --rm -v $ROOT:/app -w /app --network host ghcr.io/moriyalab/lab_tool_dev:latest /bin/bash
|
| 36 |
else
|
| 37 |
echo "Not Support Platform. Only support x86."
|