Jyothirmai commited on
Commit
c26aed2
1 Parent(s): 3049213

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -59,8 +59,6 @@ def getCaption(imgID):
59
  return real_captions[imgID]
60
 
61
  def getImageID(imgID):
62
- if imgID == "5" or imgID == "6":
63
- return 0
64
  imgIDs = {"1":"/content/drive/MyDrive/cnn-rnn/NLMCXR_png/CXR412_IM-2056_0",
65
  "2":"/content/drive/MyDrive/cnn-rnn/NLMCXR_png/CXR545_IM-2149_0",
66
  "3":"/content/drive/MyDrive/cnn-rnn/NLMCXR_png/CXR849_IM-2371_0",
@@ -76,10 +74,7 @@ def predict(img, model_name, max_tokens, temperature, imgID):
76
  return generate_caption_vitCoAtt(img), getCaption(imgID)
77
  elif model_name == "Baseline Model CNN-RNN":
78
  img = getImageID(imgID)
79
- if img != 0:
80
- return generate_caption_cnnrnn(img), getCaption(imgID)
81
- else:
82
- return "The images 5 and 6 are not chest xrays and the baseline model cannot be implemented try a different sample", "The images 5 and 6 are not chest xrays and the baseline model cannot be implemented try a different sample"
83
  else:
84
  return "select a model","select an image"
85
 
 
59
  return real_captions[imgID]
60
 
61
  def getImageID(imgID):
 
 
62
  imgIDs = {"1":"/content/drive/MyDrive/cnn-rnn/NLMCXR_png/CXR412_IM-2056_0",
63
  "2":"/content/drive/MyDrive/cnn-rnn/NLMCXR_png/CXR545_IM-2149_0",
64
  "3":"/content/drive/MyDrive/cnn-rnn/NLMCXR_png/CXR849_IM-2371_0",
 
74
  return generate_caption_vitCoAtt(img), getCaption(imgID)
75
  elif model_name == "Baseline Model CNN-RNN":
76
  img = getImageID(imgID)
77
+ return generate_caption_cnnrnn(img), getCaption(imgID)
 
 
 
78
  else:
79
  return "select a model","select an image"
80