Instructions to use replicate/cv_utils with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use replicate/cv_utils with Kernels:
# !pip install kernels from kernels import get_kernel kernel = get_kernel("replicate/cv_utils") - Notebooks
- Google Colab
- Kaggle
Download torch-ext/torch_binding.cpp from replicate/cv_utils: direct link, hf CLI and curl.
- Browser
- Download file 471 Bytes
-
https://huggingface.co/replicate/cv_utils/resolve/main/torch-ext/torch_binding.cpp
- Command line
-
hf download hf://replicate/cv_utils/torch-ext/torch_binding.cpp
-
curl -L -o torch_binding.cpp https://huggingface.co/replicate/cv_utils/resolve/main/torch-ext/torch_binding.cpp
471 Bytes
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| ops.def("cc_2d(Tensor inputs, bool get_counts) -> Tensor[]"); | |
| ops.impl("cc_2d", torch::kCUDA, &connected_components_labeling_2d); | |
| ops.def("generic_nms(Tensor dets, Tensor scores, float iou_threshold, bool use_iou_matrix) -> Tensor"); | |
| ops.impl("generic_nms", torch::kCUDA, &generic_nms); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) |