Fix fetch issue in android cordova (#99)
Tensorflow fetch failed on android with basic configuration. More specific protocol and location for model.json required. Signed-off-by: Justin Georgi <justin.georgi@gmail.com> Reviewed-on: Georgi_Lab/ALVINN_f7#99
This commit is contained in:
@@ -333,6 +333,7 @@
|
||||
this.detectorName = 'thorax'
|
||||
this.classesList = thoraxClasses
|
||||
this.modelLocation = '../models/thorax_tfwm/model.json'
|
||||
this.modelLocationCordova = 'https://localhost/models/thorax_tfwm/model.json'
|
||||
break;
|
||||
case 'abdomen':
|
||||
this.activeRegion = 1
|
||||
@@ -375,8 +376,11 @@
|
||||
} else {
|
||||
self.modelLoading = true
|
||||
self.detectorLabels = self.classesList.map( l => { return {'name': l, 'detect': true} } )
|
||||
self.loadModel(self.modelLocation).then(() => {
|
||||
self.loadModel(self.isCordova ? self.modelLocationCordova : self.modelLocation).then(() => {
|
||||
self.modelLoading = false
|
||||
}).catch((e) => {
|
||||
console.log(e.message)
|
||||
f7.dialog.alert(`ALVINN AI model error: ${e.message}`)
|
||||
})
|
||||
}
|
||||
window.onresize = (e) => { this.selectChip('redraw') }
|
||||
@@ -449,6 +453,9 @@
|
||||
self.detecting = false
|
||||
self.resultData = dets
|
||||
self.uploadDirty = true
|
||||
}).catch((e) => {
|
||||
console.log(e.message)
|
||||
f7.dialog.alert(`ALVINN structure finding error: ${e.message}`)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user