arham061 commited on
Commit
b6b0c44
1 Parent(s): 4c00ae9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -25,11 +25,13 @@ def determine_winner(user_choice, computer_choice):
25
  return "Computer won!"
26
 
27
  def play_game(img):
28
- user_choice = img
 
29
  computer_choice = random.choice(categories)
30
  winner = determine_winner(user_choice, computer_choice)
31
  return f"User's choice: {user_choice}\nComputer's choice: {computer_choice}\n{winner}"
32
 
 
33
  image = gr.inputs.Image(shape=(192, 192))
34
  label = gr.outputs.Label()
35
  examples = ['rock.jpg', 'paper.jpg', 'scissors.jpg']
 
25
  return "Computer won!"
26
 
27
  def play_game(img):
28
+ user_probs = classify_images(img)
29
+ user_choice = max(user_probs, key=user_probs.get)
30
  computer_choice = random.choice(categories)
31
  winner = determine_winner(user_choice, computer_choice)
32
  return f"User's choice: {user_choice}\nComputer's choice: {computer_choice}\n{winner}"
33
 
34
+
35
  image = gr.inputs.Image(shape=(192, 192))
36
  label = gr.outputs.Label()
37
  examples = ['rock.jpg', 'paper.jpg', 'scissors.jpg']