Added use_openvino attribute of FlarePredictor class#3019
Conversation
|
@ykirchhoff can you please review this? I can merge it for you once you give your 👍 |
There was a problem hiding this comment.
| parser.add_argument("-no_openvino", action="store_true") |
There was a problem hiding this comment.
| predict_flare(args.input, args.output, args.model, not args.no_openvino) |
There was a problem hiding this comment.
| def predict_flare(input_dir, output_dir, model_folder, use_openvino=True): |
| tile_step_size: float = 0.5, | ||
| use_gaussian: bool = True, | ||
| use_mirroring: bool = True, | ||
| perform_everything_on_device: bool = False, |
There was a problem hiding this comment.
| use_openvino: bool = True, | |
| perform_everything_on_device: bool = False, |
| ): | ||
| super().__init__(tile_step_size, use_gaussian, use_mirroring, perform_everything_on_device, device, verbose, | ||
| verbose_preprocessing, allow_tqdm) | ||
| self.use_openvino = True |
There was a problem hiding this comment.
| self.use_openvino = True | |
| self.use_openvino = use_openvino |
There was a problem hiding this comment.
| checkpoint_name: str = 'checkpoint_final.pth'): |
There was a problem hiding this comment.
| predictor = FlarePredictor(tile_step_size=0.5, use_mirroring=False, device=torch.device("cpu") | |
| use_openvino=use_openvino) |
There was a problem hiding this comment.
| predictor.initialize_from_trained_model_folder(model_folder, ("all",)) |
| if use_folds is None: | ||
| use_folds = nnUNetPredictor.auto_detect_available_folds(model_training_output_dir, checkpoint_name) | ||
|
|
||
| dataset_json = load_json(join(model_training_output_dir, 'dataset.json')) |
There was a problem hiding this comment.
| save_model = self.use_openvino and os.path.isfile(f"{model_training_output_dir}/model.xml") | |
| dataset_json = load_json(join(model_training_output_dir, 'dataset.json')) |
|
Hi @aiman-627, I commented a few things in the code, which I think make sense to change as it didn't really make sense the way I had it before. It looks a bit ugly unfortunately and I don't like working with the review tab 😅. Could you take a look at these suggestions and incorporate them in your merge request? |
|
Hi @ykirchhoff, I've added the changes you suggested, but I didn't run it to make sure it still worked or anything since I don't have the libraries setup and everything in my fork repo. Please check to see if it's correct. |
|
Hi @aiman-627, thanks for incorporating the changes. I will try running it and then approve it for the merge. Best, |
No description provided.