Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,12 +29,12 @@ def play_game(img):
|
|
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 |
|
35 |
image = gr.inputs.Image(shape=(192, 192))
|
36 |
label = gr.outputs.Label()
|
37 |
-
|
38 |
|
39 |
-
intf = gr.Interface(fn=play_game, inputs=image, outputs=[label,
|
40 |
intf.launch(inline=False)
|
|
|
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}", computer_image
|
33 |
|
34 |
|
35 |
image = gr.inputs.Image(shape=(192, 192))
|
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)
|