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