ydshieh commited on
Commit
d29817c
1 Parent(s): 374fa3e
model.py CHANGED
@@ -56,7 +56,7 @@ def predict(image):
56
  token_ids = np.array(generation.sequences)[0]
57
  caption = tokenizer.decode(token_ids)
58
  caption = caption.replace('<s>', '').replace('</s>', '').replace('<pad>', '')
59
- caption = caption.replace("à l'arrière-plan", '').replace("Une photo en noir et blanc d'", '').replace("Une photo noire et blanche d'", '').replace("en arrière-plan", '')
60
  while ' ' in caption:
61
  caption = caption.replace(' ', ' ')
62
  caption = caption.strip()
 
56
  token_ids = np.array(generation.sequences)[0]
57
  caption = tokenizer.decode(token_ids)
58
  caption = caption.replace('<s>', '').replace('</s>', '').replace('<pad>', '')
59
+ caption = caption.replace("à l'arrière-plan", '').replace("Une photo en noir et blanc d'", '').replace("Une photo noire et blanche d'", '').replace("en arrière-plan", '').replac("Un gros plan d'", '').replace("un gros plan d'", '').replace("Une image d'", '')
60
  while ' ' in caption:
61
  caption = caption.replace(' ', ' ')
62
  caption = caption.strip()
samples/COCO_val2014_000000581654.jpg DELETED
Binary file (189 kB)
 
samples/COCO_val2014_000000581655.jpg DELETED
Binary file (85.7 kB)
 
samples/COCO_val2014_000000581731.jpg DELETED
Binary file (327 kB)
 
samples/COCO_val2014_000000581749.jpg DELETED
Binary file (154 kB)
 
samples/COCO_val2014_000000581831.jpg DELETED
Binary file (176 kB)
 
samples/COCO_val2014_000000581886.jpg DELETED
Binary file (94.4 kB)
 
samples/COCO_val2014_000000581887.jpg DELETED
Binary file (108 kB)
 
samples/COCO_val2014_000000581913.jpg DELETED
Binary file (138 kB)
 
samples/COCO_val2014_000000581929.jpg DELETED
Binary file (315 kB)
 
samples/sample_01.jpg DELETED
Binary file (65.7 kB)