kushinm commited on
Commit
59d9429
β€’
1 Parent(s): a3a6018

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -50,9 +50,9 @@ def evaluate_caption(image, caption):
50
  score = similarity_score.softmax(dim=1).detach().numpy()
51
  print(score)
52
  if score[0][0]>score[0][1]:
53
- winner = "The first caption is the human"
54
  else:
55
- winner = "The second caption is the human"
56
 
57
 
58
  return blip_caption,winner
@@ -60,6 +60,14 @@ def evaluate_caption(image, caption):
60
 
61
  callback = gr.HuggingFaceDatasetSaver('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', "gradioTest")
62
  with gr.Blocks() as demo:
 
 
 
 
 
 
 
 
63
  im_path_str = 'n01677366_12918.JPEG'
64
  im_path = gr.Textbox(label="Image fname",value=im_path_str,interactive=False, visible=False)
65
  # fn=evaluate_caption,
 
50
  score = similarity_score.softmax(dim=1).detach().numpy()
51
  print(score)
52
  if score[0][0]>score[0][1]:
53
+ winner = "Player 1 wins!"
54
  else:
55
+ winner = "Player 2 wins!"
56
 
57
 
58
  return blip_caption,winner
 
60
 
61
  callback = gr.HuggingFaceDatasetSaver('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', "gradioTest")
62
  with gr.Blocks() as demo:
63
+ gr.Markdown(
64
+ """
65
+ # Welcome to our Human vs. AI game!
66
+
67
+ ### You and an AI agent are trying to convince a third AI agent that each of you are better at describing the visual world. \n
68
+ ### In order to win, describe this image in one sentence. Then the second AI agent will also generate a description and the third agent will decide a winner.
69
+ ### You win if the AI says that "Player 1 wins!"
70
+ """)
71
  im_path_str = 'n01677366_12918.JPEG'
72
  im_path = gr.Textbox(label="Image fname",value=im_path_str,interactive=False, visible=False)
73
  # fn=evaluate_caption,