Skip to content

Add coco dataset download script#6715

Closed
triple-mu wants to merge 8 commits intoopen-mmlab:devfrom
triple-mu:triple-Mu
Closed

Add coco dataset download script#6715
triple-mu wants to merge 8 commits intoopen-mmlab:devfrom
triple-mu:triple-Mu

Conversation

@triple-mu
Copy link
Copy Markdown
Collaborator

@triple-mu triple-mu commented Dec 7, 2021

Motivation

Add a script to download coco2017 dataset

Modification

Add a python file in tools

BC-breaking (Optional)

This script do not link any other files

Use cases (Optional)

You can use command "python tools/download.py --win" to download coco2017 dataset.
Linux for using command "python tools/download.py
You can alse use flag --unzip to unzip the zipfiles
such as python tools/download.py --win --unzip

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

You can use command "python tools/download.py --win --unzip" to download coco dataset.
Linux for using command "python tools/download.py  --unzip"
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 7, 2021

CLA assistant check
All committers have signed the CLA.

type=str,
help='the dir to save dataset',
default='data/coco')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The empty line in line 77,80,82,85 may not be necessary.

parser.add_argument(
'--unzip', action='store_true', help='whether unzip dataset or not')

parser.add_argument('--delete', action='store_true', help='del dataset')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  1. Does this mean the zipped files will be deleted or the who dataset?
  2. del -> delete. We usually use complete word in help messages.

if not path.exists():
path.mkdir(parents=True, exist_ok=True)

urls = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggest putting the urls to a dict because we will also download VOC/LVIS dataset in the future, you can put them in a dict like below:

data2url = dict(coco2017=[
    URLs...
], lvis=[], voc2007=[], )

@ZwwWayne ZwwWayne changed the base branch from master to dev-v2.20.0 December 13, 2021 02:40
help='delete the download zipped files')
parser.add_argument(
'--threads', type=int, help='number of threading', default=4)
parser.add_argument(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The argument --win may be unnecessary, for
win = Flase if sys.platform == 'linux' else win = True.

elif not f.exists():
print('Downloading {} to {}'.format(url, f))
if curl:
os.system('curl -L {} -o {} --retry 9 -C -'.format(url, f))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sometimes, the command curl does not exit in a conda env, so whether check it or not ?

@ZwwWayne
Copy link
Copy Markdown
Collaborator

Kindly ping @q3394101

@RangiLyu
Copy link
Copy Markdown
Member

@q3394101 Hi, we will take over this PR and support more dataset. This PR will be closed and your commits will be kept in #7015

@RangiLyu RangiLyu closed this Jan 17, 2022
ZwwWayne added a commit that referenced this pull request Jan 19, 2022
…6715 (#7015)

* Add coco dataset download script 

You can use command "python tools/download.py --win --unzip" to download coco dataset.
Linux for using command "python tools/download.py  --unzip"

* Add coco dataset download script

* Add coco dataset download script

* Add coco dataset download script

* add some notes and modify dataset urls

* add some notes and modify dataset urls

* remove some useless lines and modify urls list to dict

* add urls of lvis and voc, and delete --win

* add parse_args()

* Add documentation of this tool in docs/en/1_exist_data_model.md, docs/zh_cn/1_exist_data_model.md and docs/en/useful_tools.md.

* add a link

* Download files regardless of system。

* Use get() of dict

* add empty line above the code block

* Update useful_tools.md

Co-authored-by: q3394101 <92794867+q3394101@users.noreply.github.com>
Co-authored-by: q3394101 <3394101@qq.com>
Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>
chhluo pushed a commit to chhluo/mmdetection that referenced this pull request Feb 21, 2022
…pen-mmlab#6715 (open-mmlab#7015)

* Add coco dataset download script 

You can use command "python tools/download.py --win --unzip" to download coco dataset.
Linux for using command "python tools/download.py  --unzip"

* Add coco dataset download script

* Add coco dataset download script

* Add coco dataset download script

* add some notes and modify dataset urls

* add some notes and modify dataset urls

* remove some useless lines and modify urls list to dict

* add urls of lvis and voc, and delete --win

* add parse_args()

* Add documentation of this tool in docs/en/1_exist_data_model.md, docs/zh_cn/1_exist_data_model.md and docs/en/useful_tools.md.

* add a link

* Download files regardless of system。

* Use get() of dict

* add empty line above the code block

* Update useful_tools.md

Co-authored-by: q3394101 <92794867+q3394101@users.noreply.github.com>
Co-authored-by: q3394101 <3394101@qq.com>
Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>
ZwwWayne added a commit that referenced this pull request Jul 18, 2022
…6715 (#7015)

* Add coco dataset download script 

You can use command "python tools/download.py --win --unzip" to download coco dataset.
Linux for using command "python tools/download.py  --unzip"

* Add coco dataset download script

* Add coco dataset download script

* Add coco dataset download script

* add some notes and modify dataset urls

* add some notes and modify dataset urls

* remove some useless lines and modify urls list to dict

* add urls of lvis and voc, and delete --win

* add parse_args()

* Add documentation of this tool in docs/en/1_exist_data_model.md, docs/zh_cn/1_exist_data_model.md and docs/en/useful_tools.md.

* add a link

* Download files regardless of system。

* Use get() of dict

* add empty line above the code block

* Update useful_tools.md

Co-authored-by: q3394101 <92794867+q3394101@users.noreply.github.com>
Co-authored-by: q3394101 <3394101@qq.com>
Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>
ZwwWayne added a commit to ZwwWayne/mmdetection that referenced this pull request Jul 19, 2022
…pen-mmlab#6715 (open-mmlab#7015)

* Add coco dataset download script 

You can use command "python tools/download.py --win --unzip" to download coco dataset.
Linux for using command "python tools/download.py  --unzip"

* Add coco dataset download script

* Add coco dataset download script

* Add coco dataset download script

* add some notes and modify dataset urls

* add some notes and modify dataset urls

* remove some useless lines and modify urls list to dict

* add urls of lvis and voc, and delete --win

* add parse_args()

* Add documentation of this tool in docs/en/1_exist_data_model.md, docs/zh_cn/1_exist_data_model.md and docs/en/useful_tools.md.

* add a link

* Download files regardless of system。

* Use get() of dict

* add empty line above the code block

* Update useful_tools.md

Co-authored-by: q3394101 <92794867+q3394101@users.noreply.github.com>
Co-authored-by: q3394101 <3394101@qq.com>
Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>
@triple-mu triple-mu deleted the triple-Mu branch July 25, 2022 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants