inception-v3 and resnet50 connection paths

This commit is contained in:
Leon Chen
2016-10-13 18:55:15 -04:00
parent 41905d836e
commit 38a2c22ae1
3 changed files with 62 additions and 62 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
+31 -31
View File
@@ -86,38 +86,38 @@ export const InceptionV3 = Vue.extend({
ready: function () {
this.model.ready().then(() => {
this.modelLoading = false
this.architectureDiagramPaths = []
setTimeout(() => {
this.architectureConnections.forEach(conn => {
const containerElem = document.getElementsByClassName('architecture-container')[0]
const fromElem = document.getElementById(conn.from)
const toElem = document.getElementById(conn.to)
const containerElemCoords = containerElem.getBoundingClientRect()
const fromElemCoords = fromElem.getBoundingClientRect()
const toElemCoords = toElem.getBoundingClientRect()
const xContainer = containerElemCoords.left
const yContainer = containerElemCoords.top
const xFrom = fromElemCoords.left + fromElemCoords.width / 2 - xContainer
const yFrom = fromElemCoords.top + fromElemCoords.height / 2 - yContainer
const xTo = toElemCoords.left + toElemCoords.width / 2 - xContainer
const yTo = toElemCoords.top + toElemCoords.height / 2 - yContainer
let path = `M${xFrom},${yFrom} L${xTo},${yTo}`
if (conn.corner === 'top-right') {
path = `M${xFrom},${yFrom} L${xTo - 10},${yFrom} Q${xTo},${yFrom} ${xTo},${yFrom + 10} L${xTo},${yTo}`
} else if (conn.corner === 'bottom-left') {
path = `M${xFrom},${yFrom} L${xFrom},${yTo - 10} Q${xFrom},${yTo} ${xFrom + 10},${yTo} L${xTo},${yTo}`
} else if (conn.corner === 'top-left') {
path = `M${xFrom},${yFrom} L${xTo + 10},${yFrom} Q${xTo},${yFrom} ${xTo},${yFrom + 10} L${xTo},${yTo}`
} else if (conn.corner === 'bottom-right') {
path = `M${xFrom},${yFrom} L${xFrom},${yFrom + 20} Q${xFrom},${yFrom + 30} ${xFrom - 10},${yFrom + 30} L${xTo + 10},${yFrom + 30} Q${xTo},${yFrom + 30} ${xTo},${yFrom + 40} L${xTo},${yTo}`
}
this.architectureDiagramPaths.push(path)
})
}, 1000)
})
this.architectureDiagramPaths = []
setTimeout(() => {
this.architectureConnections.forEach(conn => {
const containerElem = document.getElementsByClassName('architecture-container')[0]
const fromElem = document.getElementById(conn.from)
const toElem = document.getElementById(conn.to)
const containerElemCoords = containerElem.getBoundingClientRect()
const fromElemCoords = fromElem.getBoundingClientRect()
const toElemCoords = toElem.getBoundingClientRect()
const xContainer = containerElemCoords.left
const yContainer = containerElemCoords.top
const xFrom = fromElemCoords.left + fromElemCoords.width / 2 - xContainer
const yFrom = fromElemCoords.top + fromElemCoords.height / 2 - yContainer
const xTo = toElemCoords.left + toElemCoords.width / 2 - xContainer
const yTo = toElemCoords.top + toElemCoords.height / 2 - yContainer
let path = `M${xFrom},${yFrom} L${xTo},${yTo}`
if (conn.corner === 'top-right') {
path = `M${xFrom},${yFrom} L${xTo - 10},${yFrom} Q${xTo},${yFrom} ${xTo},${yFrom + 10} L${xTo},${yTo}`
} else if (conn.corner === 'bottom-left') {
path = `M${xFrom},${yFrom} L${xFrom},${yTo - 10} Q${xFrom},${yTo} ${xFrom + 10},${yTo} L${xTo},${yTo}`
} else if (conn.corner === 'top-left') {
path = `M${xFrom},${yFrom} L${xTo + 10},${yFrom} Q${xTo},${yFrom} ${xTo},${yFrom + 10} L${xTo},${yTo}`
} else if (conn.corner === 'bottom-right') {
path = `M${xFrom},${yFrom} L${xFrom},${yFrom + 20} Q${xFrom},${yFrom + 30} ${xFrom - 10},${yFrom + 30} L${xTo + 10},${yFrom + 30} Q${xTo},${yFrom + 30} ${xTo},${yFrom + 40} L${xTo},${yTo}`
}
this.architectureDiagramPaths.push(path)
})
}, 1000)
},
methods: {
+29 -29
View File
@@ -86,36 +86,36 @@ export const ResNet50 = Vue.extend({
ready: function () {
this.model.ready().then(() => {
this.modelLoading = false
this.architectureDiagramPaths = []
setTimeout(() => {
this.architectureConnections.forEach(conn => {
const containerElem = document.getElementsByClassName('architecture-container')[0]
const fromElem = document.getElementById(conn.from)
const toElem = document.getElementById(conn.to)
const containerElemCoords = containerElem.getBoundingClientRect()
const fromElemCoords = fromElem.getBoundingClientRect()
const toElemCoords = toElem.getBoundingClientRect()
const xContainer = containerElemCoords.left
const yContainer = containerElemCoords.top
const xFrom = fromElemCoords.left + fromElemCoords.width / 2 - xContainer
const yFrom = fromElemCoords.top + fromElemCoords.height / 2 - yContainer
const xTo = toElemCoords.left + toElemCoords.width / 2 - xContainer
const yTo = toElemCoords.top + toElemCoords.height / 2 - yContainer
let path = `M${xFrom},${yFrom} L${xTo},${yTo}`
if (conn.corner === 'top-right') {
path = `M${xFrom},${yFrom} L${xTo - 10},${yFrom} Q${xTo},${yFrom} ${xTo},${yFrom + 10} L${xTo},${yTo}`
} else if (conn.corner === 'bottom-left') {
path = `M${xFrom},${yFrom} L${xFrom},${yTo - 10} Q${xFrom},${yTo} ${xFrom + 10},${yTo} L${xTo},${yTo}`
} else if (conn.corner === 'top-left') {
path = `M${xFrom},${yFrom} L${xTo + 10},${yFrom} Q${xTo},${yFrom} ${xTo},${yFrom + 10} L${xTo},${yTo}`
}
this.architectureDiagramPaths.push(path)
})
}, 1000)
})
this.architectureDiagramPaths = []
setTimeout(() => {
this.architectureConnections.forEach(conn => {
const containerElem = document.getElementsByClassName('architecture-container')[0]
const fromElem = document.getElementById(conn.from)
const toElem = document.getElementById(conn.to)
const containerElemCoords = containerElem.getBoundingClientRect()
const fromElemCoords = fromElem.getBoundingClientRect()
const toElemCoords = toElem.getBoundingClientRect()
const xContainer = containerElemCoords.left
const yContainer = containerElemCoords.top
const xFrom = fromElemCoords.left + fromElemCoords.width / 2 - xContainer
const yFrom = fromElemCoords.top + fromElemCoords.height / 2 - yContainer
const xTo = toElemCoords.left + toElemCoords.width / 2 - xContainer
const yTo = toElemCoords.top + toElemCoords.height / 2 - yContainer
let path = `M${xFrom},${yFrom} L${xTo},${yTo}`
if (conn.corner === 'top-right') {
path = `M${xFrom},${yFrom} L${xTo - 10},${yFrom} Q${xTo},${yFrom} ${xTo},${yFrom + 10} L${xTo},${yTo}`
} else if (conn.corner === 'bottom-left') {
path = `M${xFrom},${yFrom} L${xFrom},${yTo - 10} Q${xFrom},${yTo} ${xFrom + 10},${yTo} L${xTo},${yTo}`
} else if (conn.corner === 'top-left') {
path = `M${xFrom},${yFrom} L${xTo + 10},${yFrom} Q${xTo},${yFrom} ${xTo},${yFrom + 10} L${xTo},${yTo}`
}
this.architectureDiagramPaths.push(path)
})
}, 1000)
},
methods: {