Parse model urls for full generalization
All checks were successful
Build Dev PWA / Build-PWA (push) Successful in 42s

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-08-21 14:44:45 -07:00
parent 94995a7a74
commit f35b28a7fb

View File

@@ -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