ibelem commited on
Commit
bb49359
·
verified ·
1 Parent(s): 9c0cfe3

Delete assets

Browse files
assets/index-BorhpRD-.css DELETED
@@ -1 +0,0 @@
1
- *{box-sizing:border-box;padding:0;margin:0;font-family:sans-serif}html,body{height:100%}body{padding:16px 32px}body,#container{display:flex;flex-direction:column;justify-content:center;align-items:center}#controls{display:flex;padding:1rem;gap:1rem}#controls>div{text-align:center}h1,h4{text-align:center}h4{margin-top:.5rem}#container{position:relative;width:720px;height:405px;max-width:100%;max-height:100%;border:2px dashed #d1d5db;border-radius:.75rem;overflow:hidden;margin-top:1rem;background-size:100% 100%;background-position:center;background-repeat:no-repeat}#overlay,canvas{position:absolute;width:100%;height:100%}#status{min-height:16px;margin:8px 0}#video,#canvas,#size-container{display:none}a{color:#275efe;text-decoration:none}a:hover{text-decoration:underline}#versions{margin-top:.5rem;font-size:.8rem;color:#0000004d}
 
 
assets/index-DO66MBQ_.js DELETED
@@ -1 +0,0 @@
1
- import*as l from"https://ibelem.github.io/transformersjs-dists/3.7.3_1.23.0-dev.20250906/transformers.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))o(e);new MutationObserver(e=>{for(const n of e)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&o(a)}).observe(document,{childList:!0,subtree:!0});function i(e){const n={};return e.integrity&&(n.integrity=e.integrity),e.referrerPolicy&&(n.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?n.credentials="include":e.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function o(e){if(e.ep)return;e.ep=!0;const n=i(e);fetch(e.href,n)}})();l.env.backends.onnx.wasm.proxy=!1;l.env.backends.onnx.wasm.simd=!0;l.env.backends.onnx.wasm.numThreads=1;l.env.backends.onnx.wasm.wasmPaths="https://ibelem.github.io/transformersjs-dists/3.7.3_1.23.0-dev.20250906/";const _=document.getElementById("device"),p=document.getElementById("status"),I=document.getElementById("container"),g=document.getElementById("canvas"),v=document.getElementById("output-canvas"),c=document.getElementById("video"),f=document.getElementById("size"),O=document.getElementById("size-value"),y=document.getElementById("scale"),P=document.getElementById("scale-value");function x(t,s){c.width=v.width=g.width=Math.round(t),c.height=v.height=g.height=Math.round(s)}p.textContent="Loading model...";function S(t,s){const i="webnn-gpu",o="fp16",e=["webnn-gpu","webnn-cpu","webnn-npu"],n=["fp16","fp32","int8"],a=(t||i).toLowerCase(),L=s&&n.includes(s.toLowerCase())?s.toLowerCase():o,D=e.includes(a)?{freeDimensionOverrides:{batch_size:1,height:256,width:320},logSeverityLevel:0}:{logSeverityLevel:0};return{device:a,dtype:L,sessionOptions:D}}const E=new URLSearchParams(window.location.search);let{device:u,dtype:F,sessionOptions:B}=S(E.get("device"),E.get("dtype")),r="WebNN GPU";switch(u){case"webgpu":r="WebGPU";break;case"webnn-gpu":r="WebNN GPU";break;case"webnn-cpu":r="WebNN CPU";break;case"webnn-npu":r="WebNN NPU";break;default:r="WebNN GPU"}_.textContent=r;["webgpu","webnn-gpu","webnn-cpu","webnn-npu"].includes(u)||(p.textContent=`Unsupported device ${u}. Falling back to WebNN GPU.`,u="webnn-gpu");const U="Xenova/modnet";let w;try{w=await l.pipeline("background-removal",U,{device:u,dtype:F,session_options:B})}catch(t){throw p.textContent=t.message,alert(t.message),t}let m=256;w.processor.feature_extractor.size={shortest_edge:m};f.addEventListener("input",()=>{m=Number(f.value),w.processor.feature_extractor.size={shortest_edge:m},O.textContent=m});f.disabled=!1;["webnn-gpu","webnn-cpu","webnn-npu"].includes(u)&&(f.disabled=!0);let d=.5;y.addEventListener("input",()=>{d=Number(y.value),x(c.videoWidth*d,c.videoHeight*d),P.textContent=d});y.disabled=!1;p.textContent="Ready";let h=!1,b;const N=g.getContext("2d",{willReadFrequently:!0}),W=v.getContext("2d",{willReadFrequently:!0});function C(){const{width:t,height:s}=g;h||(h=!0,(async function(){N.drawImage(c,0,0,t,s);const i=N.getImageData(0,0,t,s),o=new l.RawImage(i.data,t,s,4),[e]=await w(o);if(W.putImageData(new ImageData(e.data,e.width,e.height),0,0),b!==void 0){const n=1e3/(performance.now()-b);p.textContent=`FPS: ${n.toFixed(2)}`}b=performance.now(),h=!1})()),window.requestAnimationFrame(C)}navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{c.srcObject=t,c.play();const s=t.getVideoTracks()[0],{width:i,height:o}=s.getSettings();x(i*d,o*d);const e=i/o,[n,a]=e>720/405?[720,720/e]:[405*e,405];I.style.width=`${n}px`,I.style.height=`${a}px`,setTimeout(C,50)}).catch(t=>{alert(t)});