Skip to content

Commit 3f32df8

Browse files
committed
use predict_from_files_sequential when nps and npp are zero
1 parent 5787a9a commit 3f32df8

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

nnunetv2/inference/predict_from_raw_data.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -959,13 +959,26 @@ def predict_entry_point():
959959
args.f,
960960
checkpoint_name=args.chk
961961
)
962-
predictor.predict_from_files(args.i, args.o, save_probabilities=args.save_probabilities,
963-
overwrite=not args.continue_prediction,
964-
num_processes_preprocessing=args.npp,
965-
num_processes_segmentation_export=args.nps,
966-
folder_with_segs_from_prev_stage=args.prev_stage_predictions,
967-
num_parts=args.num_parts,
968-
part_id=args.part_id)
962+
963+
run_sequential = args.nps == 0 and args.npp == 0
964+
965+
if run_sequential:
966+
967+
print("Running in non-multiprocessing mode")
968+
predictor.predict_from_files_sequential(args.i, args.o, save_probabilities=args.save_probabilities,
969+
overwrite=not args.continue_prediction,
970+
folder_with_segs_from_prev_stage=args.prev_stage_predictions)
971+
972+
else:
973+
974+
predictor.predict_from_files(args.i, args.o, save_probabilities=args.save_probabilities,
975+
overwrite=not args.continue_prediction,
976+
num_processes_preprocessing=args.npp,
977+
num_processes_segmentation_export=args.nps,
978+
folder_with_segs_from_prev_stage=args.prev_stage_predictions,
979+
num_parts=args.num_parts,
980+
part_id=args.part_id)
981+
969982
# r = predict_from_raw_data(args.i,
970983
# args.o,
971984
# model_folder,

0 commit comments

Comments
 (0)