From f35b28a7fbc113ff0a35f92ed48d62fab930c4bb Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Wed, 21 Aug 2024 14:44:45 -0700 Subject: [PATCH] Parse model urls for full generalization Signed-off-by: Justin Georgi --- src/pages/detect.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/pages/detect.vue b/src/pages/detect.vue index f9b0d76..e2a7ec9 100644 --- a/src/pages/detect.vue +++ b/src/pages/detect.vue @@ -141,9 +141,6 @@ import cameraMixin from './camera-mixin' import detectionWorker from '@/assets/detect-worker.js?worker&inline' -// import thoraxModel from '/models/thorax/model.json?url' -// console.log(thoraxModel) -// import thoraxModelMini from '/models/thorax-mini/model.json?url' export default { mixins: [submitMixin, detectionMixin, cameraMixin], @@ -208,9 +205,11 @@ this.activeRegion = 3 break; } - this.modelLocation = `/models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json` - this.miniLocation = `/models/${this.detectorName}-mini/model.json` - fetch(`/models/${this.detectorName}/classes.json`) + //this.modelLocation = `../models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json` + //this.miniLocation = `../models/${this.detectorName}-mini/model.json` + this.modelLocation = URL.parse(`../models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`,import.meta.url).href + this.miniLocation = URL.parse(`../models/${this.detectorName}-mini/model.json`,import.meta.url).href + fetch(URL.parse(`../models/${this.detectorName}/classes.json`,import.meta.url).href) .then((mod) => { return mod.json() }) .then((classes) => { this.classesList = classes