SovanK commited on
Commit
fc80bee
·
verified ·
1 Parent(s): 0129eb2

Upload folder using huggingface_hub

Browse files
__pycache__/jolia_atlas_transform.cpython-312.pyc ADDED
Binary file (29.8 kB). View file
 
__pycache__/jolia_windowing.cpython-312.pyc ADDED
Binary file (24.4 kB). View file
 
__pycache__/preprocessing_jolia.cpython-312.pyc ADDED
Binary file (4.52 kB). View file
 
jolia_atlas_transform.py CHANGED
@@ -10,7 +10,10 @@ from typing import TYPE_CHECKING, Sequence, Union
10
 
11
  import torch
12
  import torch.nn.functional as F
13
- from .jolia_windowing import batch_apply_windowing_vectorized
 
 
 
14
 
15
  if TYPE_CHECKING:
16
  import numpy as np
 
10
 
11
  import torch
12
  import torch.nn.functional as F
13
+ try:
14
+ from .jolia_windowing import batch_apply_windowing_vectorized
15
+ except ImportError:
16
+ from jolia_windowing import batch_apply_windowing_vectorized
17
 
18
  if TYPE_CHECKING:
19
  import numpy as np
preprocessing_jolia.py CHANGED
@@ -21,14 +21,26 @@ from typing import Union
21
 
22
  import torch
23
 
24
- from .jolia_atlas_transform import (
25
- ApplyWindowing,
26
- AtlasTransform,
27
- Crop3D,
28
- Pad3D,
29
- PrepareVolume,
30
- Resample3D,
31
- )
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  try: # numpy is optional at import time; only needed for ndarray inputs
34
  import numpy as np
 
21
 
22
  import torch
23
 
24
+ # Works both inside a package (HF trust_remote_code) and as a top-level module
25
+ # (the `snapshot_download` + `sys.path.append` flow in the README).
26
+ try:
27
+ from .jolia_atlas_transform import (
28
+ ApplyWindowing,
29
+ AtlasTransform,
30
+ Crop3D,
31
+ Pad3D,
32
+ PrepareVolume,
33
+ Resample3D,
34
+ )
35
+ except ImportError:
36
+ from jolia_atlas_transform import (
37
+ ApplyWindowing,
38
+ AtlasTransform,
39
+ Crop3D,
40
+ Pad3D,
41
+ PrepareVolume,
42
+ Resample3D,
43
+ )
44
 
45
  try: # numpy is optional at import time; only needed for ndarray inputs
46
  import numpy as np