Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,6 +28,7 @@ def play_game(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)
|
|
|
31 |
return f"User's choice: {user_choice}\nComputer's choice: {computer_choice}\n{winner}"
|
32 |
|
33 |
|
@@ -35,5 +36,5 @@ image = gr.inputs.Image(shape=(192, 192))
|
|
35 |
label = gr.outputs.Label()
|
36 |
#examples = ['rock.jpg', 'paper.jpg', 'scissor.jpg']
|
37 |
|
38 |
-
intf = gr.Interface(fn=play_game, inputs=image, outputs=label)
|
39 |
intf.launch(inline=False)
|
|
|
28 |
user_choice = max(user_probs, key=user_probs.get)
|
29 |
computer_choice = random.choice(categories)
|
30 |
winner = determine_winner(user_choice, computer_choice)
|
31 |
+
computer_image = random.choice(get_image_files(f'{computer_choice}.jpg'))
|
32 |
return f"User's choice: {user_choice}\nComputer's choice: {computer_choice}\n{winner}"
|
33 |
|
34 |
|
|
|
36 |
label = gr.outputs.Label()
|
37 |
#examples = ['rock.jpg', 'paper.jpg', 'scissor.jpg']
|
38 |
|
39 |
+
intf = gr.Interface(fn=play_game, inputs=image, outputs=[label, "image"])
|
40 |
intf.launch(inline=False)
|