Skip to content

Commit

Permalink
Merge pull request #37 from reginabarzilaygroup/v1.2.1_dev
Browse files Browse the repository at this point in the history
V1.2.1 dev
  • Loading branch information
jsilter authored Apr 29, 2024
2 parents faf596b + 485d6d1 commit 6618b4f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
5 changes: 3 additions & 2 deletions scripts/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def inference(
with open(prediction_path, "w") as f:
json.dump(pred_dict, f, indent=2)

series_with_attention = None
if return_attentions:
attention_path = os.path.join(output_dir, "attention_scores.pkl")
with open(attention_path, "wb") as f:
Expand All @@ -124,7 +125,7 @@ def inference(
gain=3,
)

return pred_dict
return pred_dict, series_with_attention


def main():
Expand All @@ -133,7 +134,7 @@ def main():

os.makedirs(args.output_dir, exist_ok=True)

pred_dict = inference(
pred_dict, series_with_attention = inference(
args.image_dir,
args.output_dir,
args.model_name,
Expand Down
18 changes: 10 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ author_email =
license_file = LICENSE.txt
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8; variant=GFM
version = 1.2.0
version = 1.2.1
# url =
project_urls =
; Documentation = https://.../docs
Expand All @@ -32,22 +32,24 @@ python_requires = >=3.8
# Version specifiers like >=2.2,<3.0 avoid problems due to API changes in
# new major versions. This works if the required packages follow Semantic Versioning.
# For more information, check out https://semver.org/.
# Use --find-links https://download.pytorch.org/whl/cu113/torch_stable.html for torch libraries
# Use --find-links https://download.pytorch.org/whl/cu117/torch_stable.html for torch libraries
install_requires =
importlib-metadata; python_version>="3.8"
numpy==1.24.1
torch==1.11.0+cu113; sys_platform != "darwin"
torch==1.11.0; sys_platform == "darwin"
torchvision==0.12.0+cu113; sys_platform != "darwin"
torchvision==0.12.0; sys_platform == "darwin"
pytorch_lightning==1.5.6
torch==1.13.1+cu117; sys_platform != "darwin"
torch==1.13.1; sys_platform == "darwin"
torchvision==0.14.1+cu117; sys_platform != "darwin"
torchvision==0.14.1; sys_platform == "darwin"
pytorch_lightning==1.6.0
scikit-learn==1.0.2
tqdm==4.62.3
lifelines==0.26.4
opencv-python==4.5.4.60
opencv-python-headless==4.5.4.60
albumentations==1.1.0
pydicom==2.2.2
pillow>=10.2.0
pydicom==2.3.0
pylibjpeg[all]==2.0.0
torchio==0.18.74
gdown==4.6.0

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ deps =
# flake8
# mypy
# black
install_command = pip install --pre --find-links https://download.pytorch.org/whl/cu113/torch_stable.html {opts} {packages}
install_command = pip install --pre --find-links https://download.pytorch.org/whl/cu117/torch_stable.html {opts} {packages}
commands =
pytest {posargs}
# black {toxinidir}/sybil --check
Expand Down

0 comments on commit 6618b4f

Please sign in to comment.