Compare commits
7 Commits
df1f0f2213
...
v0.5.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 523b50ec65 | |||
| f35b28a7fb | |||
| 94995a7a74 | |||
| daf17bcdff | |||
| 56a6d85f75 | |||
| 46b5ba7d6e | |||
| 401e5831c7 |
@@ -1,5 +1,5 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<widget id="edu.midwestern.alvinn" version="0.5.0-rc" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
|
<widget id="edu.midwestern.alvinn" version="0.5.0-alpha" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<name>ALVINN</name>
|
<name>ALVINN</name>
|
||||||
<description>Anatomy Lab Visual Identification Neural Network.</description>
|
<description>Anatomy Lab Visual Identification Neural Network.</description>
|
||||||
<author email="jgeorg@midwestern.edu" href="https://midwestern.edu">
|
<author email="jgeorg@midwestern.edu" href="https://midwestern.edu">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "edu.midwestern.alvinn",
|
"name": "edu.midwestern.alvinn",
|
||||||
"displayName": "ALVINN",
|
"displayName": "ALVINN",
|
||||||
"version": "0.5.0-rc",
|
"version": "0.5.0-alpha",
|
||||||
"description": "Anatomy Lab Visual Identification Neural Network.",
|
"description": "Anatomy Lab Visual Identification Neural Network.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "alvinn",
|
"name": "alvinn",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.5.0-rc",
|
"version": "0.5.0-alpha",
|
||||||
"description": "ALVINN",
|
"description": "ALVINN",
|
||||||
"repository": "",
|
"repository": "",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
@@ -14,7 +14,8 @@
|
|||||||
"cordova-ios": "cross-env TARGET=cordova cross-env NODE_ENV=production vite build && node ./build/build-cordova.js && cd cordova && cordova run ios",
|
"cordova-ios": "cross-env TARGET=cordova cross-env NODE_ENV=production vite build && node ./build/build-cordova.js && cd cordova && cordova run ios",
|
||||||
"build-cordova-android": "cross-env TARGET=cordova cross-env NODE_ENV=production vite build && node ./build/build-cordova.js && cd cordova && cordova build android",
|
"build-cordova-android": "cross-env TARGET=cordova cross-env NODE_ENV=production vite build && node ./build/build-cordova.js && cd cordova && cordova build android",
|
||||||
"cordova-android": "cross-env TARGET=cordova cross-env NODE_ENV=production vite build && node ./build/build-cordova.js && cd cordova && cordova run android",
|
"cordova-android": "cross-env TARGET=cordova cross-env NODE_ENV=production vite build && node ./build/build-cordova.js && cd cordova && cordova run android",
|
||||||
"postinstall": "cpy --flat ./node_modules/framework7-icons/fonts/*.* ./src/fonts/"
|
"postinstall": "cpy --flat ./node_modules/framework7-icons/fonts/*.* ./src/fonts/",
|
||||||
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"IOS >= 15",
|
"IOS >= 15",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ let model = null
|
|||||||
onmessage = function (e) {
|
onmessage = function (e) {
|
||||||
switch (e.data.call) {
|
switch (e.data.call) {
|
||||||
case 'loadModel':
|
case 'loadModel':
|
||||||
loadModel('.' + e.data.weights,e.data.preload).then(() => {
|
loadModel(e.data.weights,e.data.preload).then(() => {
|
||||||
postMessage({success: 'model'})
|
postMessage({success: 'model'})
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
postMessage({error: true, message: err.message})
|
postMessage({error: true, message: err.message})
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const state = reactive({
|
|||||||
disclaimerAgreement: false,
|
disclaimerAgreement: false,
|
||||||
enabledRegions: ['thorax','abdomen','limbs','head'],
|
enabledRegions: ['thorax','abdomen','limbs','head'],
|
||||||
regionIconSet: Math.floor(Math.random() * 3) + 1,
|
regionIconSet: Math.floor(Math.random() * 3) + 1,
|
||||||
version: '0.5.0-rc',
|
version: '0.5.0-alpha',
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
useExternal: 'optional',
|
useExternal: 'optional',
|
||||||
siteDemo: false,
|
siteDemo: false,
|
||||||
|
|||||||
@@ -140,7 +140,7 @@
|
|||||||
import detectionMixin from './detection-mixin'
|
import detectionMixin from './detection-mixin'
|
||||||
import cameraMixin from './camera-mixin'
|
import cameraMixin from './camera-mixin'
|
||||||
|
|
||||||
import detectionWorker from '../assets/detect-worker.js?worker&inline'
|
import detectionWorker from '@/assets/detect-worker.js?worker&inline'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [submitMixin, detectionMixin, cameraMixin],
|
mixins: [submitMixin, detectionMixin, cameraMixin],
|
||||||
@@ -190,7 +190,6 @@
|
|||||||
created () {
|
created () {
|
||||||
let loadOtherSettings = localStorage.getItem('otherSettings')
|
let loadOtherSettings = localStorage.getItem('otherSettings')
|
||||||
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
|
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
|
||||||
let modelRoot = this.isCordova ? 'https://localhost' : '.'
|
|
||||||
this.detectorName = this.f7route.params.region
|
this.detectorName = this.f7route.params.region
|
||||||
switch (this.detectorName) {
|
switch (this.detectorName) {
|
||||||
case 'thorax':
|
case 'thorax':
|
||||||
@@ -206,9 +205,9 @@
|
|||||||
this.activeRegion = 3
|
this.activeRegion = 3
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.modelLocation = `${modelRoot}/models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`
|
this.modelLocation = URL.parse(`../models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`,import.meta.url).href
|
||||||
this.miniLocation = `${modelRoot}/models/${this.detectorName}-mini/model.json`
|
this.miniLocation = URL.parse(`../models/${this.detectorName}-mini/model.json`,import.meta.url).href
|
||||||
fetch(`${modelRoot}/models/${this.detectorName}/classes.json`)
|
fetch(URL.parse(`../models/${this.detectorName}/classes.json`,import.meta.url).href)
|
||||||
.then((mod) => { return mod.json() })
|
.then((mod) => { return mod.json() })
|
||||||
.then((classes) => {
|
.then((classes) => {
|
||||||
this.classesList = classes
|
this.classesList = classes
|
||||||
@@ -314,7 +313,6 @@
|
|||||||
return `--chip-media-gradient: conic-gradient(from ${270 - (confFactor * 360 / 2)}deg, hsl(${confFactor * 120}deg, 100%, 50%) ${confFactor}turn, hsl(${confFactor * 120}deg, 50%, 66%) ${confFactor}turn)`
|
return `--chip-media-gradient: conic-gradient(from ${270 - (confFactor * 360 / 2)}deg, hsl(${confFactor * 120}deg, 100%, 50%) ${confFactor}turn, hsl(${confFactor * 120}deg, 50%, 66%) ${confFactor}turn)`
|
||||||
},
|
},
|
||||||
async setData () {
|
async setData () {
|
||||||
//const detectWorker = new detectionWorker()
|
|
||||||
this.detectWorker.onmessage = (eDetect) => {
|
this.detectWorker.onmessage = (eDetect) => {
|
||||||
self = this
|
self = this
|
||||||
if (eDetect.data.error) {
|
if (eDetect.data.error) {
|
||||||
@@ -514,13 +512,9 @@
|
|||||||
}).then( () => {
|
}).then( () => {
|
||||||
const [imCanvas, _] = this.resetView()
|
const [imCanvas, _] = this.resetView()
|
||||||
imCanvas.style['background-image'] = `url(${this.imageView.src})`
|
imCanvas.style['background-image'] = `url(${this.imageView.src})`
|
||||||
/******
|
f7.utils.nextFrame(() => {
|
||||||
* setTimeout is not a good solution, but it's the only way
|
|
||||||
* I can find to not cut off drawing of the canvas background
|
|
||||||
******/
|
|
||||||
// setTimeout(() => {
|
|
||||||
this.setData()
|
this.setData()
|
||||||
// }, 1)
|
})
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e.message)
|
console.log(e.message)
|
||||||
f7.dialog.alert(`Error loading image: ${e.message}`)
|
f7.dialog.alert(`Error loading image: ${e.message}`)
|
||||||
|
|||||||
Reference in New Issue
Block a user