marcelomoreno26
commited on
Commit
•
33b6e89
1
Parent(s):
f0a26f7
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,6 @@ import torch
|
|
5 |
import random
|
6 |
import numpy as np
|
7 |
import pandas as pd
|
8 |
-
# tabulate in dependencies
|
9 |
|
10 |
|
11 |
|
@@ -29,9 +28,7 @@ def get_predictions(image):
|
|
29 |
data = load_dataset("marcelomoreno26/geoguessr",split="test")
|
30 |
model_name = "marcelomoreno26/vit-base-patch-16-384-geoguessr"
|
31 |
|
32 |
-
# Initialize the feature extractor
|
33 |
processor = ViTImageProcessor.from_pretrained(model_name)
|
34 |
-
# Initialize the model
|
35 |
model = ViTForImageClassification.from_pretrained(model_name)
|
36 |
|
37 |
|
@@ -116,8 +113,8 @@ with gr.Blocks() as demo:
|
|
116 |
|
117 |
gr.Markdown("# GeoGuessr - Can You Beat the AI?")
|
118 |
gr.Markdown("Try to guess the country in the image. Can you beat the AI?")
|
119 |
-
gr.Markdown("
|
120 |
-
gr.Markdown("
|
121 |
img = gr.Image(image)
|
122 |
radio = gr.Radio(choices=options, label ="Select the country:")
|
123 |
ai_pred = gr.Markdown()
|
|
|
5 |
import random
|
6 |
import numpy as np
|
7 |
import pandas as pd
|
|
|
8 |
|
9 |
|
10 |
|
|
|
28 |
data = load_dataset("marcelomoreno26/geoguessr",split="test")
|
29 |
model_name = "marcelomoreno26/vit-base-patch-16-384-geoguessr"
|
30 |
|
|
|
31 |
processor = ViTImageProcessor.from_pretrained(model_name)
|
|
|
32 |
model = ViTForImageClassification.from_pretrained(model_name)
|
33 |
|
34 |
|
|
|
113 |
|
114 |
gr.Markdown("# GeoGuessr - Can You Beat the AI?")
|
115 |
gr.Markdown("Try to guess the country in the image. Can you beat the AI?")
|
116 |
+
gr.Markdown("## Instructions:")
|
117 |
+
gr.Markdown("\n1. First to Start playing press **Get New Image** at the bottom (the server needs to refresh from the cache and previous user)\n2. Select the country where you think the image was taken.\n3. Review the results.\n4. Play again by clicking **Get New Image**")
|
118 |
img = gr.Image(image)
|
119 |
radio = gr.Radio(choices=options, label ="Select the country:")
|
120 |
ai_pred = gr.Markdown()
|