fastai / fastbook

The fastai book, published as Jupyter Notebooks
Other
22.03k stars 8.49k forks source link

Convert Chapter 2 to use DDGo to smooth learning experience? #649

Open sunlambda opened 6 months ago

sunlambda commented 6 months ago

Synopsis

Setting up a Microsoft Azure account for learning purposes is distracting, especially for Chapter 2. There has to be a keyless way to get some image URL's...I was just talking about this in #648 so I wanted to share my result.

Problem

I followed all the instructions (in Fastbook and elsewhere), but I was still having trouble creating the Azure cloud resource to do the Bing Image search (deployment failure, BadRequest, Internal Server Error).

Expected Behavior

Do Chapter 2 without signing up for more things, and to minimize the distractions so the attention can be paid to learning PyTorch.

Observed Behavior

I spent more time trying to figure out Azure portal, than simply adjusting the Chapter 2 to use DDGS and submitting this PR! Now I can complete Chapter 2 and continue on with the book confidently.

Proposed Solution

Use a DDGS library which requires no key, with the trade off of being limited by query volume.

Content of this PR

Attached to this PR is a tested notebook which installs the referenced DDGS library. Then, any instances of search_images_bing is replaced with ddgs.images(**query_parameters), I was specific with the query parameters (small, public domain, etc.)

TODO

The literature in the Notebook itself may need more updating, but the code should work and the notebook should run.

review-notebook-app[bot] commented 6 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

bd4 commented 4 months ago

Thanks for this! Unfortunately I get a RateLimitException trying to execute it. I am going to try again tomorrow with some delays between API calls to see if I can get it to work.