pritish commited on
Commit
3117258
1 Parent(s): 3dd12be
.gitattributes CHANGED
@@ -29,3 +29,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
32
+ *.file filter=lfs diff=lfs merge=lfs -text
33
+ vocab_2.file filter=lfs diff=lfs merge=lfs -text
model.py CHANGED
@@ -6,7 +6,7 @@ import numpy as np
6
 
7
  # CONTANTS
8
  MAX_LENGTH = 40
9
- VOCABULARY_SIZE = 10000
10
  BATCH_SIZE = 32
11
  BUFFER_SIZE = 1000
12
  EMBEDDING_DIM = 512
@@ -14,10 +14,10 @@ UNITS = 512
14
 
15
 
16
  # LOADING DATA
17
- vocab = pickle.load(open('saved_models/vocab.file', 'rb'))
18
 
19
  tokenizer = tf.keras.layers.TextVectorization(
20
- max_tokens=VOCABULARY_SIZE,
21
  standardize=None,
22
  output_sequence_length=MAX_LENGTH,
23
  vocabulary=vocab
@@ -321,8 +321,8 @@ def get_caption_model():
321
  caption_model.decoder(sample_y, sample_enc_out, training=False)
322
 
323
  try:
324
- caption_model.load_weights('saved_models/image_captioning_transformer_weights_3.h5')
325
  except FileNotFoundError:
326
- caption_model.load_weights('Image-Captioning/saved_models/image_captioning_transformer_weights_3.h5')
327
 
328
  return caption_model
 
6
 
7
  # CONTANTS
8
  MAX_LENGTH = 40
9
+ # VOCABULARY_SIZE = 10000
10
  BATCH_SIZE = 32
11
  BUFFER_SIZE = 1000
12
  EMBEDDING_DIM = 512
 
14
 
15
 
16
  # LOADING DATA
17
+ vocab = pickle.load(open('saved_vocabulary/vocab_1.file', 'rb'))
18
 
19
  tokenizer = tf.keras.layers.TextVectorization(
20
+ # max_tokens=VOCABULARY_SIZE,
21
  standardize=None,
22
  output_sequence_length=MAX_LENGTH,
23
  vocabulary=vocab
 
321
  caption_model.decoder(sample_y, sample_enc_out, training=False)
322
 
323
  try:
324
+ caption_model.load_weights('saved_models/image_captioning_transformer_weights_2.h5')
325
  except FileNotFoundError:
326
+ caption_model.load_weights('Image-Captioning/saved_models/image_captioning_transformer_weights_2.h5')
327
 
328
  return caption_model
saved_models/vocab.file DELETED
Binary file (860 kB)
 
saved_vocabulary/vocab_1.file ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4df22d5dd84bbb3421dfce39b4affd49ba2dc08739627ee9cf036ae17d326d28
3
+ size 860291
saved_vocabulary/vocab_2.file ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5397f3824177102eff3f2fe01eb8b6fffbe97671a8e8b102e20bd5e8e2064b7e
3
+ size 1985473
tmp.jpg CHANGED