tirthadagr8 commited on
Commit
d480b38
·
verified ·
1 Parent(s): 7434848

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -3
README.md CHANGED
@@ -25,11 +25,13 @@ def resize_with_padding(image, target_size=(224, 224)):
25
  ])
26
  return transform((padded_img))
27
 
28
- path="0106.jpg"
29
- img=resize_with_padding(Image.open(path))
30
  model.eval()
31
  with torch.no_grad():
32
- print(tokenizer.batch_decode(model.cuda().generate(img.unsqueeze(0).cuda()),skip_special_tokens=True))
 
33
 
34
  plt.imshow(img.permute(1,2,0).detach().cpu().numpy())
 
35
  ```
 
25
  ])
26
  return transform((padded_img))
27
 
28
+ path="/home/t2/Downloads/Figure_4.png"
29
+ img=resize_with_padding(Image.open(path).convert('RGB'))
30
  model.eval()
31
  with torch.no_grad():
32
+ ans=tokenizer.batch_decode(model.cuda().generate(img.unsqueeze(0).cuda()),skip_special_tokens=True)
33
+ print(ans)
34
 
35
  plt.imshow(img.permute(1,2,0).detach().cpu().numpy())
36
+ plt.show()
37
  ```