changed shape
Browse files
app.py
CHANGED
@@ -44,8 +44,8 @@ def generate_caption(image):
|
|
44 |
image_features = preprocess_image(image)
|
45 |
|
46 |
# Reshape to match the expected input shape for the captioning model (1, 2048)
|
47 |
-
image_features = image_features.reshape((1,
|
48 |
-
|
49 |
caption = start_token
|
50 |
for _ in range(max_caption_length):
|
51 |
sequence = tokenizer.texts_to_sequences([caption])[0] # Convert caption to sequence
|
|
|
44 |
image_features = preprocess_image(image)
|
45 |
|
46 |
# Reshape to match the expected input shape for the captioning model (1, 2048)
|
47 |
+
image_features = image_features.reshape((1, 1280))
|
48 |
+
|
49 |
caption = start_token
|
50 |
for _ in range(max_caption_length):
|
51 |
sequence = tokenizer.texts_to_sequences([caption])[0] # Convert caption to sequence
|