I'm trying to collect img data for my ML/DL project.
I need facial data so, I have to detect the face and crop around it.
I have a bunch of img URLs that I searched online.
Normally I would save them in a file using requests library, but would it be possible to do it in-memory?
response = requests.get(IMG_URL)
img_byte = response.content
# Do image processing without saving to a file
I looked at some image libraries in python such as PIL or OpenCV,
but they all seems to get images loaded from a file in first place.
I think I could speed up the process if I don't save temporary files. (I/O is a big bottleneck)
I tried playing around with BytesIO functions but I couldn't figure it out.