11import os
2+ import sys
23import json
34import glob
45import ssl
@@ -34,7 +35,9 @@ def run(self):
3435 try :
3536 writable_dir = os .path .join (os .path .expanduser ("~" ), ".soccernet_workspace" )
3637 os .makedirs (writable_dir , exist_ok = True )
38+
3739 writable_dir_fwd = writable_dir .replace ('\\ ' , '/' )
40+ logs_dir_fwd = os .path .join (writable_dir , "logs" ).replace ('\\ ' , '/' )
3841
3942 with open (self .json_path , 'r' , encoding = 'utf-8' ) as f :
4043 original_data = json .load (f )
@@ -80,13 +83,10 @@ def run(self):
8083 with open (self .config_path , 'r' , encoding = 'utf-8' ) as f :
8184 config_text = f .read ()
8285
83- logs_dir_fwd = os .path .join (writable_dir , "logs" ).replace ('\\ ' , '/' )
84-
8586 config_text = config_text .replace ('./temp_workspace' , writable_dir_fwd )
86- config_text = config_text .replace ('./logs' , logs_dir_fwd )
87+ config_text = config_text .replace ('./logs' , logs_dir_fwd )
8788
8889 temp_config_path = os .path .join (writable_dir , f"temp_config_{ unique_id } .yaml" )
89-
9090 with open (temp_config_path , 'w' , encoding = 'utf-8' ) as f :
9191 f .write (config_text )
9292
@@ -96,6 +96,7 @@ def run(self):
9696 pretrained = "jeetv/snpro-classification-mvit"
9797 )
9898
99+
99100 checkpoint_dir = os .path .join (writable_dir , "checkpoints" )
100101 search_pattern = os .path .join (checkpoint_dir , "**" , "predictions_test_epoch_*.json" )
101102 pred_files = glob .glob (search_pattern , recursive = True )
@@ -170,7 +171,6 @@ def __init__(self, main_window):
170171 self .main = main_window
171172 self .ui = main_window .ui
172173
173- import sys
174174 if hasattr (sys , '_MEIPASS' ):
175175 self .base_dir = sys ._MEIPASS
176176 else :
0 commit comments