Download scripts/script.py from MONAI/breast_density_classification: direct link, hf CLI and curl.
- Browser
- Download file 593 Bytes
-
https://huggingface.co/MONAI/breast_density_classification/resolve/main/scripts/script.py
- Command line
-
hf download hf://MONAI/breast_density_classification/scripts/script.py
-
curl -L -o script.py https://huggingface.co/MONAI/breast_density_classification/resolve/main/scripts/script.py
593 Bytes
| import os | |
| from monai.bundle.config_parser import ConfigParser | |
| os.environ["CUDA_DEVICE_IRDER"] = "PCI_BUS_ID" | |
| os.environ["CUDA_VISIBLE_DEVICES"] = "0" | |
| parser = ConfigParser() | |
| parser.read_config("../configs/inference.json") | |
| data = parser.get_parsed_content("data") | |
| device = parser.get_parsed_content("device") | |
| network = parser.get_parsed_content("network_def") | |
| inference = parser.get_parsed_content("evaluator") | |
| inference.run() | |
| print(type(network)) | |
| datalist = parser.get_parsed_content("test_imagelist") | |
| print(datalist) | |
| inference = parser.get_parsed_content("evaluator") | |
| inference.run() | |