kusumakar commited on
Commit
9d20985
·
1 Parent(s): 03c0e33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -50,9 +50,10 @@ def main():
50
  image_array = np.array(image)
51
  normalized_image = image_array / 255.0
52
  reshaped_image = normalized_image.reshape((1, 224, 224, 3))
 
53
 
54
  # context as prompt
55
- prompt = generate_captions(reshaped_image)
56
  st.write("The Context is:", prompt)
57
 
58
  # display the image
 
50
  image_array = np.array(image)
51
  normalized_image = image_array / 255.0
52
  reshaped_image = normalized_image.reshape((1, 224, 224, 3))
53
+ image_tensor = torch.from_numpy(normalized_image).permute(2, 0, 1).unsqueeze(0).float()
54
 
55
  # context as prompt
56
+ prompt = generate_captions(image_tensor)
57
  st.write("The Context is:", prompt)
58
 
59
  # display the image