From bc35129507cef03040d65a23369a5d56d1bd5526 Mon Sep 17 00:00:00 2001 From: Erebus Oh Date: Tue, 24 Sep 2024 17:49:01 +0000 Subject: [PATCH] fix #246 --- .gitattributes | 1 - gr-spectrumdetect/examples/detect.pt | 3 --- .../examples/trained_model_download.sh | 23 +++++++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) delete mode 100644 .gitattributes delete mode 100755 gr-spectrumdetect/examples/detect.pt create mode 100644 gr-spectrumdetect/examples/trained_model_download.sh diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index e92cf9b..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pt filter=lfs diff=lfs merge=lfs -text diff --git a/gr-spectrumdetect/examples/detect.pt b/gr-spectrumdetect/examples/detect.pt deleted file mode 100755 index 9deb7f5..0000000 --- a/gr-spectrumdetect/examples/detect.pt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:16a7c7b49b6ee04c7bcaee593977dcfb27ea7486c8ccaebe1ee03ca418fed6af -size 273428264 diff --git a/gr-spectrumdetect/examples/trained_model_download.sh b/gr-spectrumdetect/examples/trained_model_download.sh new file mode 100644 index 0000000..c7bb3a1 --- /dev/null +++ b/gr-spectrumdetect/examples/trained_model_download.sh @@ -0,0 +1,23 @@ +#!/bin/bash + + +destination_path=detect.pt + +file_id=1vdzNyXjnZ61D2vruFhslerNscL3rAV8c +file_url="https://drive.usercontent.google.com/download?id=$file_id&export=download" + +confirmation_page=$(curl -s -L "$file_url") + +file_id=$(echo "$confirmation_page" | grep -oE "name=\"id\" value=\"[^\"]+" | sed 's/name="id" value="//') +file_confirm=$(echo "$confirmation_page" | grep -oE "name=\"confirm\" value=\"[^\"]+" | sed 's/name="confirm" value="//') +file_uuid=$(echo "$confirmation_page" | grep -oE "name=\"uuid\" value=\"[^\"]+" | sed 's/name="uuid" value="//') + +download_url="https://drive.usercontent.google.com/download?id=$file_id&export=download&confirm=$file_confirm&uuid=$file_uuid" + +curl -L -o "$destination_path" "$download_url" + +if [ $? -eq 0 ]; then + echo "Download completed successfully." +else + echo "Download failed." +fi