arham061 commited on
Commit
97ded66
1 Parent(s): 81960fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -11,7 +11,7 @@ learn = load_learner('rps_model.pkl')
11
 
12
  categories = ('paper', 'rock', 'scissors')
13
 
14
- def classify_images(img):
15
  pred, idx, probs = learn.predict(img)
16
  return dict(zip(categories, map(float, probs)))
17
 
@@ -24,7 +24,7 @@ def determine_winner(user_choice, computer_choice):
24
  return "Computer won!"
25
 
26
  def play_game(img):
27
- user_probs = classify_images(img)
28
  user_choice = max(user_probs, key=user_probs.get)
29
  computer_choice = random.choice(categories)
30
  winner = determine_winner(user_choice, computer_choice)
 
11
 
12
  categories = ('paper', 'rock', 'scissors')
13
 
14
+ def classify_image(img):
15
  pred, idx, probs = learn.predict(img)
16
  return dict(zip(categories, map(float, probs)))
17
 
 
24
  return "Computer won!"
25
 
26
  def play_game(img):
27
+ user_probs = classify_image(img)
28
  user_choice = max(user_probs, key=user_probs.get)
29
  computer_choice = random.choice(categories)
30
  winner = determine_winner(user_choice, computer_choice)