Spaces:
Sleeping
Sleeping
Download lungtumormask/__main__.py from andreped/LungTumorMask: direct link, hf CLI and curl.
- Browser
- Download file 563 Bytes
-
https://huggingface.co/spaces/andreped/LungTumorMask/resolve/0afdf0e4a73b7a96887f7e4ca00a4266310a938a/lungtumormask/__main__.py
- Command line
-
hf download hf://spaces/andreped/LungTumorMask@0afdf0e4a73b7a96887f7e4ca00a4266310a938a/lungtumormask/__main__.py
-
curl -L -o __main__.py https://huggingface.co/spaces/andreped/LungTumorMask/resolve/0afdf0e4a73b7a96887f7e4ca00a4266310a938a/lungtumormask/__main__.py
563 Bytes
| import sys | |
| import argparse | |
| import os | |
| from lungtumormask import mask | |
| def path(string): | |
| if os.path.exists(string): | |
| return string | |
| else: | |
| sys.exit(f'File not found: {string}') | |
| def main(): | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('input', metavar='input', type=path, help='Path to the input image, should be .nifti') | |
| parser.add_argument('output', metavar='output', type=str, help='Filepath for output tumormask') | |
| argsin = sys.argv[1:] | |
| args = parser.parse_args(argsin) | |
| mask.mask(args.input, args.output) | |