joedockrill / blog

Blog
https://joedockrill.github.io/blog/
Apache License 2.0
1 stars 0 forks source link

jmd_imagescraper library | Joe Dockrill #3

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

jmd_imagescraper library | Joe Dockrill

Finding an excuse to play with nbdev

https://joedockrill.github.io/blog/2020/09/18/jmd-imagescraper-library/

nickjenslopez commented 3 years ago

I found the filter for square images means I get lots of thumbnails for products instead of the objects I was searching for. I'm looking for a way to remove that filter if possible.

joedockrill commented 3 years ago

It shouldn't, it's just asking ddg for square images, nothing more, but you can pass img_layout=ImgLayout.All to disable that.

nickjenslopez commented 3 years ago

Yeah, I just noticed that the square image parameter really skews the results for one of my searches to be 75% not what I'm looking for when the normal search works perfectly fine.

For some reason the library stopped working for me recently so I'm trying to use that but troubleshooting. Also, couldn't get rmtree to work.

nickjenslopez commented 3 years ago

Got it to work thanks! I just mainly wanted to point out that the square parameter being default might create problems. Also I'm doing the fast.ai course and they're saying they prefer using a feature that crops squares out of non square images to get multiple photos to train with out of one.

joedockrill commented 3 years ago

Square vs aug cropping is an interesting point and I think that probably depends on the data. Sometimes one might be better than the other but it's something for me to think about.

What's the search which didn't behave with squares? And what was the problem with the library in the end?

yrodriguezmd commented 2 years ago

ImgLayout.All was better able to generate the expected images -- thank you! :)

mycarta commented 2 years ago

It shouldn't, it's just asking ddg for square images, nothing more, but you can pass img_layout=ImgLayout.All to disable that.

Hi @joedockrill I am working on the course notebook 2 (bear classification). When I try: duckduckgo_search(path, "Black bears", 'black bear", img_layout=ImgLayout.All, max_results=80) I get this error: name 'ImgLayout' is not defined