Download Sample Images in Ubuntu Par 1(2018) Lesson 1

Hi,
In order to further play with Lesson 1, I am trying to see how I can download google images in ubuntu.

  1. I would like to download images from google
  2. Use those images to learn more about lesson 1

How can I download images from google onto ubuntu. I have tried copying each line into a new Jupyter Notebook


But this results in an error

Can someone provide a solution

Regards
Murali

What is the error?

I got an error from that script too - saying it timed out, the fake User Agent probably isn’t working. I ended up using a Firefox add-on: https://addons.mozilla.org/en-GB/firefox/addon/google-images-downloader/

You could use that inside Ubuntu if you have a UI, but I’m using Paperspace so I used that to download them on my mac, used Finder to set up the train/valid directories and then zipped it and SCPed it to my Paperspace host.

1 Like

@mcintyre1994 I am using Paperspace so will try to do the same

When I ran a particular line I get an exception IO exception inside paper space

Which line, what was the exception? When you say inside Paperspace, do you mean your Paperspace console? Or your Jupyter notebook UI?

The error occurs inside Jupyter Notebook UI running on Paperspace Ubuntu Machine
Below is the line

args = parser.parse_args()`

usage: ipykernel_launcher.py [-h] -k KEYWORDS [-l LIMIT]
_ [-c {red,orange,yellow,green,teal,blue,purple,pink,white,gray,black,brown}]_
ipykernel_launcher.py: error: the following arguments are required: -k/–keywords
An exception has occurred, use %tb to see the full traceback.

@mcintyre1994 thank you this worked. I used scp command to copy the files.

In which notebook do you see this? Which line of the Jupyter notebook causes this?

This occurs in line 21 of the original source code hardikvasa/google-images-download. When I run the cell with the code args = parser.parse_args()

Ohh you’re seeing this while trying to do the Google images download thing? Sorry, I thought you were seeing an issue on a course notebook. I’d just ditch that and use the extension I told you about.

Extension is not feasible as I used SCP command to copy images after downloading them to my mac

That’s what I mean. Obviously if you’re wanting to build datasets of thousands of images that’s going to be an issue, but if you just need a page of Google Images data to play with then:

  • Use the extension
  • Use Finder to arrange the train/valid categorical folders
  • scp them to the data folder on your GPU cloud machine
  • Run the code using that data as PATH

If you need a working extension that can download thousands of Google Images then I don’t know of one, sorry.