Spaces:
Paused
Paused
Commit
·
745efa8
1
Parent(s):
d1cf019
upd setup clean env to avoid bug
Browse files- .gitignore +1 -0
- benchmark.py +3 -0
- mapcrunch_controller.py +16 -0
.gitignore
CHANGED
|
@@ -3,4 +3,5 @@ venv/
|
|
| 3 |
__pycache__
|
| 4 |
.DS_Store
|
| 5 |
data/
|
|
|
|
| 6 |
results/
|
|
|
|
| 3 |
__pycache__
|
| 4 |
.DS_Store
|
| 5 |
data/
|
| 6 |
+
!data/golden_labels.json
|
| 7 |
results/
|
benchmark.py
CHANGED
|
@@ -151,6 +151,9 @@ class MapGuesserBenchmark:
|
|
| 151 |
|
| 152 |
bot.controller.setup_clean_environment()
|
| 153 |
|
|
|
|
|
|
|
|
|
|
| 154 |
screenshot = bot.take_screenshot()
|
| 155 |
if not screenshot:
|
| 156 |
return {
|
|
|
|
| 151 |
|
| 152 |
bot.controller.setup_clean_environment()
|
| 153 |
|
| 154 |
+
## TODO add interactive mode to go ahead, turn around and zoom in/out
|
| 155 |
+
# Mat still need JS to operate but can use selenium to do it or wrap a MCP server
|
| 156 |
+
|
| 157 |
screenshot = bot.take_screenshot()
|
| 158 |
if not screenshot:
|
| 159 |
return {
|
mapcrunch_controller.py
CHANGED
|
@@ -26,6 +26,17 @@ class MapCrunchController:
|
|
| 26 |
"""
|
| 27 |
self.driver.execute_script("if(typeof hideLoc === 'function') hideLoc();")
|
| 28 |
self.driver.execute_script("""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
const topBar = document.querySelector('#topbar');
|
| 30 |
if (topBar) topBar.style.display = 'none';
|
| 31 |
|
|
@@ -34,6 +45,11 @@ class MapCrunchController:
|
|
| 34 |
|
| 35 |
const infoFirstView = document.querySelector('#info-firstview');
|
| 36 |
if (infoFirstView) infoFirstView.style.display = 'none';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
""")
|
| 38 |
|
| 39 |
def label_arrows_on_screen(self):
|
|
|
|
| 26 |
"""
|
| 27 |
self.driver.execute_script("if(typeof hideLoc === 'function') hideLoc();")
|
| 28 |
self.driver.execute_script("""
|
| 29 |
+
const menu = document.querySelector('#menu');
|
| 30 |
+
if (menu) menu.style.display = 'none';
|
| 31 |
+
|
| 32 |
+
const social = document.querySelector('#social');
|
| 33 |
+
if (social) social.style.display = 'none';
|
| 34 |
+
|
| 35 |
+
const googleImg = document.querySelector('img[alt="Google"]');
|
| 36 |
+
if (googleImg && googleImg.parentElement) {
|
| 37 |
+
googleImg.parentElement.style.display = 'none';
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
const topBar = document.querySelector('#topbar');
|
| 41 |
if (topBar) topBar.style.display = 'none';
|
| 42 |
|
|
|
|
| 45 |
|
| 46 |
const infoFirstView = document.querySelector('#info-firstview');
|
| 47 |
if (infoFirstView) infoFirstView.style.display = 'none';
|
| 48 |
+
|
| 49 |
+
const controlsToHide = document.querySelectorAll('.gm-style-cc'); controlsToHide.forEach(el => { el.style.display = 'none'; });
|
| 50 |
+
const keyboardButton = document.querySelector('button[aria-label="Keyboard shortcuts"]'); if (keyboardButton) { keyboardButton.style.display = 'none'; }
|
| 51 |
+
|
| 52 |
+
|
| 53 |
""")
|
| 54 |
|
| 55 |
def label_arrows_on_screen(self):
|