Update visual.py
Browse filesThe BytesIO read implementation is much more robust.
visual.py
CHANGED
@@ -417,7 +417,7 @@ class VisionTransformer(nn.Module):
|
|
417 |
images = []
|
418 |
for image_path in image_paths:
|
419 |
if image_path.startswith("http://") or image_path.startswith("https://"):
|
420 |
-
image
|
421 |
else:
|
422 |
image = Image.open(image_path)
|
423 |
image = image.convert("RGB")
|
|
|
417 |
images = []
|
418 |
for image_path in image_paths:
|
419 |
if image_path.startswith("http://") or image_path.startswith("https://"):
|
420 |
+
image= Image.open(BytesIO(requests.get(image_path).content))
|
421 |
else:
|
422 |
image = Image.open(image_path)
|
423 |
image = image.convert("RGB")
|