Instructions to use microsoft/colipri with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- COLIPRI
How to use microsoft/colipri with COLIPRI:
pip install colipri
from colipri import get_model from colipri import get_processor from colipri import load_sample_ct from colipri import ZeroShotImageClassificationPipeline model = get_model().cuda() processor = get_processor() pipeline = ZeroShotImageClassificationPipeline("microsoft/colipri", processor) image = load_sample_ct() pipeline(image, ["No lung nodules", "Lung nodules"]) - Notebooks
- Google Colab
- Kaggle
Update unit test
Browse files- tests/test_custom_config.py +9 -4
- uv.lock +1 -1
tests/test_custom_config.py
CHANGED
|
@@ -75,10 +75,15 @@ class TestGetProcessorCustomConfig:
|
|
| 75 |
resolved_processor_config: DictConfig,
|
| 76 |
) -> None:
|
| 77 |
"""Full processor DictConfig → Processor matching that config."""
|
| 78 |
-
# Remove all but the first transform to distinguish from default (5
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
processor = get_processor(
|
| 83 |
config=resolved_processor_config,
|
| 84 |
image_only=True,
|
|
|
|
| 75 |
resolved_processor_config: DictConfig,
|
| 76 |
) -> None:
|
| 77 |
"""Full processor DictConfig → Processor matching that config."""
|
| 78 |
+
# Remove all but the first transform to distinguish from default (5
|
| 79 |
+
# transforms). The transforms are stored as a named mapping
|
| 80 |
+
# (e.g. {"to_orientation": ..., "resample": ...}), so keep only the
|
| 81 |
+
# first key.
|
| 82 |
+
transforms = resolved_processor_config.image_transform.transforms
|
| 83 |
+
first_key = next(iter(transforms))
|
| 84 |
+
resolved_processor_config.image_transform.transforms = {
|
| 85 |
+
first_key: transforms[first_key]
|
| 86 |
+
}
|
| 87 |
processor = get_processor(
|
| 88 |
config=resolved_processor_config,
|
| 89 |
image_only=True,
|
uv.lock
CHANGED
|
@@ -271,7 +271,7 @@ wheels = [
|
|
| 271 |
|
| 272 |
[[package]]
|
| 273 |
name = "colipri"
|
| 274 |
-
version = "0.1.
|
| 275 |
source = { editable = "." }
|
| 276 |
dependencies = [
|
| 277 |
{ name = "accelerate" },
|
|
|
|
| 271 |
|
| 272 |
[[package]]
|
| 273 |
name = "colipri"
|
| 274 |
+
version = "0.1.2"
|
| 275 |
source = { editable = "." }
|
| 276 |
dependencies = [
|
| 277 |
{ name = "accelerate" },
|