Instructions to use AndreCosta/resnet-unet-segmentation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AndreCosta/resnet-unet-segmentation with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="AndreCosta/resnet-unet-segmentation")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AndreCosta/resnet-unet-segmentation", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download scripts/config.py from AndreCosta/resnet-unet-segmentation: direct link, hf CLI and curl.
- Browser
- Download file 615 Bytes
-
https://huggingface.co/AndreCosta/resnet-unet-segmentation/resolve/main/scripts/config.py
- Command line
-
hf download hf://AndreCosta/resnet-unet-segmentation/scripts/config.py
-
curl -L -o config.py https://huggingface.co/AndreCosta/resnet-unet-segmentation/resolve/main/scripts/config.py
615 Bytes
| import os | |
| device = '' | |
| width = 512 | |
| height = 512 | |
| num_epochs = 100 | |
| checkpoint_interval = 2 | |
| early_stop_patience = 10 | |
| USE_TTA = True | |
| USE_REFINEMENT = True | |
| USE_FOCAL_LOSS = False | |
| source = str(os.path.dirname(os.path.realpath(__file__))).replace('scripts', '') | |
| images = source + 'DataSet/images/' | |
| masks = source + 'DataSet/masks/' | |
| annotations = source + 'DataSet/annotations/' | |
| extraTests = source + 'DataSet/ExtraTests/' | |
| tempImages = source + 'DataSet/tempImages/' | |
| checkpoints = source + 'checkpoints/' | |
| modelName = checkpoints + 'modelo_completo.pth'# 'modelo_completo.pth' | |
| report_file = source + 'report_file.txt' | |