annie08 commited on
Commit
2ad9ae6
·
1 Parent(s): d9a9b93

changed shape

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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, 2048))
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