SlicerSegmentWithSAM
SlicerSegmentWithSAM copied to clipboard
Improve support for downloading `sam_vit_h_4b8939.pth`
The downloaded file being ~2.4GB, consider adding a confirmOkCancelDisplay to explain the user that large file will be downloaded and provide the user with an option to cancel the download if they would like to postpone.
https://github.com/mazurowski-lab/SlicerSegmentWithSAM/blob/dd0f59c05710cf86e1940455c7f41395f0a8bab7/SegmentWithSAM/SegmentWithSAM.py#L78-L81
Additionally, the file should probably be checked against a hash, this will be really helpful in case the download is interrupted or the connection is lost. Consider using SampleDataLogic.downloadFileIntoCache()^1
Examples referenced^2 in the script repository may also be helpful to review.
Since re-computing the hash of the file each time the module UI is shown will be detrimental to the user experience, once the checksum of the file has been verified once, consider write a file called sam_vit_h_4b8939.pth.verified.
Alternatively, you could include a button called "Download trained model checkpoints" with a label on its side reporting the status (Missing or Found ... or similar)