From 305811a5db6990c9273044e28ad2cd471c32dce4 Mon Sep 17 00:00:00 2001 From: Trey Woodlief Date: Wed, 8 Jun 2022 15:47:59 -0400 Subject: [PATCH 1/2] Update requirements.txt Force opencv-python package versions to be the ones that were current when the original requirements.txt was uploaded. --- scripts/requirements.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/requirements.txt b/scripts/requirements.txt index 623f3e57..0280c63c 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -8,8 +8,9 @@ wget cython lmdb av -opencv-python -opencv-contrib-python +opencv-python==4.5.4.58 +opencv-python-headless==4.5.4.58 +opencv-contrib-python==4.5.4.58 imutils imageio-ffmpeg qimage2ndarray From 4841ffad1fdd2ef941ab35d591d650e2a750cad0 Mon Sep 17 00:00:00 2001 From: Trey Woodlief Date: Wed, 8 Jun 2022 16:06:58 -0400 Subject: [PATCH 2/2] Update io.py to handle new Google Drive download protocol --- imaginaire/utils/io.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/imaginaire/utils/io.py b/imaginaire/utils/io.py index 2f3aa1d7..c6f79677 100644 --- a/imaginaire/utils/io.py +++ b/imaginaire/utils/io.py @@ -69,11 +69,14 @@ def download_file(URL, destination): """ session = requests.Session() - response = session.get(URL, stream=True) - token = get_confirm_token(response) - if token: - params = {'confirm': token} - response = session.get(URL, params=params, stream=True) + if 'google' in URL: + response = session.post(URL + "&confirm=t") + else: + response = session.get(URL, stream=True) + token = get_confirm_token(response) + if token: + params = {'confirm': token} + response = session.get(URL, params=params, stream=True) save_response_content(response, destination)