Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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(
|
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
|