Skip to content

Commit

Permalink
remove psutils and fury dependency from setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wasserth committed Mar 27, 2024
1 parent 387e2b7 commit e37838e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest Cython
pip install pytest Cython fury
pip install torch==2.1.0 -f https://download.pytorch.org/whl/cpu
pip install .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade pip
pip install pytest Cython
pip install pytest Cython fury
pip install torch==2.0.0 -f https://download.pytorch.org/whl/cpu
pip install .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_subtasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest Cython
pip install pytest Cython fury
pip install torch==2.2.0 -f https://download.pytorch.org/whl/cpu
pip install .
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Install dependencies:
* [Pytorch](http://pytorch.org/) >= 2.0.0

Optionally:
* if you use the option `--preview` you have to install xvfb (`apt-get install xvfb`)
* if you use the option `--preview` you have to install xvfb (`apt-get install xvfb`) and fury (`pip install fury`)


Install Totalsegmentator
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
install_requires=[
'torch>=2.0.0',
'numpy',
'psutil',
'SimpleITK',
'nibabel>=2.3.0',
'tqdm>=4.45.0',
'p_tqdm',
'xvfbwrapper',
'fury',
'nnunetv2>=2.2.1',
'requests==2.27.1;python_version<"3.10"',
'requests;python_version>="3.10"',
Expand Down
4 changes: 2 additions & 2 deletions totalsegmentator/resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import os
import time
import importlib
import multiprocessing

import numpy as np
import nibabel as nib
from scipy import ndimage
import psutil
from joblib import Parallel, delayed

cupy_available = importlib.util.find_spec("cupy") is not None
Expand Down Expand Up @@ -44,7 +44,7 @@ def _process_gradient(grad_idx):
if dim == 3:
img = img[..., None]

nr_cpus = psutil.cpu_count() if nr_cpus == -1 else nr_cpus
nr_cpus = multiprocessing.cpu_count() if nr_cpus == -1 else nr_cpus
img_sm = Parallel(n_jobs=nr_cpus)(delayed(_process_gradient)(grad_idx) for grad_idx in range(img.shape[3]))
img_sm = np.array(img_sm).transpose(1, 2, 3, 0) # grads channel was in front -> put to back
# Remove added dimensions
Expand Down

0 comments on commit e37838e

Please sign in to comment.