Lesson2 download images

Hi there,

I am at workbook lesson 2, wich contains the task:

I saw that the Bing image search is not always very handy. This site explains to get images from “Google images”. I tried this on my pc and ran code in java to download urls. The download looks completed but I don’t know where I can find these urls. Anywhere on my local pc?

I also tried these alternative methods but none of them worked:

Sorry for the messy code, hope that somebody can give me some tips how to obtain the images. Thanks! Jorrit

I also tried to download the images from azure. I followed the steps to install bing v7 Somehow my e-mail wouln’t let me create a resource group. Could this be because my Unviersity does not autorize this website? Are there any alternatives?

Can someone please help me, I am stuck on this for quite a while :pensive:


Hi Jorrit,
sorry for the delay!

I got stuck with this too. I tried DuckDuckGo instead.
It works!!

Here’s the thread where I posted about it & got it solved.


Hi Vnay0007,

Thank you for the link. It worked! I have a couple of questions after succesfully completing the notebook.

When you run this script. Where are the images stored? Can I see them on my GoogleDrive, or are they somewhere else on the cloud that I can’t see. For example it would give good insight to visualise from the folder bears grizzly the first image. Is this possible?

While I do get a proper confusion matrix, the function show top losses shows just one image with a loss of 6.31 and a probability of 1. Could this be correct? Why do I only see one image?

And a final question, this one is probably a bit more complex. I have a tibble with images from Red deer containing file paths and behaviour labels (m = moving, o=other and f=foraging). Which coding adaptations will I need to take to use my own data instead of the downloaded bear data to classify behaviour? Are there topics from people who did similar things?

Hi Jorrit,

Issue 1 :

Read more about it here

Issue 2 : Space Issue!!

Showing all the 700+ images along with the results (losses) ain’t possible & not required either.
So, just 1 image is shown as a sample.

Issue 3 :

Mock the same code for deer movements as well.
The bear types will now become deer movements.
Use "m,o,f" instead of "grizzly,black,teddy"

You need to tweak the code a bit - to change the file names to the deer movements i.e.
Just like grizzly bear, black bear, teddy bear, you need to get your file names as moving deer, foraying deer, other deer.

Here’s a sample pseudo code, if it may help :
For each of the images in file name column :
if behavior = m change file name to moving deer
if behavior = f change file name to foraying deer
if behavior = o change file name to other deer

Can be done with pandas & its dataframe methods.

As an alternative - you can also refer to the behaviour column as a Category variable & classify the images (which I guess might be taught in future lessons).

Of course these are not the only ways to get to what you want. Try searching optimal ways of doing the same.

Hope that helps.

Issue 1

Thank you Vnay007, so after running this line the images are being downloaded to Path(’/content/gdrive/My Drive’)

Then where can I find these images in a folder? They are in some ’ content/animals’ folder but I can not acces this folder via My Drive as this seems to be a different directory.

Issue 2
In the tutorial all 5 images are shown:

And in my example only the first:

I understand that I do not see 700+ images, but expect at least the 5 squares here being filled with images, like in the notebook example. Is this really because of space issue from My Drive? Because of this: