Testys commited on
Commit
c31c112
1 Parent(s): 8cfb037

Trying something diff for reading content of image

Browse files
Files changed (1) hide show
  1. utils/image_utils.py +1 -1
utils/image_utils.py CHANGED
@@ -18,4 +18,4 @@ def load_image(image_path):
18
  if check_url(image_path="https://images.unsplash.com/photo-1532635236-d50c8592eb08?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1411&q=80"):
19
  return Image.open(requests.get(image_path, stream=True).raw)
20
  elif os.path.exists(image_path):
21
- return Image.open(image_path)
 
18
  if check_url(image_path="https://images.unsplash.com/photo-1532635236-d50c8592eb08?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1411&q=80"):
19
  return Image.open(requests.get(image_path, stream=True).raw)
20
  elif os.path.exists(image_path):
21
+ return Image.open(image_path.read())