Skip to content

Handle download of large files from google drive#1127

Closed
Abdurrahheem wants to merge 1 commit intoopencv:4.xfrom
Abdurrahheem:ash/weight_link_fix
Closed

Handle download of large files from google drive#1127
Abdurrahheem wants to merge 1 commit intoopencv:4.xfrom
Abdurrahheem:ash/weight_link_fix

Conversation

@Abdurrahheem
Copy link
Copy Markdown
Contributor

@Abdurrahheem Abdurrahheem commented Nov 22, 2023

This PR introduces fixes required for downloading large files (> 100Mb) from google drive
It also fixes download link for yolov7 model

Problem

When download file size is >= 100Mb, then current download_gdrive() downloads very small file 2Kb. Then sha1sum code does not match that of the target(specified in the Model), as a result if the download is failed.

except Exception as e:
print(' download {}'.format(e))

def download_gdown(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So download_gdrive cannot handle downloading large file (>100mb)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it can not

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the following part? https://github.com/opencv/opencv_extra/blob/586e02072645feecc460f377592ee32d87f6a761/testdata/dnn/download_models.py#L165C1-L165C71

AFAIK, GDrive requires authentification for large files. How gdown resolves this problem?

@dkurt dkurt requested a review from mshabunin November 23, 2023 08:32
import requests
import shutil
import argparse
import gdown
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra dependency

Copy link
Copy Markdown
Contributor Author

@Abdurrahheem Abdurrahheem Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asmorkalov I propose to close this PR as #1126 solves the issue by loading models weights on dl.opencv.org server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants