1
$\begingroup$

For a MachineLearning project I need to form a training set using images taken from the web page containing lots of them. Like, for example this one. It would be very convenient, if all the images from this site could be downloaded and transformed into a list of images, such that I could later simply delete those I do not like. Then it is easy to transform it into a training set.

Any ideas of how to download/form a list of images?

$\endgroup$
4
  • $\begingroup$ Seen this? $\endgroup$ Commented Nov 19, 2015 at 9:30
  • $\begingroup$ @ J. M. Thank you for the reference, but you did not understand my question. It is not "how to import a page". It is about "how to transform multiple images containing in the page into a list of images" $\endgroup$ Commented Nov 19, 2015 at 9:46
  • 1
    $\begingroup$ Well, you linked to Google Image Search as an example; I merely pointed out that related thread that involves extracting the images returned by Google Image Search. $\endgroup$ Commented Nov 19, 2015 at 10:08
  • $\begingroup$ Import seems to work for me - Import["en.wikipedia.org/wiki/Mathematica", "Images"] is this what you are looking for ? $\endgroup$
    – Lotus
    Commented Nov 19, 2015 at 11:28

1 Answer 1

6
$\begingroup$

I wrote this in the comment, but the code did not come out properly formatted. So here it is again:

Import["https://en.wikipedia.org/wiki/Mathematica", "Images"]

Import Images as a list

$\endgroup$
5
  • $\begingroup$ This works to an extent with a Google image search, like in OP's query. Import["http://images.google.com/search?tbm=isch&q=baby+elephant", "Images"] returns a list of the first 20 images, in thumbnail size. $\endgroup$
    – Jason B.
    Commented Nov 19, 2015 at 11:59
  • $\begingroup$ @Lotus Thank you, it works, though not as I expect. Namely, it, indeed, imports the images, but only a small part of them. Have you ideas of how to import them all? $\endgroup$ Commented Nov 19, 2015 at 12:42
  • $\begingroup$ @AlexeiBoulbitch The 20 images you get are the ones from page 1. $\endgroup$
    – Karsten7
    Commented Nov 19, 2015 at 13:12
  • $\begingroup$ @ Karsten 7 How can I get the images from other pages then? You see, to train the machine I need lots of images. Impossible to pick them up by hand. $\endgroup$ Commented Nov 19, 2015 at 13:16
  • $\begingroup$ I'd presume google detects the request is not from a browser and serves up a limited number. I realize its not elegant, but you can go to google images in a browser and save page as to get all the images (~400) dumped to a folder, then import the files. Of course they are thumbnails. You'd need to navigate each link to get the full size images. $\endgroup$
    – george2079
    Commented Nov 19, 2015 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.