bobs24's picture
track product with LFS
68f893f
raw
history blame contribute delete
377 Bytes
import requests
from io import BytesIO
from PIL import Image
def load_image_from_url(url):
try:
response = requests.get(url, timeout=10)
response.raise_for_status()
image = Image.open(BytesIO(response.content)).convert('RGB')
return image
except Exception as e:
print(f"Failed to load image from {url}: {e}")
return None