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/Dataset/Rename.py from AndreCosta/resnet-unet-segmentation: direct link, hf CLI and curl.
- Browser
- Download file 623 Bytes
-
https://huggingface.co/AndreCosta/resnet-unet-segmentation/resolve/main/scripts/Dataset/Rename.py
- Command line
-
hf download hf://AndreCosta/resnet-unet-segmentation/scripts/Dataset/Rename.py
-
curl -L -o Rename.py https://huggingface.co/AndreCosta/resnet-unet-segmentation/resolve/main/scripts/Dataset/Rename.py
623 Bytes
| #encoding=utf8 | |
| import os | |
| import scripts.config as config | |
| extension = '.jpg' | |
| print('Starting processing...') | |
| contador = 0 | |
| paths = [os.path.join(config.images, nome) for nome in os.listdir(config.images)] | |
| files = [arq for arq in paths if os.path.isfile(arq)] | |
| jpgs = [arq for arq in files if arq.lower().endswith(extension)] | |
| for img in jpgs: | |
| imagePath = str(img) | |
| oldName = imagePath.replace(config.images, '') | |
| print('\n ' + oldName) | |
| newName = config.images + str(contador) + extension | |
| os.rename(imagePath, newName) | |
| contador = contador + 1 | |
| print('\n\nCompleted...') | |