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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -47,9 +47,12 @@ def main():
47
  # load the image
48
  image = Image.open(uploaded_file).convert("RGB")
49
  image = image.resize((224, 224))
 
 
 
50
 
51
  # context as prompt
52
- prompt = generate_captions(image)
53
  st.write("The Context is:", prompt)
54
 
55
  # display the image
 
47
  # load the image
48
  image = Image.open(uploaded_file).convert("RGB")
49
  image = image.resize((224, 224))
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