From 3380d2153127e4256ef6f34109ee9d299a47a7b7 Mon Sep 17 00:00:00 2001 From: aditsvet Date: Thu, 9 May 2024 22:40:00 -0400 Subject: [PATCH 1/3] Changes to add category for powerboostlet --- examples/imageCaptioning.js | 1 + examples/melanoma.js | 1 + examples/plotly.js | 1 + examples/segmentanything.js | 1 + examples/sobel.js | 1 + examples/trako.js | 1 + 6 files changed, 6 insertions(+) diff --git a/examples/imageCaptioning.js b/examples/imageCaptioning.js index fdb05e5e..23ad828d 100644 --- a/examples/imageCaptioning.js +++ b/examples/imageCaptioning.js @@ -1,3 +1,4 @@ +let boostletCategory = "LLM Models"; script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://boostlet.org/dist/boostlet.min.js"; diff --git a/examples/melanoma.js b/examples/melanoma.js index a163b18f..39a89e71 100644 --- a/examples/melanoma.js +++ b/examples/melanoma.js @@ -1,3 +1,4 @@ +let boostletCategory = "Machine Learning"; let boostletLoaded = false; let tfscriptLoaded = false; diff --git a/examples/plotly.js b/examples/plotly.js index 9dc24a5f..dbbaecbd 100644 --- a/examples/plotly.js +++ b/examples/plotly.js @@ -1,3 +1,4 @@ +let boostletCategory = "Data Visualization"; script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://boostlet.org/dist/boostlet.min.js"; diff --git a/examples/segmentanything.js b/examples/segmentanything.js index be3504ae..d20544e0 100644 --- a/examples/segmentanything.js +++ b/examples/segmentanything.js @@ -1,3 +1,4 @@ +let boostletCategory = "Machine Learning"; let boostletLoaded = false; let boxCraftLoaded = false; diff --git a/examples/sobel.js b/examples/sobel.js index 6d144b9a..b034edf8 100644 --- a/examples/sobel.js +++ b/examples/sobel.js @@ -1,3 +1,4 @@ +let boostletCategory = "Filters"; script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://boostlet.org/dist/boostlet.min.js"; diff --git a/examples/trako.js b/examples/trako.js index 5010ba62..cc0f0b49 100644 --- a/examples/trako.js +++ b/examples/trako.js @@ -1,3 +1,4 @@ +let boostletCategory = "Filters"; script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://boostlet.org/dist/boostlet.min.js"; From 6b88bbc3913277fd70f0b5a31f0fe7f32dbf17de Mon Sep 17 00:00:00 2001 From: gaiborjosue Date: Sun, 9 Jun 2024 22:48:09 -0400 Subject: [PATCH 2/3] feat(category): Namespace --- examples/sobel.js | 5 ++++- src/boostlet.js | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/sobel.js b/examples/sobel.js index b034edf8..aa14564e 100644 --- a/examples/sobel.js +++ b/examples/sobel.js @@ -1,7 +1,7 @@ -let boostletCategory = "Filters"; script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://boostlet.org/dist/boostlet.min.js"; +// script.src = "http://localhost:5500/dist/boostlet.min.js"; script.onload = run; document.head.appendChild(script); @@ -13,6 +13,9 @@ function run() { // detect visualization framework Boostlet.init(); + Boostlet.category = "Filters" + + image = Boostlet.get_image(); kernel = [ diff --git a/src/boostlet.js b/src/boostlet.js index bee8f626..87bff32e 100644 --- a/src/boostlet.js +++ b/src/boostlet.js @@ -8,6 +8,7 @@ export class Boostlet { this.framework = null; + this.category = null; } /** @@ -44,6 +45,7 @@ export class Boostlet { } + } /** @@ -138,5 +140,5 @@ export class Boostlet { return Util.hint(message, duration); } - + } From 5193fa7397cfe60db30d29ed46806d2cd7d4086b Mon Sep 17 00:00:00 2001 From: gaiborjosue Date: Sun, 9 Jun 2024 23:02:13 -0400 Subject: [PATCH 3/3] feat(categories): Added categories through namespace --- examples/imageCaptioning.js | 3 ++- examples/melanoma.js | 5 ++--- examples/plotly.js | 3 ++- examples/segmentanything.js | 3 ++- examples/sobel.js | 1 - examples/trako.js | 3 ++- examples/webllm.js | 6 ++++-- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/examples/imageCaptioning.js b/examples/imageCaptioning.js index 23ad828d..26f5d4d8 100644 --- a/examples/imageCaptioning.js +++ b/examples/imageCaptioning.js @@ -1,4 +1,3 @@ -let boostletCategory = "LLM Models"; script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://boostlet.org/dist/boostlet.min.js"; @@ -15,6 +14,8 @@ async function run() { // detect visualization framework Boostlet.init(); + Boostlet.category = "LLM Models" + const requestData = await request(); console.log(requestData); diff --git a/examples/melanoma.js b/examples/melanoma.js index 39a89e71..a1ac3d8e 100644 --- a/examples/melanoma.js +++ b/examples/melanoma.js @@ -1,4 +1,3 @@ -let boostletCategory = "Machine Learning"; let boostletLoaded = false; let tfscriptLoaded = false; @@ -36,9 +35,9 @@ async function run() { // detect visualization framework Boostlet.init(); - getImage(); - + Boostlet.category = "Machine Learning" + getImage(); } diff --git a/examples/plotly.js b/examples/plotly.js index dbbaecbd..28f77f5e 100644 --- a/examples/plotly.js +++ b/examples/plotly.js @@ -1,4 +1,3 @@ -let boostletCategory = "Data Visualization"; script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://boostlet.org/dist/boostlet.min.js"; @@ -12,6 +11,8 @@ function run() { // detect visualization framework Boostlet.init(); + Boostlet.category = "Data Visualization" + all_pixels = Boostlet.get_image().data; // load Plotly.js library and start plotting in the onload callback diff --git a/examples/segmentanything.js b/examples/segmentanything.js index d20544e0..8c0260f1 100644 --- a/examples/segmentanything.js +++ b/examples/segmentanything.js @@ -1,4 +1,3 @@ -let boostletCategory = "Machine Learning"; let boostletLoaded = false; let boxCraftLoaded = false; @@ -44,6 +43,8 @@ function run() { // detect visualization framework Boostlet.init(); + Boostlet.category = "Machine Learning" + // load ONNX.js Boostlet.load_script('https://cdn.jsdelivr.net/npm/onnxruntime-web/dist/ort.min.js'); diff --git a/examples/sobel.js b/examples/sobel.js index aa14564e..f4645c6c 100644 --- a/examples/sobel.js +++ b/examples/sobel.js @@ -15,7 +15,6 @@ function run() { Boostlet.category = "Filters" - image = Boostlet.get_image(); kernel = [ diff --git a/examples/trako.js b/examples/trako.js index cc0f0b49..279d16c4 100644 --- a/examples/trako.js +++ b/examples/trako.js @@ -1,4 +1,3 @@ -let boostletCategory = "Filters"; script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://boostlet.org/dist/boostlet.min.js"; @@ -19,6 +18,8 @@ async function run() { // detect visualization framework Boostlet.init(); + Boostlet.category = "Filters" + // using the XTK TRAKO FILE READER libs = ["https://bostongfx.github.io/TRAKO/WEB/js/xtk.js", "https://bostongfx.github.io/TRAKO/WEB/js/draco/draco_decoder.js", diff --git a/examples/webllm.js b/examples/webllm.js index 2607d218..6ecf1701 100644 --- a/examples/webllm.js +++ b/examples/webllm.js @@ -1,8 +1,8 @@ script = document.createElement("script"); script.type = "text/javascript"; -//script.src = "https://boostlet.org/dist/boostlet.min.js"; +script.src = "https://boostlet.org/dist/boostlet.min.js"; // script.src = "http://localhost:5500/dist/boostlet.min.js"; -script.src = "https://gaiborjosue.github.io/boostlet/dist/boostlet.min.js"; +// script.src = "https://gaiborjosue.github.io/boostlet/dist/boostlet.min.js"; script.onload = run; document.head.appendChild(script); @@ -12,6 +12,8 @@ async function run() { // detect visualization framework Boostlet.init(); + Boostlet.category = "LLM Models" + const script = document.createElement("script"); script.type = "module"; script.src = "https://mpsych.github.io/cdn/web-llm/web-llm-cdn.js";