Fetch models and model details from vite public folder
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -168,7 +168,7 @@ import App from 'framework7-vue/components/app'
|
||||
created () {
|
||||
let loadOtherSettings = localStorage.getItem('otherSettings')
|
||||
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
|
||||
let modelRoot = this.isCordova ? 'https://localhost' : (import.meta.env.PROD ? '.' : '..')
|
||||
let modelRoot = this.isCordova ? 'https://localhost' : '.'
|
||||
switch (this.f7route.params.region) {
|
||||
case 'thorax':
|
||||
this.activeRegion = 0
|
||||
@@ -188,10 +188,12 @@ import App from 'framework7-vue/components/app'
|
||||
}
|
||||
this.modelLocation = `${modelRoot}/models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`
|
||||
this.miniLocation = `${modelRoot}/models/${this.detectorName}-mini/model.json`
|
||||
import(`../models/${this.detectorName}/classes.json`).then((mod) => {
|
||||
this.classesList = mod.default
|
||||
this.detectorLabels = this.classesList.map( l => { return {'name': l, 'detect': true} } )
|
||||
})
|
||||
fetch(`./models/${this.detectorName}/classes.json`)
|
||||
.then((mod) => { return mod.json() })
|
||||
.then((classes) => {
|
||||
this.classesList = classes
|
||||
this.detectorLabels = this.classesList.map( l => { return {'name': l, 'detect': true} } )
|
||||
})
|
||||
var loadServerSettings = localStorage.getItem('serverSettings')
|
||||
if (loadServerSettings) this.serverSettings = JSON.parse(loadServerSettings)
|
||||
},
|
||||
|
||||
@@ -54,22 +54,18 @@
|
||||
created () {
|
||||
var loadOtherSettings = localStorage.getItem('otherSettings')
|
||||
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
|
||||
import('../models/thorax/descript.json')
|
||||
.then((mod) => {
|
||||
this.thoraxDetails = mod.default
|
||||
})
|
||||
import('../models/thorax-mini/descript.json')
|
||||
.then((mod) => {
|
||||
this.miniThoraxDetails = mod.default
|
||||
})
|
||||
import('../models/abdomen/descript.json')
|
||||
.then((mod) => {
|
||||
this.abdomenDetails = mod.default
|
||||
})
|
||||
import('../models/abdomen-mini/descript.json')
|
||||
.then((mod) => {
|
||||
this.miniAbdomenDetails = mod.default
|
||||
})
|
||||
fetch('./models/thorax/descript.json')
|
||||
.then((mod) => { return mod.json() })
|
||||
.then((desc) => { this.thoraxDetails = desc })
|
||||
fetch('./models/thorax-mini/descript.json')
|
||||
.then((mod) => { return mod.json() })
|
||||
.then((desc) => { this.miniThoraxDetails = desc })
|
||||
fetch('./models/abdomen/descript.json')
|
||||
.then((mod) => { return mod.json() })
|
||||
.then((desc) => { this.abdomenDetails = desc })
|
||||
fetch('./models/abdomen-mini/descript.json')
|
||||
.then((mod) => { return mod.json() })
|
||||
.then((desc) => { this.miniAbdomenDetails = desc })
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user