Update index.html
Browse files- index.html +4 -4
index.html
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
<script
|
4 |
type="module"
|
5 |
crossorigin
|
6 |
-
src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"
|
7 |
></script>
|
8 |
<link
|
9 |
rel="stylesheet"
|
10 |
-
href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css"
|
11 |
/>
|
12 |
<script type="module">
|
13 |
const MODEL_URL =
|
@@ -72,7 +72,7 @@
|
|
72 |
import gradio as gr
|
73 |
|
74 |
|
75 |
-
|
76 |
async function getPointMask(image, points) {
|
77 |
console.log("getting point mask");
|
78 |
console.log(points)
|
@@ -90,7 +90,7 @@
|
|
90 |
points_state.append([evt.index[0]/image.width, evt.index[1]/image.height, True])
|
91 |
return points_state, points_state
|
92 |
|
93 |
-
with gr.Blocks() as demo:
|
94 |
gr.Markdown("""## Segment Anything Model (SAM) with Gradio Lite
|
95 |
This demo uses [Gradio Lite](https://www.gradio.app/guides/gradio-lite) as UI for running the Segment Anything Model (SAM) with WASM build with [Candle](https://github.com/huggingface/candle).
|
96 |
|
|
|
3 |
<script
|
4 |
type="module"
|
5 |
crossorigin
|
6 |
+
src="https://cdn.jsdelivr.net/npm/@gradio/lite@4.26.0/dist/lite.js"
|
7 |
></script>
|
8 |
<link
|
9 |
rel="stylesheet"
|
10 |
+
href="https://cdn.jsdelivr.net/npm/@gradio/lite@4.26.0/dist/lite.css"
|
11 |
/>
|
12 |
<script type="module">
|
13 |
const MODEL_URL =
|
|
|
72 |
import gradio as gr
|
73 |
|
74 |
|
75 |
+
js = """
|
76 |
async function getPointMask(image, points) {
|
77 |
console.log("getting point mask");
|
78 |
console.log(points)
|
|
|
90 |
points_state.append([evt.index[0]/image.width, evt.index[1]/image.height, True])
|
91 |
return points_state, points_state
|
92 |
|
93 |
+
with gr.Blocks(js=js) as demo:
|
94 |
gr.Markdown("""## Segment Anything Model (SAM) with Gradio Lite
|
95 |
This demo uses [Gradio Lite](https://www.gradio.app/guides/gradio-lite) as UI for running the Segment Anything Model (SAM) with WASM build with [Candle](https://github.com/huggingface/candle).
|
96 |
|