|
403 | 403 | <li><p><strong>encoder_model</strong> (<a class="reference internal" href="sam_models.html#model_api.models.sam_models.SAMImageEncoder" title="model_api.models.sam_models.SAMImageEncoder"><em>SAMImageEncoder</em></a>) – initialized decoder wrapper</p></li> |
404 | 404 | <li><p><strong>decoder_model</strong> (<a class="reference internal" href="sam_models.html#model_api.models.sam_models.SAMDecoder" title="model_api.models.sam_models.SAMDecoder"><em>SAMDecoder</em></a>) – initialized encoder wrapper</p></li> |
405 | 405 | <li><p><strong>reference_features</strong> (<a class="reference internal" href="#model_api.models.visual_prompting.VisualPromptingFeatures" title="model_api.models.visual_prompting.VisualPromptingFeatures"><em>VisualPromptingFeatures</em></a><em> | </em><em>None</em><em>, </em><em>optional</em>) – Previously generated reference features. |
406 | | -Once the features are passed, one can skip learn() method, and start predicting masks right away. Defaults to None.</p></li> |
| 406 | +Once the features are passed, one can skip learn() method, and start predicting masks right away. |
| 407 | +Defaults to None.</p></li> |
407 | 408 | <li><p><strong>threshold</strong> (<em>float</em><em>, </em><em>optional</em>) – Threshold to match vs reference features on infer(). Greater value means a</p></li> |
408 | 409 | <li><p><strong>0.65.</strong> (<em>stricter matching. Defaults to</em>)</p></li> |
409 | 410 | </ul> |
|
441 | 442 | <dt class="field-odd">Parameters<span class="colon">:</span></dt> |
442 | 443 | <dd class="field-odd"><ul class="simple"> |
443 | 444 | <li><p><strong>image</strong> (<em>np.ndarray</em>) – HWC-shaped image</p></li> |
444 | | -<li><p><strong>reference_features</strong> (<a class="reference internal" href="#model_api.models.visual_prompting.VisualPromptingFeatures" title="model_api.models.visual_prompting.VisualPromptingFeatures"><em>VisualPromptingFeatures</em></a><em> | </em><em>None</em><em>, </em><em>optional</em>) – Reference features object obtained during previous learn() calls.</p></li> |
445 | | -<li><p><strong>passed</strong> (<em>If not</em>)</p></li> |
446 | | -<li><p><strong>used</strong> (<em>object internal state is</em>)</p></li> |
447 | | -<li><p><strong>None.</strong> (<em>which reflects the last learn</em><em>(</em><em>) </em><em>call. Defaults to</em>)</p></li> |
448 | | -<li><p><strong>apply_masks_refinement</strong> (<em>bool</em><em>, </em><em>optional</em>) – Flag controlling additional refinement stage on inference. Once enabled, decoder will</p></li> |
449 | | -<li><p><strong>True.</strong> (<em>be launched 2 extra times to refine the masks obtained with the first decoder call. Defaults to</em>)</p></li> |
| 445 | +<li><p><strong>reference_features</strong> (<a class="reference internal" href="#model_api.models.visual_prompting.VisualPromptingFeatures" title="model_api.models.visual_prompting.VisualPromptingFeatures"><em>VisualPromptingFeatures</em></a><em> | </em><em>None</em><em>, </em><em>optional</em>) – Reference features object obtained during |
| 446 | +previous learn() calls. If not passed, object internal state is used, which reflects the last learn() |
| 447 | +call. Defaults to None.</p></li> |
| 448 | +<li><p><strong>apply_masks_refinement</strong> (<em>bool</em><em>, </em><em>optional</em>) – Flag controlling additional refinement stage on inference.</p></li> |
| 449 | +<li><p><strong>enabled</strong> (<em>Once</em>)</p></li> |
| 450 | +<li><p><strong>decoder</strong> (<em>decoder will be launched 2 extra times to refine the masks obtained with the first</em>)</p></li> |
| 451 | +<li><p><strong>True.</strong> (<em>call. Defaults to</em>)</p></li> |
450 | 452 | </ul> |
451 | 453 | </dd> |
452 | 454 | <dt class="field-even">Returns<span class="colon">:</span></dt> |
453 | | -<dd class="field-even"><p>Mapping label -> predicted mask. Each mask object contains a list of binary masks, and a list of |
454 | | -related prompts. Each binary mask corresponds to one prompt point. Class mask can be obtained by applying OR operation to all |
455 | | -mask corresponding to one label.</p> |
| 455 | +<dd class="field-even"><p><dl class="simple"> |
| 456 | +<dt>Mapping label -> predicted mask. Each mask object contains a list of binary masks,</dt><dd><p>and a list of related prompts. Each binary mask corresponds to one prompt point. Class mask can be |
| 457 | +obtained by applying OR operation to all mask corresponding to one label.</p> |
| 458 | +</dd> |
| 459 | +</dl> |
| 460 | +</p> |
456 | 461 | </dd> |
457 | 462 | <dt class="field-odd">Return type<span class="colon">:</span></dt> |
458 | 463 | <dd class="field-odd"><p><a class="reference internal" href="utils.html#model_api.models.utils.ZSLVisualPromptingResult" title="model_api.models.utils.ZSLVisualPromptingResult">ZSLVisualPromptingResult</a></p> |
|
482 | 487 | </ul> |
483 | 488 | </dd> |
484 | 489 | <dt class="field-even">Returns<span class="colon">:</span></dt> |
485 | | -<dd class="field-even"><p>return values are the updated VPT reference features and reference masks. |
486 | | -The shape of the reference mask is N_labels x H x W, where H and W are the same as in the input image.</p> |
| 490 | +<dd class="field-even"><p><dl class="simple"> |
| 491 | +<dt>return values are the updated VPT reference features and</dt><dd><p>reference masks.</p> |
| 492 | +</dd> |
| 493 | +</dl> |
| 494 | +<p>The shape of the reference mask is N_labels x H x W, where H and W are the same as in the input image.</p> |
| 495 | +</p> |
487 | 496 | </dd> |
488 | 497 | <dt class="field-odd">Return type<span class="colon">:</span></dt> |
489 | 498 | <dd class="field-odd"><p>tuple[<a class="reference internal" href="#model_api.models.visual_prompting.VisualPromptingFeatures" title="model_api.models.visual_prompting.VisualPromptingFeatures">VisualPromptingFeatures</a>, np.ndarray]</p> |
|
0 commit comments