Imadsarvm commited on
Commit
f5a36ce
·
verified ·
1 Parent(s): b2e3a42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -53,7 +53,8 @@ class GOSNormalize(object):
53
  transform = transforms.Compose([GOSNormalize([0.5,0.5,0.5],[1.0,1.0,1.0])])
54
 
55
  def load_image(im_path, hypar):
56
- im = Image.open(requests.get(im_path, stream=True).raw)
 
57
  im, im_shp = im_preprocess(im, hypar["cache_size"])
58
  im = torch.divide(im,255.0)
59
  shape = torch.from_numpy(np.array(im_shp))
 
53
  transform = transforms.Compose([GOSNormalize([0.5,0.5,0.5],[1.0,1.0,1.0])])
54
 
55
  def load_image(im_path, hypar):
56
+ im_path = BytesIO(requests.get(im_path).content)
57
+ im = im_reader(im_path)
58
  im, im_shp = im_preprocess(im, hypar["cache_size"])
59
  im = torch.divide(im,255.0)
60
  shape = torch.from_numpy(np.array(im_shp))