Git Product home page Git Product logo

cocofetch's Introduction

MS CoCo Dataset Python Downloader

COCO statistics

validation                 = 40504
train                      = 82783
Total = validation + train = 123287
total size                 = 18881856 K

Usage

  • download json file, then please extract it.
$ bash download_annotation.sh
$ unzip -d . captions_train-val2014.zip
  • download using single process
$ python3 cocofetch.py captions_train2014.json
[crunch, crunch, crunch...]

$ python3 cocofetch.py captions_val2014.json
[crunch, crunch, crunch...]
  • scan for broken jpegs, delete them
$ python3 check_jpeg.py pool/ | tee junk
$ cat junk | awk '{print $3}' | xargs rm # remove troublesome images

then you should switch download URL from flickr to mscoco in cocofetch.py, and download again. (existing images will be skipped, so this is fast.)

  • scan for missing files if any.
$ python3 scan_missing XXX.json

if it says nothing, no picture is missed.

Happy hacking!

trick: multiple process download

first we split json files

$ python3 split.py annotations/train.json

then start 2 processes to download

$ python3 cocofetch.py annotations/train.json.left
$ python3 cocofetch.py annotations/train.json.right

Tip: you can split the json file for several times, so you can launch more processes.

$ python3 split.py annotations/train.json.left
$ python3 split.py annotations/train.json.right

$ ... cocofetch.py train.json.left.left &
$ ... cocofetch.py train.json.left.right &
$ ... cocofetch.py train.json.right.left &
$ ... cocofetch.py train.json.right.right &

cocofetch's People

Contributors

cdluminate avatar

Watchers

 avatar  avatar

Forkers

anehta jaybird097

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.