Spaces:
Build error
Build error
Download image_processor.py from Subhajit01/Brain_Tumor_Detection: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/spaces/Subhajit01/Brain_Tumor_Detection/resolve/main/image_processor.py
- Command line
-
hf download hf://spaces/Subhajit01/Brain_Tumor_Detection/image_processor.py
-
curl -L -o image_processor.py https://huggingface.co/spaces/Subhajit01/Brain_Tumor_Detection/resolve/main/image_processor.py
417 Bytes
| from saliency import * | |
| from visualizeer import * | |
| def processor(model, image_path, device): | |
| model.load_state_dict(torch.load('./model.pth', map_location=device, weights_only=True)) | |
| model.eval() | |
| s_image = generate_saliency(model, image_path,device) | |
| g_image= overlay_heatmap(image_path, model, device) | |
| b_image = overlay_heatmap1(image_path, model, device) | |
| return s_image, b_image, g_image |