diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..29e743c --- /dev/null +++ b/404.html @@ -0,0 +1,1071 @@ + + + +
+ + + + + + + + + + + + + + +Here you will find the documentation for all of our implemented models.
+pixano_inference.pytorch.deeplabv3
+
+
+DeepLabV3(model_id='', device='cuda')
+
+
+ Bases: InferenceModel
PyTorch Hub DeepLabV3 Model
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
name |
+
+ str
+ |
+
+
+
+ Model name + |
+
model_id |
+
+ str
+ |
+
+
+
+ Model ID + |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device + |
+
description |
+
+ str
+ |
+
+
+
+ Model description + |
+
model |
+
+ Module
+ |
+
+
+
+ PyTorch model + |
+
transforms |
+
+ Module
+ |
+
+
+
+ PyTorch preprocessing transforms + |
+
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
model_id |
+
+ str
+ |
+
+
+
+ Previously used ID, generate new ID if "". Defaults to "". + |
+
+ ''
+ |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "cuda", "cpu"). Defaults to "cuda". + |
+
+ 'cuda'
+ |
+
pixano_inference/pytorch/deeplabv3.py
60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 |
|
preannotate(batch, views, uri_prefix, threshold=0.0)
+
+Inference pre-annotation for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
threshold |
+
+ float
+ |
+
+
+
+ Confidence threshold. Defaults to 0.0. + |
+
+ 0.0
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[dict]
+ |
+
+
+
+ Processed rows + |
+
pixano_inference/pytorch/deeplabv3.py
94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 |
|
unmold_mask(mask, threshold=0.5)
+
+Convert mask from torch.Tensor to np.array, squeeze a dimension if needed, and treshold values
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
mask |
+
+ Tensor
+ |
+
+
+
+ Mask (1, W, H) + |
+ + required + | +
threshold |
+
+ float
+ |
+
+
+
+ Confidence threshold. Defaults to 0.5. + |
+
+ 0.5
+ |
+
Returns:
+Type | +Description | +
---|---|
+ array
+ |
+
+
+
+ Mask (W, H) + |
+
pixano_inference/pytorch/deeplabv3.py
24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 |
|
pixano_inference.pytorch.maskrcnnv2
+
+
+MaskRCNNv2(model_id='', device='cuda')
+
+
+ Bases: InferenceModel
PyTorch Hub MaskRCNNv2 Model
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
name |
+
+ str
+ |
+
+
+
+ Model name + |
+
model_id |
+
+ str
+ |
+
+
+
+ Model ID + |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device + |
+
description |
+
+ str
+ |
+
+
+
+ Model description + |
+
model |
+
+ Module
+ |
+
+
+
+ PyTorch model + |
+
transforms |
+
+ Module
+ |
+
+
+
+ PyTorch preprocessing transforms + |
+
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
model_id |
+
+ str
+ |
+
+
+
+ Previously used ID, generate new ID if "". Defaults to "". + |
+
+ ''
+ |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "cuda", "cpu"). Defaults to "cuda". + |
+
+ 'cuda'
+ |
+
pixano_inference/pytorch/maskrcnnv2.py
63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 |
|
preannotate(batch, views, uri_prefix, threshold=0.0)
+
+Inference pre-annotation for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
threshold |
+
+ float
+ |
+
+
+
+ Confidence threshold. Defaults to 0.0. + |
+
+ 0.0
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[dict]
+ |
+
+
+
+ Processed rows + |
+
pixano_inference/pytorch/maskrcnnv2.py
92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 |
|
unmold_mask(mask, threshold=0.5)
+
+Convert mask from torch.Tensor to np.array, squeeze a dimension if needed, and treshold values
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
mask |
+
+ Tensor
+ |
+
+
+
+ Mask (1, W, H) + |
+ + required + | +
threshold |
+
+ float
+ |
+
+
+
+ Confidence threshold. Defaults to 0.5. + |
+
+ 0.5
+ |
+
Returns:
+Type | +Description | +
---|---|
+ array
+ |
+
+
+
+ Mask (W, H) + |
+
pixano_inference/pytorch/maskrcnnv2.py
27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 |
|
pixano_inference.pytorch.yolov5
+
+
+YOLOv5(size='s', model_id='', device='cuda')
+
+
+ Bases: InferenceModel
PyTorch Hub YOLOv5 Model
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
name |
+
+ str
+ |
+
+
+
+ Model name + |
+
model_id |
+
+ str
+ |
+
+
+
+ Model ID + |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device + |
+
description |
+
+ str
+ |
+
+
+
+ Model description + |
+
model |
+
+ Module
+ |
+
+
+
+ PyTorch model + |
+
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
size |
+
+ str
+ |
+
+
+
+ Model size ("n", "s", "m", "x"). Defaults to "s". + |
+
+ 's'
+ |
+
model_id |
+
+ str
+ |
+
+
+
+ Previously used ID, generate new ID if "". Defaults to "". + |
+
+ ''
+ |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "cuda", "cpu"). Defaults to "cuda". + |
+
+ 'cuda'
+ |
+
pixano_inference/pytorch/yolov5.py
33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 |
|
preannotate(batch, views, uri_prefix, threshold=0.0)
+
+Inference pre-annotation for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
threshold |
+
+ float
+ |
+
+
+
+ Confidence threshold. Defaults to 0.0. + |
+
+ 0.0
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[dict]
+ |
+
+
+
+ Processed rows + |
+
pixano_inference/pytorch/yolov5.py
62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 |
|
pixano_inference.segment_anything.mobile_sam
+
+
+MobileSAM(checkpoint_path, model_id='', device='cpu')
+
+
+ Bases: InferenceModel
MobileSAM
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
name |
+
+ str
+ |
+
+
+
+ Model name + |
+
model_id |
+
+ str
+ |
+
+
+
+ Model ID + |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "cuda", "cpu") + |
+
description |
+
+ str
+ |
+
+
+
+ Model description + |
+
model |
+
+ Module
+ |
+
+
+
+ MobileSAM model + |
+
checkpoint_path |
+
+ Path
+ |
+
+
+
+ Model checkpoint path + |
+
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
checkpoint_path |
+
+ Path
+ |
+
+
+
+ Model checkpoint path. + |
+ + required + | +
model_id |
+
+ str
+ |
+
+
+
+ Previously used ID, generate new ID if "". Defaults to "". + |
+
+ ''
+ |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "cuda", "cpu"). Defaults to "cpu". + |
+
+ 'cpu'
+ |
+
pixano_inference/segment_anything/mobile_sam.py
43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 |
|
export_to_onnx(library_dir)
+
+Export Torch model to ONNX
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
library_dir |
+
+ Path
+ |
+
+
+
+ Dataset library directory + |
+ + required + | +
pixano_inference/segment_anything/mobile_sam.py
177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 |
|
preannotate(batch, views, uri_prefix, threshold=0.0)
+
+Inference pre-annotation for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
threshold |
+
+ float
+ |
+
+
+
+ Confidence threshold. Defaults to 0.0. + |
+
+ 0.0
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[dict]
+ |
+
+
+
+ Processed rows + |
+
pixano_inference/segment_anything/mobile_sam.py
71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 |
|
precompute_embeddings(batch, views, uri_prefix)
+
+Embedding precomputing for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ RecordBatch
+ |
+
+
+
+ Embedding rows + |
+
pixano_inference/segment_anything/mobile_sam.py
131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 |
|
pixano_inference.segment_anything.sam
+
+
+SAM(checkpoint_path, size='h', model_id='', device='cuda')
+
+
+ Bases: InferenceModel
Segment Anything Model (SAM)
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
name |
+
+ str
+ |
+
+
+
+ Model name + |
+
model_id |
+
+ str
+ |
+
+
+
+ Model ID + |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "cuda", "cpu") + |
+
description |
+
+ str
+ |
+
+
+
+ Model description + |
+
model |
+
+ Module
+ |
+
+
+
+ SAM model + |
+
checkpoint_path |
+
+ Path
+ |
+
+
+
+ Model checkpoint path + |
+
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
checkpoint_path |
+
+ Path
+ |
+
+
+
+ Model checkpoint path. + |
+ + required + | +
size |
+
+ str
+ |
+
+
+
+ Model size ("b", "l", "h"). Defaults to "h". + |
+
+ 'h'
+ |
+
model_id |
+
+ str
+ |
+
+
+
+ Previously used ID, generate new ID if "". Defaults to "". + |
+
+ ''
+ |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "cuda", "cpu"). Defaults to "cuda". + |
+
+ 'cuda'
+ |
+
pixano_inference/segment_anything/sam.py
43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 |
|
export_to_onnx(library_dir)
+
+Export Torch model to ONNX
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
library_dir |
+
+ Path
+ |
+
+
+
+ Dataset library directory + |
+ + required + | +
pixano_inference/segment_anything/sam.py
179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 |
|
preannotate(batch, views, uri_prefix, threshold=0.0)
+
+Inference pre-annotation for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
threshold |
+
+ float
+ |
+
+
+
+ Confidence threshold. Defaults to 0.0. + |
+
+ 0.0
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[dict]
+ |
+
+
+
+ Processed rows + |
+
pixano_inference/segment_anything/sam.py
73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 |
|
precompute_embeddings(batch, views, uri_prefix)
+
+Embedding precomputing for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ RecordBatch
+ |
+
+
+
+ Embedding rows + |
+
pixano_inference/segment_anything/sam.py
133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 |
|
pixano_inference.tensorflow.efficientdet
+
+
+EfficientDet(model_id='', device='/GPU:0')
+
+
+ Bases: InferenceModel
TensorFlow Hub EfficientDet Model
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
name |
+
+ str
+ |
+
+
+
+ Model name + |
+
model_id |
+
+ str
+ |
+
+
+
+ Model ID + |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device + |
+
description |
+
+ str
+ |
+
+
+
+ Model description + |
+
model |
+
+ Model
+ |
+
+
+
+ TensorFlow model + |
+
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
model_id |
+
+ str
+ |
+
+
+
+ Previously used ID, generate new ID if "". Defaults to "". + |
+
+ ''
+ |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "/GPU:0", "/CPU:0"). Defaults to "/GPU:0". + |
+
+ '/GPU:0'
+ |
+
pixano_inference/tensorflow/efficientdet.py
34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 |
|
preannotate(batch, views, uri_prefix, threshold=0.0)
+
+Inference pre-annotation for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
threshold |
+
+ float
+ |
+
+
+
+ Confidence threshold. Defaults to 0.0. + |
+
+ 0.0
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[dict]
+ |
+
+
+
+ Processed rows + |
+
pixano_inference/tensorflow/efficientdet.py
57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 |
|
pixano_inference.tensorflow.fasterrcnn
+
+
+FasterRCNN(model_id='', device='/GPU:0')
+
+
+ Bases: InferenceModel
TensorFlow Hub FasterRCNN Model
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
name |
+
+ str
+ |
+
+
+
+ Model name + |
+
model_id |
+
+ str
+ |
+
+
+
+ Model ID + |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device + |
+
description |
+
+ str
+ |
+
+
+
+ Model description + |
+
model |
+
+ Model
+ |
+
+
+
+ TensorFlow model + |
+
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
model_id |
+
+ str
+ |
+
+
+
+ Previously used ID, generate new ID if "". Defaults to "". + |
+
+ ''
+ |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "/GPU:0", "/CPU:0"). Defaults to "/GPU:0". + |
+
+ '/GPU:0'
+ |
+
pixano_inference/tensorflow/fasterrcnn.py
34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 |
|
preannotate(batch, views, uri_prefix, threshold=0.0)
+
+Inference pre-annotation for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
threshold |
+
+ float
+ |
+
+
+
+ Confidence threshold. Defaults to 0.0. + |
+
+ 0.0
+ |
+
Returns:
+Type | +Description | +
---|---|
+ list[dict]
+ |
+
+
+
+ Processed rows + |
+
pixano_inference/tensorflow/fasterrcnn.py
59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 |
|
pixano_inference.transformers.clip
+
+
+CLIP(pretrained_model='openai/clip-vit-base-patch32', model_id='')
+
+
+ Bases: InferenceModel
CLIP: Connecting text and images
+ + + +Attributes:
+Name | +Type | +Description | +
---|---|---|
name |
+
+ str
+ |
+
+
+
+ Model name + |
+
model_id |
+
+ str
+ |
+
+
+
+ Model ID + |
+
device |
+
+ str
+ |
+
+
+
+ Model GPU or CPU device (e.g. "cuda", "cpu") + |
+
description |
+
+ str
+ |
+
+
+
+ Model description + |
+
model |
+
+ CLIPModel
+ |
+
+
+
+ CLIP model + |
+
processor |
+
+ CLIPProcessor
+ |
+
+
+
+ CLIP processor + |
+
tokenizer |
+
+ CLIPTokenizerFast
+ |
+
+
+
+ CLIP tokenizer + |
+
pretrained_model |
+
+ str
+ |
+
+
+
+ Pretrained model name or path + |
+
Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
pretrained_model |
+
+ str
+ |
+
+
+
+ Pretrained model name or path + |
+
+ 'openai/clip-vit-base-patch32'
+ |
+
model_id |
+
+ str
+ |
+
+
+
+ Previously used ID, generate new ID if "". Defaults to "". + |
+
+ ''
+ |
+
pixano_inference/transformers/clip.py
36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 |
|
precompute_embeddings(batch, views, uri_prefix)
+
+Embedding precomputing for a batch
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
batch |
+
+ RecordBatch
+ |
+
+
+
+ Input batch + |
+ + required + | +
views |
+
+ list[str]
+ |
+
+
+
+ Dataset views + |
+ + required + | +
uri_prefix |
+
+ str
+ |
+
+
+
+ URI prefix for media files + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ RecordBatch
+ |
+
+
+
+ Embedding rows + |
+
pixano_inference/transformers/clip.py
63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 |
|
semantic_search(query)
+
+Process semantic search query with CLIP
+ + + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
query |
+
+ str
+ |
+
+
+
+ Search query text + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ ndarray
+ |
+
+
+
+ Search query vector + |
+
pixano_inference/transformers/clip.py
105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 |
|
{"use strict";/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var $a=/["'&<>]/;Un.exports=Ra;function Ra(e){var t=""+e,r=$a.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i