euler314 commited on
Commit
84b95bc
·
verified ·
1 Parent(s): 6a45b16

Fix standalone Trackformer 1.2 example execution

Browse files
.gitattributes CHANGED
@@ -3,3 +3,4 @@ models/trackformer_1_1/trackformer_1_1_norm_stats.npz filter=lfs diff=lfs merge=
3
  paper/trackformer_1_2_dolphin_pressure_map.png filter=lfs diff=lfs merge=lfs -text
4
  paper/trackformer_1_2_vs_1_1_matched100_mae.png filter=lfs diff=lfs merge=lfs -text
5
  paper/trackformer_1_2_28_vs_1_1_matched100_mae.png filter=lfs diff=lfs merge=lfs -text
 
 
3
  paper/trackformer_1_2_dolphin_pressure_map.png filter=lfs diff=lfs merge=lfs -text
4
  paper/trackformer_1_2_vs_1_1_matched100_mae.png filter=lfs diff=lfs merge=lfs -text
5
  paper/trackformer_1_2_28_vs_1_1_matched100_mae.png filter=lfs diff=lfs merge=lfs -text
6
+ __pycache__/trackformer_1_2.cpython-314.pyc filter=lfs diff=lfs merge=lfs -text
__pycache__/trackformer_1_2.cpython-314.pyc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f59227b39667ebc698b371ccc0c3f0611cb07d622e6deb5e60b4e9d59d466223
3
+ size 107150
examples/predict_trackformer_1_2.py CHANGED
@@ -17,9 +17,16 @@ from __future__ import annotations
17
 
18
  import argparse
19
  from pathlib import Path
 
20
 
21
  import numpy as np
22
 
 
 
 
 
 
 
23
  from trackformer_1_2 import MODEL_VERSION, Trackformer12, local_position_to_latlon
24
 
25
 
 
17
 
18
  import argparse
19
  from pathlib import Path
20
+ import sys
21
 
22
  import numpy as np
23
 
24
+ # Keep ``python examples/predict_trackformer_1_2.py`` runnable from an
25
+ # extracted release directory without requiring a package installation.
26
+ PACKAGE_ROOT = Path(__file__).resolve().parents[1]
27
+ if str(PACKAGE_ROOT) not in sys.path:
28
+ sys.path.insert(0, str(PACKAGE_ROOT))
29
+
30
  from trackformer_1_2 import MODEL_VERSION, Trackformer12, local_position_to_latlon
31
 
32