diff --git a/assets/index-DDd6q1Tp.js b/assets/index-BB3OLapL.js similarity index 99% rename from assets/index-DDd6q1Tp.js rename to assets/index-BB3OLapL.js index 8e0cbab..9bfc22d 100644 --- a/assets/index-DDd6q1Tp.js +++ b/assets/index-BB3OLapL.js @@ -2683,4 +2683,4 @@ ${d}`,h=i.createShaderModule({code:u,label:e.name});Ye("verbose",()=>`[WebGPU] $ * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= - */async function E2(e,r,i,s,o,d,u,h){let m=0,g=0;Je.wasm.wasmPaths="./";const _=await qc.create(e,{executionProviders:[i]}),w=_.inputNames[0];let f=_.outputNames[0];async function b(){const x=new Pt("float32",new Float32Array(r.reduce((O,R)=>O*R)).map(()=>Math.random()),r),T=performance.now(),z=await _.run({[w]:x}),C=performance.now();return z[f].dispose(),C-T}function S(x,T){d.data.labels.push(x),d.data.datasets[0].data.push(T),d.update()}for(let x=0;xsetTimeout(z,T))}for(let x=s;xsetTimeout(z,T))}}function C2(){const e=sn.useRef(null),r=sn.useRef(null),[i,s]=sn.useState("0"),[o,d]=sn.useState("0"),u=sn.useRef(null),h=sn.useRef(null),m=sn.useRef(null),g=sn.useRef(null),_=sn.useRef(null),[w,f]=sn.useState([]),b=sn.useRef(null),S=sn.useRef(null);window.onload=()=>{const z=b.current.getContext("2d");S.current=new Chart(z,{type:"line",data:{labels:[],datasets:[{label:"Inference Time (ms)",data:[],borderColor:"lightblue",tension:.1}]},options:{plugins:{legend:{labels:{font:{size:16}}}},scales:{x:{ticks:{font:{size:14}}},y:{ticks:{font:{size:14}}}}}})};const x=async()=>{g.current.disabled=!0;const z=m.current;z.textContent="Start benchmark...",z.style.color="red",z.classList.add("blink"),S.current.data.labels=[],S.current.data.datasets[0].data=[],s("0"),d("0");try{const C=[1,3,640,640],O=r.current.value,R=w.find(F=>F.url===O),M=R?R.url:`${window.location.href}/models/${O}.onnx`;await E2(M,C,e.current.value,Number(u.current.value),Number(h.current.value),S.current,s,d)}catch(C){console.error(C),z.textContent="Failed!",z.classList.remove("blink"),g.current.disabled=!1;return}z.textContent="Finished!",z.style.color="green",z.classList.remove("blink"),g.current.disabled=!1},T=z=>{const C=z.target.files[0];if(C){const O=C.name.replace(".onnx","");f([...w,{name:O,url:URL.createObjectURL(C)}])}};return Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("h1",{children:"Model Benchmark - onnxruntime Web"}),Ue.jsxs("div",{id:"setting-container",children:[Ue.jsxs("div",{children:[Ue.jsx("label",{htmlFor:"device-selector",children:"Backend:"}),Ue.jsxs("select",{name:"device-selector",ref:e,children:[Ue.jsx("option",{value:"webgpu",children:"webGPU"}),Ue.jsx("option",{value:"wasm",children:"Wasm(cpu)"})]})]}),Ue.jsxs("div",{children:[Ue.jsx("label",{htmlFor:"model-selector",children:"Model:"}),Ue.jsxs("select",{name:"model-selector",ref:r,children:[Ue.jsx("option",{value:"yolov10n",children:"yolov10n-2.3M"}),Ue.jsx("option",{value:"yolov10s",children:"yolov10s-7.2M"}),Ue.jsx("option",{value:"yolov9t-simplify",children:"yolov9t-2.0M"}),Ue.jsx("option",{value:"yolov9s-simplify",children:"yolov9s-7.1M"}),Ue.jsx("option",{value:"gelan-s2-simplify",children:"gelan-s2"}),Ue.jsx("option",{value:"yolov8n-simplify",children:"yolov8n-3.2M"}),Ue.jsx("option",{value:"yolov8s-simplify",children:"yolov8s-11.2M"}),w.map((z,C)=>Ue.jsx("option",{value:z.url,children:z.name},C))]})]}),Ue.jsxs("div",{children:[Ue.jsx("label",{htmlFor:"warmUpFrequency-input",children:"Warm up frequency:"}),Ue.jsx("input",{type:"number",id:"warmUpFrequency-input",defaultValue:1,min:0,ref:u})]}),Ue.jsxs("div",{children:[Ue.jsx("label",{htmlFor:"testFrequency-input",children:"Testing frequency:"}),Ue.jsx("input",{type:"number",id:"testFrequency-input",defaultValue:100,min:0,ref:h})]})]}),Ue.jsxs("div",{id:"button-container",children:[Ue.jsx("button",{onClick:x,ref:g,children:"Start benchmark"}),Ue.jsx("input",{type:"file",accept:".onnx",onChange:T,ref:_,hidden:!0}),Ue.jsx("button",{onClick:()=>_.current.click(),children:"Add model"})]}),Ue.jsxs("div",{id:"info-container",children:[Ue.jsxs("p",{children:["Warm up Average Time:"," ",Ue.jsxs("span",{className:"info-ms",children:[i,"ms"]})]}),Ue.jsxs("p",{children:["Inference Average Time:"," ",Ue.jsxs("span",{className:"info-ms",children:[o,"ms"]})]})]}),Ue.jsx("canvas",{ref:b}),Ue.jsx("p",{ref:m,style:{fontSize:"1.3rem"},children:"Not Start!"})]})}s_.createRoot(document.getElementById("root")).render(Ue.jsx(J1.StrictMode,{children:Ue.jsx(C2,{})})); + */async function E2(e,r,i,s,o,d,u,h){let m=0,g=0;Je.wasm.wasmPaths="./";const _=await qc.create(e,{executionProviders:[i]}),w=_.inputNames[0];let f=_.outputNames[0];async function b(){const x=new Pt("float32",new Float32Array(r.reduce((O,R)=>O*R)).map(()=>Math.random()),r),T=performance.now(),z=await _.run({[w]:x}),C=performance.now();return z[f].dispose(),C-T}function S(x,T){d.data.labels.push(x),d.data.datasets[0].data.push(T),d.update()}for(let x=0;xsetTimeout(z,T))}for(let x=s;xsetTimeout(z,T))}}function C2(){const e=sn.useRef(null),r=sn.useRef(null),[i,s]=sn.useState("0"),[o,d]=sn.useState("0"),u=sn.useRef(null),h=sn.useRef(null),m=sn.useRef(null),g=sn.useRef(null),_=sn.useRef(null),[w,f]=sn.useState([]),b=sn.useRef(null),S=sn.useRef(null);window.onload=()=>{const z=b.current.getContext("2d");S.current=new Chart(z,{type:"line",data:{labels:[],datasets:[{label:"Inference Time (ms)",data:[],borderColor:"lightblue",tension:.1}]},options:{plugins:{legend:{labels:{font:{size:16}}}},scales:{x:{ticks:{font:{size:14}}},y:{ticks:{font:{size:14}}}}}})};const x=async()=>{g.current.disabled=!0;const z=m.current;z.textContent="Start benchmark...",z.style.color="red",z.classList.add("blink"),S.current.data.labels=[],S.current.data.datasets[0].data=[],s("0"),d("0");try{const C=[1,3,640,640],O=r.current.value,R=w.find(F=>F.url===O),M=R?R.url:`${window.location.href}/models/${O}.onnx`;await E2(M,C,e.current.value,Number(u.current.value),Number(h.current.value),S.current,s,d)}catch(C){console.error(C),z.textContent="Failed!",z.classList.remove("blink"),g.current.disabled=!1;return}z.textContent="Finished!",z.style.color="green",z.classList.remove("blink"),g.current.disabled=!1},T=z=>{const C=z.target.files[0];if(C){const O=C.name.replace(".onnx","");f([...w,{name:O,url:URL.createObjectURL(C)}])}};return Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("h1",{children:"Model Benchmark - onnxruntime Web"}),Ue.jsxs("div",{id:"setting-container",children:[Ue.jsxs("div",{children:[Ue.jsx("label",{htmlFor:"device-selector",children:"Backend:"}),Ue.jsxs("select",{name:"device-selector",ref:e,children:[Ue.jsx("option",{value:"webgpu",children:"webGPU"}),Ue.jsx("option",{value:"wasm",children:"Wasm(cpu)"})]})]}),Ue.jsxs("div",{children:[Ue.jsx("label",{htmlFor:"model-selector",children:"Model:"}),Ue.jsxs("select",{name:"model-selector",ref:r,children:[Ue.jsx("option",{value:"yolov10n",children:"yolov10n-2.3M"}),Ue.jsx("option",{value:"yolov10s",children:"yolov10s-7.2M"}),Ue.jsx("option",{value:"yolov9t-simplify",children:"yolov9t-2.0M"}),Ue.jsx("option",{value:"yolov9s-simplify",children:"yolov9s-7.1M"}),Ue.jsx("option",{value:"gelan-s2-simplify",children:"gelan-s2"}),Ue.jsx("option",{value:"yolov8n-simplify",children:"yolov8n-3.2M"}),Ue.jsx("option",{value:"yolov8s-simplify",children:"yolov8s-11.2M"}),w.map((z,C)=>Ue.jsx("option",{value:z.url,children:z.name},C))]})]}),Ue.jsxs("div",{children:[Ue.jsx("label",{htmlFor:"warmUpCount-input",children:"Warm up count:"}),Ue.jsx("input",{type:"number",id:"warmUpCount-input",defaultValue:1,min:0,ref:u})]}),Ue.jsxs("div",{children:[Ue.jsx("label",{htmlFor:"testCount-input",children:"Testing count:"}),Ue.jsx("input",{type:"number",id:"testCount-input",defaultValue:100,min:0,ref:h})]})]}),Ue.jsxs("div",{id:"button-container",children:[Ue.jsx("button",{onClick:x,ref:g,children:"Start benchmark"}),Ue.jsx("input",{type:"file",accept:".onnx",onChange:T,ref:_,hidden:!0}),Ue.jsx("button",{onClick:()=>_.current.click(),children:"Add model"})]}),Ue.jsxs("div",{id:"info-container",children:[Ue.jsxs("p",{children:["Warm up Average Time:"," ",Ue.jsxs("span",{className:"info-ms",children:[i,"ms"]})]}),Ue.jsxs("p",{children:["Inference Average Time:"," ",Ue.jsxs("span",{className:"info-ms",children:[o,"ms"]})]})]}),Ue.jsx("canvas",{ref:b}),Ue.jsx("p",{ref:m,style:{fontSize:"1.3rem"},children:"Not Start!"})]})}s_.createRoot(document.getElementById("root")).render(Ue.jsx(J1.StrictMode,{children:Ue.jsx(C2,{})})); diff --git a/index.html b/index.html index 77264d8..efd5707 100644 --- a/index.html +++ b/index.html @@ -1,17 +1,17 @@ - - - - - - - - - Model Benchmark - + + + + + + + + + Model Benchmark + - - -
- - - + + +
+ + + diff --git a/ort-wasm-simd-threaded.jsep.wasm b/ort-wasm-simd-threaded.jsep.wasm new file mode 100644 index 0000000..6852071 Binary files /dev/null and b/ort-wasm-simd-threaded.jsep.wasm differ diff --git a/ort-wasm-simd-threaded.wasm b/ort-wasm-simd-threaded.wasm new file mode 100644 index 0000000..953ea98 Binary files /dev/null and b/ort-wasm-simd-threaded.wasm differ