From daf17bcdff2ecf119c0ef130ab50324f5fcf88c7 Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Tue, 20 Aug 2024 17:34:46 -0700 Subject: [PATCH] Remove model root in favor of relative urls Signed-off-by: Justin Georgi --- src/pages/detect.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/detect.vue b/src/pages/detect.vue index 0a70acc..f9b0d76 100644 --- a/src/pages/detect.vue +++ b/src/pages/detect.vue @@ -140,8 +140,9 @@ import detectionMixin from './detection-mixin' import cameraMixin from './camera-mixin' - import detectionWorker from '../assets/detect-worker.js?worker&inline' + 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 { @@ -192,7 +193,6 @@ created () { let loadOtherSettings = localStorage.getItem('otherSettings') if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings) - let modelRoot = new URL(import.meta.url).origin this.detectorName = this.f7route.params.region switch (this.detectorName) { case 'thorax': @@ -208,9 +208,9 @@ this.activeRegion = 3 break; } - this.modelLocation = new URL(`/models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`,modelRoot).href - this.miniLocation = new URL(`./models/${this.detectorName}-mini/model.json`,modelRoot).href - fetch(`${modelRoot}/models/${this.detectorName}/classes.json`) + 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`) .then((mod) => { return mod.json() }) .then((classes) => { this.classesList = classes