rosikand / rsbox

📦 A toolbox of utility functions I commonly use when programming in Python.
MIT License
0 stars 0 forks source link

Add a sample numpy image getter #5

Closed rohan-insitro closed 2 years ago

rohan-insitro commented 2 years ago

It would be nice to have a handy function that one can call like so:

from rsbox import ml
img = ml.get_img()

which would return some canonical image that you can use to test various functions.

rohan-insitro commented 2 years ago

For example, a 128x128 image would be good.

rohan-insitro commented 2 years ago

Use something like:

from PIL import Image
import requests
url = 'http://images.cocodataset.org/test-stuff2017/000000027833.jpg'
img = Image.open(requests.get(url, stream=True).raw)
rosikand commented 2 years ago

Added.