Buckets:

rtrm's picture
download
raw
65.3 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Deploy Meta SAM 3 on Microsoft Foundry&quot;,&quot;local&quot;:&quot;deploy-meta-sam-3-on-microsoft-foundry&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Pre-requisites&quot;,&quot;local&quot;:&quot;pre-requisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Setup and installation&quot;,&quot;local&quot;:&quot;setup-and-installation&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Authenticate to Azure Machine Learning&quot;,&quot;local&quot;:&quot;authenticate-to-azure-machine-learning&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Create and Deploy Foundry Endpoint&quot;,&quot;local&quot;:&quot;create-and-deploy-foundry-endpoint&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Send requests to the Foundry Endpoint&quot;,&quot;local&quot;:&quot;send-requests-to-the-foundry-endpoint&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Azure Machine Learning SDK&quot;,&quot;local&quot;:&quot;azure-machine-learning-sdk&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Python requests&quot;,&quot;local&quot;:&quot;python-requests&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Print generated masks&quot;,&quot;local&quot;:&quot;print-generated-masks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Release resources&quot;,&quot;local&quot;:&quot;release-resources&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/microsoft-azure/pr_45/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/entry/start.ab64e0db.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/chunks/scheduler.35aab934.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/chunks/singletons.aa88f033.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/chunks/paths.27b90442.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/entry/app.60010920.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/chunks/preload-helper.9f2039bb.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/chunks/index.b7be2227.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/nodes/0.63c00954.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/nodes/6.b578b0fc.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/chunks/Tip.53e7a084.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.153a08ce.js">
<link rel="modulepreload" href="/docs/microsoft-azure/pr_45/en/_app/immutable/chunks/CodeBlock.187eda65.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;Deploy Meta SAM 3 on Microsoft Foundry&quot;,&quot;local&quot;:&quot;deploy-meta-sam-3-on-microsoft-foundry&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Pre-requisites&quot;,&quot;local&quot;:&quot;pre-requisites&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Setup and installation&quot;,&quot;local&quot;:&quot;setup-and-installation&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Authenticate to Azure Machine Learning&quot;,&quot;local&quot;:&quot;authenticate-to-azure-machine-learning&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Create and Deploy Foundry Endpoint&quot;,&quot;local&quot;:&quot;create-and-deploy-foundry-endpoint&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Send requests to the Foundry Endpoint&quot;,&quot;local&quot;:&quot;send-requests-to-the-foundry-endpoint&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Azure Machine Learning SDK&quot;,&quot;local&quot;:&quot;azure-machine-learning-sdk&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;Python requests&quot;,&quot;local&quot;:&quot;python-requests&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Print generated masks&quot;,&quot;local&quot;:&quot;print-generated-masks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Release resources&quot;,&quot;local&quot;:&quot;release-resources&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <h1 class="relative group"><a id="deploy-meta-sam-3-on-microsoft-foundry" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#deploy-meta-sam-3-on-microsoft-foundry"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Deploy Meta SAM 3 on Microsoft Foundry</span></h1> <blockquote class="tip"><p data-svelte-h="svelte-1ifh373">At the moment gated models can only be deployed programmatically, since Microsoft Foundry hasn’t incorporated those yet; meaning that when deploying from Microsoft Foundry or Azure Machine Learning, even if the <code>HuggingFaceTokenConnection</code> is set, you might stumble upon the following error:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->Failed to retrieve and inject workspace connection secrets. Please verify that the endpoint identity has been granted the Workspace Connection Secrets Reader role or any custom roles with actions Microsoft.MachineLearningServices/workspaces/connections/listsecrets/action &amp; Microsoft.MachineLearningServices/workspaces/metadata/secrets/read and ensure that the secret reference schema in the environment variables is accurate.<!-- HTML_TAG_END --></pre></div></blockquote> <p data-svelte-h="svelte-1scbpe0">This example shows how to deploy Segment Anything Model 3 (SAM 3) from the Hugging Face collection on Microsoft Foundry (formerly Azure AI Foundry) as an Azure Machine Learning Managed Online Endpoint. SAM 3 is state-of-the-art across all text and visual segmentation tasks in both images and videos whilst maintaining all the performance and functionality of it predecessor, SAM 2.</p> <p data-svelte-h="svelte-1eb5lln"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/microsoft-azure/azure-ai/deploy-meta-sam3/sam3-microsoft-foundry.png" alt="SAM 3 on Microsoft Foundry"></p> <p data-svelte-h="svelte-v0onre"><a href="https://huggingface.co/facebook/sam3" rel="nofollow">SAM 3</a> is a unified foundation model for promptable segmentation in images and videos, state-of-the-art in <a href="https://huggingface.co/tasks/mask-generation" rel="nofollow"><code>mask-generation</code></a>. SAM 3 can detect, segment, and track objects using text or visual prompts such as points, boxes, and masks. Compared to its predecessor SAM 2, SAM 3 introduces the ability to exhaustively segment all instances of an open-vocabulary concept specified by a short text phrase or exemplars. Unlike prior work, SAM 3 can handle a vastly larger set of open-vocabulary prompts. It achieves 75-80% of human performance on our new SA-CO benchmark which contains 270K unique concepts, over 50 times more than existing benchmarks.</p> <p data-svelte-h="svelte-14f86be"><img src="https://lookaside.fbsbx.com/elementpath/media/?media_id=1132635808951855&version=1763568008&transcode_extension=webp" alt="Meta SAM 3 Benchmarks"></p> <p data-svelte-h="svelte-1ha5pb8"><a href="https://huggingface.co/tasks/mask-generation" rel="nofollow">Mask generation</a> is the task of generating masks that identify a specific object or region of interest in a given image. Masks are often used in segmentation tasks, where they provide a precise way to isolate the object of interest for further processing or analysis.</p> <p data-svelte-h="svelte-143kxl2">For more information, make sure to check <a href="https://huggingface.co/facebook/sam3" rel="nofollow">Meta SAM 3 on the Hugging Face Hub</a>.</p> <h2 class="relative group"><a id="pre-requisites" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#pre-requisites"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Pre-requisites</span></h2> <p data-svelte-h="svelte-dnkqle">To run the following example, you will need to comply with the following pre-requisites, alternatively, you can also read more about those in the <a href="https://learn.microsoft.com/en-us/azure/machine-learning/quickstart-create-resources?view=azureml-api-2" rel="nofollow">Azure Machine Learning Tutorial: Create resources you need to get started</a>.</p> <ul data-svelte-h="svelte-1hfuymc"><li>An Azure account with an active subscription.</li> <li>The Azure CLI installed and logged in.</li> <li>The Azure Machine Learning extension for the Azure CLI.</li> <li>An Azure Resource Group.</li> <li>A Hub-based project on Microsoft Foundry (classic, i.e., Azure AI Foundry Hub-based project).</li></ul> <p data-svelte-h="svelte-1yxipfx">For more information, please go through the steps in <a href="https://huggingface.co/docs/microsoft-azure/guides/configure-azure-ml-microsoft-foundry" rel="nofollow">Configure Azure Machine Learning and Microsoft Foundry</a>.</p> <p data-svelte-h="svelte-k3idj2">Additionally, given that <a href="https://huggingface.co/facebook/sam3" rel="nofollow"><code>facebook/sam3</code></a> is a gated model, you need to agree to the gating on the Hugging Face Hub and wait for the authors to approve it so that you can download the weights. For more information, please check our guide on how to deploy <a href="https://huggingface.co/docs/microsoft-azure/guides/access-gated-models" rel="nofollow">Hugging Face gated models on Microsoft Foundry</a>.</p> <p data-svelte-h="svelte-p7ysxh"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/microsoft-azure/azure-ai/deploy-meta-sam3/sam3-gating.png" alt="Meta SAM 3 gating on the Hub"></p> <h2 class="relative group"><a id="setup-and-installation" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#setup-and-installation"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Setup and installation</span></h2> <p data-svelte-h="svelte-bexho5">In this example, the <a href="https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/ml/azure-ai-ml" rel="nofollow">Azure Machine Learning SDK for Python</a> will be used to create the endpoint and the deployment, as well as to invoke the deployed API. Along with it, you will also need to install <code>azure-identity</code> to authenticate with your Azure credentials via Python.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->%pip install azure-ai-ml azure-identity --upgrade --quiet<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1v277rw">More information at <a href="https://learn.microsoft.com/en-us/python/api/overview/azure/ai-ml-readme?view=azure-python" rel="nofollow">Azure Machine Learning SDK for Python</a>.</p> <p data-svelte-h="svelte-md1e1u">Then, setting the following environment variables is recommended as those will be used along the example for the Azure ML Client, so make sure to update and set those values accordingly as per your Microsoft Azure account and resources.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->%env LOCATION eastus
%env SUBSCRIPTION_ID &lt;YOUR_SUBSCRIPTION_ID&gt;
%env RESOURCE_GROUP &lt;YOUR_RESOURCE_GROUP&gt;
%env WORKSPACE_NAME &lt;YOUR_WORKSPACE_NAME&gt;<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1k6rrkg">You also need to define both the endpoint and deployment names, as those will be used throughout the example too:</p> <blockquote class="tip"><p data-svelte-h="svelte-zrbum5">Note that endpoint names must to be globally unique per region i.e., even if you don’t have any endpoint named that way running under your subscription, if the name is reserved by another Azure customer, then you won’t be able to use the same name. Adding a timestamp or a custom identifier is recommended to prevent running into HTTP 400 validation issues when trying to deploy an endpoint with an already locked / reserved name. Also the endpoint name must be between 3 and 32 characters long.</p></blockquote> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> uuid <span class="hljs-keyword">import</span> uuid4
os.environ[<span class="hljs-string">&quot;ENDPOINT_NAME&quot;</span>] = <span class="hljs-string">f&quot;endpoint-<span class="hljs-subst">{<span class="hljs-built_in">str</span>(uuid4())[:<span class="hljs-number">8</span>]}</span>&quot;</span>
os.environ[<span class="hljs-string">&quot;DEPLOYMENT_NAME&quot;</span>] = <span class="hljs-string">f&quot;deployment-<span class="hljs-subst">{<span class="hljs-built_in">str</span>(uuid4())[:<span class="hljs-number">8</span>]}</span>&quot;</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-163xmct">Finally, as <a href="https://huggingface.co/facebook/sam3" rel="nofollow"><code>facebook/sam3</code></a> is a gated model, you need to create an Azure Machine Learning Connection with Custom keys named <code>HuggingFaceTokenConnection</code> with a key <code>HF_TOKEN</code> with <a href="https://huggingface.co/settings/tokens/new?canReadGatedRepos=true&tokenType=fineGrained" rel="nofollow">your Hugging Face read or fine-grained token</a> flagged as secret to make sure that the model weights can be downloaded from the Hugging Face Hub on runtime.</p> <p data-svelte-h="svelte-11chpgm"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/microsoft-azure/azure-ai/deploy-meta-sam3/azureml-connection.png" alt="Azure Machine Learning Connection for 'HF_TOKEN'"></p> <p data-svelte-h="svelte-vmzdjl">Alternatively, you can also create the Azure Machine Learning Connection programmatically as follows:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->az ml connection create \
--name HuggingFaceTokenConnection \
--<span class="hljs-built_in">type</span> <span class="hljs-string">&quot;Generic&quot;</span> \
--resource-group <span class="hljs-variable">$RESOURCE_GROUP</span> \
--workspace-name <span class="hljs-variable">$WORKSPACE_NAME</span> \
--secret <span class="hljs-string">&quot;HF_TOKEN=&lt;YOUR_HF_TOKEN_HERE&gt;&quot;</span><!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="authenticate-to-azure-machine-learning" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#authenticate-to-azure-machine-learning"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Authenticate to Azure Machine Learning</span></h2> <p data-svelte-h="svelte-ilhjqs">First you need to authenticate into the Microsoft Foundry via Azure Machine Learning with the Python SDK:</p> <blockquote class="tip"><p data-svelte-h="svelte-tbr247">On standard Azure Machine Learning deployments you’d need to create the <code>MLClient</code> using the Azure Machine Learning Workspace as the <code>workspace_name</code> whereas for Microsoft Foundry, you need to provide the Azure AI Foundry Hub-based project name as the <code>workspace_name</code> instead, and that will deploy the endpoint under Microsoft Foundry too.</p></blockquote> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> azure.ai.ml <span class="hljs-keyword">import</span> MLClient
<span class="hljs-keyword">from</span> azure.identity <span class="hljs-keyword">import</span> DefaultAzureCredential
client = MLClient(
credential=DefaultAzureCredential(),
subscription_id=os.getenv(<span class="hljs-string">&quot;SUBSCRIPTION_ID&quot;</span>),
resource_group_name=os.getenv(<span class="hljs-string">&quot;RESOURCE_GROUP&quot;</span>),
workspace_name=os.getenv(<span class="hljs-string">&quot;WORKSPACE_NAME&quot;</span>),
)<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="create-and-deploy-foundry-endpoint" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#create-and-deploy-foundry-endpoint"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Create and Deploy Foundry Endpoint</span></h2> <p data-svelte-h="svelte-nkpz90">To create the Azure Machine Learning Managed Online Endpoint you don’t need to provide the model ID on the Hugging Face Hub but rather the model URI on Azure Machine Learning formatted as follows:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->model_id = <span class="hljs-string">&quot;facebook/sam3&quot;</span>
model_uri = <span class="hljs-string">f&quot;azureml://registries/HuggingFace/models/<span class="hljs-subst">{model_id.replace(<span class="hljs-string">&#x27;/&#x27;</span>, <span class="hljs-string">&#x27;-&#x27;</span>).replace(<span class="hljs-string">&#x27;_&#x27;</span>, <span class="hljs-string">&#x27;-&#x27;</span>).lower()}</span>/labels/latest&quot;</span>
model_uri<!-- HTML_TAG_END --></pre></div> <blockquote class="tip"><p data-svelte-h="svelte-15zbbe3">To check if a model from the Hugging Face Hub is available in Azure, you should read about it in <a href="https://huggingface.co/docs/microsoft-azure/azure-ai/models" rel="nofollow">Supported Models</a>. If not, you can always <a href="https://huggingface.co/docs/microsoft-azure/guides/request-model-addition" rel="nofollow">Request a model addition in the Hugging Face collection on Azure</a>).</p></blockquote> <p data-svelte-h="svelte-kx2vig">Then you need to create the <a href="https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.entities.managedonlineendpoint?view=azure-python" rel="nofollow">ManagedOnlineEndpoint via the Azure ML Python SDK</a> making sure to include the <code>enfoce_access_to_default_secret_stores: enabled</code> property so that the Azure Machine Learning Connection secret can be read to later pull the weights from the Hugging Face Hub.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> azure.ai.ml.entities <span class="hljs-keyword">import</span> ManagedOnlineEndpoint
endpoint = ManagedOnlineEndpoint(
name=os.getenv(<span class="hljs-string">&quot;ENDPOINT_NAME&quot;</span>),
properties={<span class="hljs-string">&quot;enforce_access_to_default_secret_stores&quot;</span>: <span class="hljs-string">&quot;enabled&quot;</span>},
)
client.begin_create_or_update(endpoint).wait()<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-97s8by">After creating the endpoint, you need to create the <a href="https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.entities.managedonlinedeployment?view=azure-python" rel="nofollow">ManagedOnlineDeployment via the Azure ML Python SDK</a> i.e., create a deployment linked to the given endpoint.</p> <blockquote class="tip"><p data-svelte-h="svelte-1v5c93a">All Hugging Face models on Azure run on an optimized inference backend that supports multiple hardware SKUs, as listed in the <a href="https://huggingface.co/docs/microsoft-azure/azure-ai/supported-hardware" rel="nofollow">Supported Hardware page</a>. Some models require GPU-enabled instances, so you may need to request a quota increase using the <a href="https://learn.microsoft.com/en-us/azure/machine-learning/how-to-manage-quotas?view=azureml-api-2" rel="nofollow">Azure Machine Learning quota management guide</a>.</p></blockquote> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">from</span> azure.ai.ml.entities <span class="hljs-keyword">import</span> ManagedOnlineDeployment
deployment = ManagedOnlineDeployment(
name=os.getenv(<span class="hljs-string">&quot;DEPLOYMENT_NAME&quot;</span>),
endpoint_name=os.getenv(<span class="hljs-string">&quot;ENDPOINT_NAME&quot;</span>),
model=model_uri,
instance_type=<span class="hljs-string">&quot;Standard_NC40ads_H100_v5&quot;</span>,
instance_count=<span class="hljs-number">1</span>,
)
client.online_deployments.begin_create_or_update(deployment).wait()<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-cs8ulb">The deployment might take ~10-15 minutes, but it could as well take longer depending on the selected SKU availability in the region. Once deployed, you will be able to inspect the endpoint details, the real-time logs, how to consume the endpoint, and <a href="https://learn.microsoft.com/en-us/azure/machine-learning/concept-model-monitoring?view=azureml-api-2" rel="nofollow">monitoring (on preview)</a>.</p> <p data-svelte-h="svelte-7g3jag">Find more information about it at <a href="https://learn.microsoft.com/en-us/azure/machine-learning/concept-endpoints-online?view=azureml-api-2#managed-online-endpoints" rel="nofollow">Azure Machine Learning Managed Online Endpoints</a></p> <h2 class="relative group"><a id="send-requests-to-the-foundry-endpoint" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#send-requests-to-the-foundry-endpoint"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Send requests to the Foundry Endpoint</span></h2> <p data-svelte-h="svelte-7fjkbf">Once the Foundry Deployment is done, you can send requests to the Foundry Endpoint following <a href="https://ai.azure.com/catalog/models/facebook-sam3" rel="nofollow">the API specification defined in the model card on Microsoft Foundry</a>.</p> <h3 class="relative group"><a id="azure-machine-learning-sdk" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#azure-machine-learning-sdk"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Azure Machine Learning SDK</span></h3> <p data-svelte-h="svelte-ndy41">The Foundry Endpoint can be invoked via the Azure ML Client previously instantiated, but it requires an actual JSON file, which means that you first need to dump the payload into a JSON file then invoke the API.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> json
<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> tempfile
<span class="hljs-keyword">with</span> tempfile.NamedTemporaryFile(mode=<span class="hljs-string">&quot;w+&quot;</span>, delete=<span class="hljs-literal">True</span>, suffix=<span class="hljs-string">&quot;.json&quot;</span>) <span class="hljs-keyword">as</span> f:
json.dump({
<span class="hljs-string">&quot;inputs&quot;</span>: <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000077595.jpg&quot;</span>,
<span class="hljs-string">&quot;parameters&quot;</span>: {<span class="hljs-string">&quot;points_per_batch&quot;</span>:<span class="hljs-number">16</span>},
}, f)
f.flush()
response = client.online_endpoints.invoke(
endpoint_name=os.getenv(<span class="hljs-string">&quot;ENDPOINT_NAME&quot;</span>),
deployment_name=os.getenv(<span class="hljs-string">&quot;DEPLOYMENT_NAME&quot;</span>),
request_file=f.name,
)
output = json.loads(response)<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1xpddtu">The <code>output</code> will contain a key <code>results</code> with a list of all the generated masks, meaning each item in the list is a dict with the keys <code>mask</code>, with the generated mask, and <code>score</code>, with the generated score for the given mask; note that the results are sorted by <code>score</code> from higher to lower (in the 0.0 to 1.0 range).</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->output[<span class="hljs-string">&quot;results&quot;</span>][<span class="hljs-number">0</span>]<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="python-requests" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#python-requests"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Python requests</span></h3> <p data-svelte-h="svelte-g2c1bi">Alternatively, you can also send standard HTTP requests via e.g. cURL or Python <code>requests</code>, but there’s a few things to take into consideration:</p> <ul data-svelte-h="svelte-filnm0"><li>The API URL is available via <code>client.online_endpoints.get(os.getenv(&quot;ENDPOINT_NAME&quot;)).scoring_uri</code>, or rather via Microsoft Foundry or Azure Machine Learning.</li> <li>The API Key needs to be provided as a Bearer token in the authorization header and is available via <code>client.online_endpoints.get_keys(os.getenv(&quot;ENDPOINT_NAME&quot;)).primary_key</code>, or rather via Microsoft Foundry or Azure Machine Learning.</li> <li>The header <code>azureml-model-deployment</code> with <code>os.getenv(&quot;DEPLOYMENT_NAME&quot;)</code> needs to be provided given that an endpoint can have more than one deployment, hence its name needs to be provided as a header.</li></ul> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> requests
url = client.online_endpoints.get(os.getenv(<span class="hljs-string">&quot;ENDPOINT_NAME&quot;</span>)).scoring_uri
key = client.online_endpoints.get_keys(os.getenv(<span class="hljs-string">&#x27;ENDPOINT_NAME&#x27;</span>)).primary_key
output = requests.post(
url,
headers={
<span class="hljs-string">&quot;Authorization&quot;</span>: <span class="hljs-string">f&quot;Bearer <span class="hljs-subst">{key}</span>&quot;</span>,
<span class="hljs-string">&quot;azureml-model-deployment&quot;</span>: os.getenv(<span class="hljs-string">&quot;DEPLOYMENT_NAME&quot;</span>),
},
data={
<span class="hljs-string">&quot;inputs&quot;</span>:<span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000077595.jpg&quot;</span>,
<span class="hljs-string">&quot;parameters&quot;</span>: { <span class="hljs-string">&quot;points_per_batch&quot;</span>:<span class="hljs-number">16</span> },
}
)<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="print-generated-masks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#print-generated-masks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Print generated masks</span></h2> <p data-svelte-h="svelte-1du40o">Once the masks have been generated, you can convert those into <code>PIL</code> images given that those are generated encoded in base64; then you can print those (not the masks are “boolean” images hence black and white) with the following snippet:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->%pip install numpy Pillow matplotlib --upgrade --quiet<!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> base64
<span class="hljs-keyword">import</span> math
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
mask_size = (<span class="hljs-number">128</span>, <span class="hljs-number">128</span>)
spacing = <span class="hljs-number">24</span>
pil_masks = []
<span class="hljs-keyword">for</span> result <span class="hljs-keyword">in</span> output[<span class="hljs-string">&quot;results&quot;</span>]:
mask_b64 = result[<span class="hljs-string">&quot;mask&quot;</span>]
mask_bytes = base64.b64decode(mask_b64)
mask_img = Image.<span class="hljs-built_in">open</span>(BytesIO(mask_bytes)).convert(<span class="hljs-string">&quot;L&quot;</span>).resize(mask_size)
pil_masks.append(mask_img)
n = <span class="hljs-built_in">len</span>(pil_masks)
cols = <span class="hljs-built_in">min</span>(<span class="hljs-number">4</span>, n)
rows = math.ceil(n / cols)
fig, axes = plt.subplots(rows, cols, figsize=(cols * <span class="hljs-number">2.2</span>, rows * <span class="hljs-number">2.2</span>))
axes = np.atleast_1d(axes).flatten()
<span class="hljs-keyword">for</span> idx, ax <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(axes):
<span class="hljs-keyword">if</span> idx &lt; n:
ax.imshow(pil_masks[idx], cmap=<span class="hljs-string">&quot;gray&quot;</span>)
<span class="hljs-keyword">else</span>:
ax.imshow(np.zeros(mask_size), cmap=<span class="hljs-string">&quot;gray&quot;</span>)
ax.set_xticks([])
ax.set_yticks([])
<span class="hljs-keyword">for</span> spine <span class="hljs-keyword">in</span> ax.spines.values():
spine.set_visible(<span class="hljs-literal">True</span>)
spine.set_color(<span class="hljs-string">&quot;lightgray&quot;</span>)
spine.set_linewidth(spacing // <span class="hljs-number">8</span>)
plt.subplots_adjust(wspace=spacing / mask_size[<span class="hljs-number">0</span>], hspace=spacing / mask_size[<span class="hljs-number">1</span>])
plt.show()<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-urouun"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/microsoft-azure/azure-ai/deploy-meta-sam3/cat-masks-only.png" alt="Grid of black and white generated masks"></p> <p data-svelte-h="svelte-kx6hu9">As a recommendation, to better see the generated masks you can print those over the generated image with a different color with the following snippet:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->!wget http://images.cocodataset.org/val2017/<span class="hljs-number">000000077595.j</span>pg -O image.jpg<!-- HTML_TAG_END --></pre></div> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-keyword">import</span> base64
<span class="hljs-keyword">import</span> math
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
image = np.array(Image.<span class="hljs-built_in">open</span>(<span class="hljs-string">&quot;image.jpg&quot;</span>).convert(<span class="hljs-string">&quot;RGB&quot;</span>))
<span class="hljs-keyword">def</span> <span class="hljs-title function_">mask_from_base64</span>(<span class="hljs-params">mask_b64, target_shape</span>):
mask_bytes = base64.b64decode(mask_b64)
mask_img = (
Image.<span class="hljs-built_in">open</span>(BytesIO(mask_bytes))
.convert(<span class="hljs-string">&quot;L&quot;</span>)
.resize((target_shape[<span class="hljs-number">1</span>], target_shape[<span class="hljs-number">0</span>]), resample=Image.NEAREST)
)
<span class="hljs-keyword">return</span> np.array(mask_img) &gt; <span class="hljs-number">0</span>
mask_list = [
mask_from_base64(res[<span class="hljs-string">&quot;mask&quot;</span>], image.shape[:<span class="hljs-number">2</span>]) <span class="hljs-keyword">for</span> res <span class="hljs-keyword">in</span> output[<span class="hljs-string">&quot;results&quot;</span>]
]
n = <span class="hljs-built_in">len</span>(mask_list) + <span class="hljs-number">1</span>
cols = <span class="hljs-built_in">min</span>(<span class="hljs-number">4</span>, n)
rows = math.ceil(n / cols)
fig, axes = plt.subplots(rows, cols, figsize=(cols * <span class="hljs-number">5</span>, rows * <span class="hljs-number">5</span>))
axes = np.atleast_1d(axes).flatten()
<span class="hljs-keyword">for</span> idx, mask <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(mask_list):
overlay = image.copy()
color = np.random.randint(<span class="hljs-number">0</span>, <span class="hljs-number">256</span>, <span class="hljs-number">3</span>, dtype=np.uint8)
alpha = <span class="hljs-number">0.5</span>
overlay[mask] = (alpha * color + (<span class="hljs-number">1</span> - alpha) * overlay[mask]).astype(np.uint8)
axes[idx].imshow(overlay)
axes[idx].set_title(<span class="hljs-string">f&quot;Mask <span class="hljs-subst">{idx}</span>&quot;</span>)
<span class="hljs-keyword">for</span> ax <span class="hljs-keyword">in</span> axes[n:]:
ax.axis(<span class="hljs-string">&quot;off&quot;</span>)
<span class="hljs-keyword">for</span> ax <span class="hljs-keyword">in</span> axes[:n]:
ax.axis(<span class="hljs-string">&quot;off&quot;</span>)
plt.tight_layout()
plt.show()<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-phfgnm"><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/microsoft-azure/azure-ai/deploy-meta-sam3/cat-with-masks.png" alt="Grid of original image with generated masks overlay"></p> <h2 class="relative group"><a id="release-resources" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#release-resources"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Release resources</span></h2> <p data-svelte-h="svelte-dzkovk">Once you are done using the Foundry Endpoint, you can delete the resources (i.e., you will stop paying for the instance on which the model is running and all the attached costs) as follows:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START -->client.online_endpoints.begin_delete(name=os.getenv(<span class="hljs-string">&quot;ENDPOINT_NAME&quot;</span>)).result()<!-- HTML_TAG_END --></pre></div> <hr> <blockquote class="tip"><p data-svelte-h="svelte-13kfjua">📍 Find the complete example on GitHub <a href="https://github.com/huggingface/Microsoft-Azure/tree/main/examples/foundry/deploy-meta-sam3/azure-notebook.ipynb" rel="nofollow">here</a>!</p></blockquote> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/Microsoft-Azure/blob/main/docs/source/foundry/examples/deploy-meta-sam3.mdx" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_qegs6x = {
assets: "/docs/microsoft-azure/pr_45/en",
base: "/docs/microsoft-azure/pr_45/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/microsoft-azure/pr_45/en/_app/immutable/entry/start.ab64e0db.js"),
import("/docs/microsoft-azure/pr_45/en/_app/immutable/entry/app.60010920.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 6],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
65.3 kB
·
Xet hash:
72ab88295112b8f33751415d9d2975a8967e88bb2f46926bafa51ffc36af6a44

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.