Instructions to use mccaly/test2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mccaly/test2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-segmentation", model="mccaly/test2")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, UperNetForSemanticSegmentation processor = AutoImageProcessor.from_pretrained("mccaly/test2") model = UperNetForSemanticSegmentation.from_pretrained("mccaly/test2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download tests/test_utils/test_make_divisible.py from mccaly/test2: direct link, hf CLI and curl.
- Browser
- Download file 376 Bytes
-
https://huggingface.co/mccaly/test2/resolve/main/tests/test_utils/test_make_divisible.py
- Command line
-
hf download hf://mccaly/test2/tests/test_utils/test_make_divisible.py
-
curl -L -o test_make_divisible.py https://huggingface.co/mccaly/test2/resolve/main/tests/test_utils/test_make_divisible.py
376 Bytes
| from mmseg.models.utils import make_divisible | |
| def test_make_divisible(): | |
| # test with min_value = None | |
| assert make_divisible(10, 4) == 12 | |
| assert make_divisible(9, 4) == 12 | |
| assert make_divisible(1, 4) == 4 | |
| # test with min_value = 8 | |
| assert make_divisible(10, 4, 8) == 12 | |
| assert make_divisible(9, 4, 8) == 12 | |
| assert make_divisible(1, 4, 8) == 8 | |