From b42b1cfd0cdf9e97506c6b12d2ad05a8e6dfeec3 Mon Sep 17 00:00:00 2001 From: Hao Luo Date: Sun, 19 Mar 2017 18:06:40 -0500 Subject: [PATCH] ready for deployment --- Web.config | 61 +++++++++++++++++++ docs/_config.yml | 2 +- iisnode.yml | 1 + package.json | 4 +- .../FaceImageViewer/FaceImageViewer.js | 4 +- .../NewFaceWebcamModal/NewFaceWebcamModal.js | 1 - src/components/core/OpenModal/OpenModal.js | 1 - .../pages/IdentifyPage/IdentifyPage.js | 1 - .../IdentifyPage/IdentifyPageContainer.js | 7 ++- 9 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 Web.config create mode 100644 iisnode.yml diff --git a/Web.config b/Web.config new file mode 100644 index 0000000..69fb50b --- /dev/null +++ b/Web.config @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_config.yml b/docs/_config.yml index c07e4e1..7ad6ef7 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -13,7 +13,7 @@ # you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. # You can create any custom variable you would like, and they will be accessible # in the templates via {{ site.myvariable }}. -title: Training Phase +title: Training Faces email: haolu@microsoft.com description: > A Dashboard for training your Microsoft Cognitive Services API diff --git a/iisnode.yml b/iisnode.yml new file mode 100644 index 0000000..5afc98c --- /dev/null +++ b/iisnode.yml @@ -0,0 +1 @@ +nodeProcessCommandLine: "%SystemDrive%\Program Files (x86)\nodejs\6.9.4\node.exe" \ No newline at end of file diff --git a/package.json b/package.json index e1173d8..78b1a5b 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ } }, "deploy": { - "command": "npm run lint && npm run test && npm run clean && npm run compile", + "command": "npm run lint && npm run clean && npm run compile", "env": { "DEBUG": "app:*" } @@ -144,6 +144,8 @@ "karma-webpack-with-fast-source-maps": "^1.9.2", "less": "^2.7.2", "less-loader": "^2.2.3", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", "mocha": "^3.0.1", "nodemon": "^1.10.2", "phantomjs-prebuilt": "^2.1.12", diff --git a/src/components/content/FaceImageViewer/FaceImageViewer.js b/src/components/content/FaceImageViewer/FaceImageViewer.js index 9db5adf..1bb1d7e 100644 --- a/src/components/content/FaceImageViewer/FaceImageViewer.js +++ b/src/components/content/FaceImageViewer/FaceImageViewer.js @@ -24,9 +24,9 @@ class FaceImageViewer extends Component { ctx.strokeRect(x, y, width, height) if (bottomLabel) { ctx.fillStyle = color - ctx.fillRect(x, y + height, width, 10) + ctx.fillRect(x, y + height, width, 18) ctx.strokeStyle = 'white' - ctx.strokeText(bottomLabel, x + 10, y + height + 10) + ctx.strokeText(bottomLabel, x + 10, y + height + 13) } }) } diff --git a/src/components/content/NewFaceWebcamModal/NewFaceWebcamModal.js b/src/components/content/NewFaceWebcamModal/NewFaceWebcamModal.js index dda0cf3..96738b8 100644 --- a/src/components/content/NewFaceWebcamModal/NewFaceWebcamModal.js +++ b/src/components/content/NewFaceWebcamModal/NewFaceWebcamModal.js @@ -50,7 +50,6 @@ class NewFaceWebcamModal extends Component { } NewFaceWebcamModal.propTypes = { - className: PropTypes.string, onCaptureClick: PropTypes.func, visible: PropTypes.bool, capturedImage: PropTypes.string, diff --git a/src/components/core/OpenModal/OpenModal.js b/src/components/core/OpenModal/OpenModal.js index c3feb37..9b720b1 100644 --- a/src/components/core/OpenModal/OpenModal.js +++ b/src/components/core/OpenModal/OpenModal.js @@ -23,7 +23,6 @@ OpenModal.propTypes = { openFunc: PropTypes.func.isRequired, modalVisible: PropTypes.bool.isRequired, closeModal: PropTypes.func.isRequired, - uid: PropTypes.string, size: PropTypes.oneOf(['small', 'medium', 'large', 'xlarge']).isRequired } diff --git a/src/components/pages/IdentifyPage/IdentifyPage.js b/src/components/pages/IdentifyPage/IdentifyPage.js index 2624ae0..c9e0423 100644 --- a/src/components/pages/IdentifyPage/IdentifyPage.js +++ b/src/components/pages/IdentifyPage/IdentifyPage.js @@ -6,7 +6,6 @@ import WebcamInput from 'components/forms/WebcamInput' import FaceImageViewer from 'components/content/FaceImageViewer' import JSONTree from 'react-json-tree' import themes from 'constants/uiThemes' -import AceEditor from 'react-ace' import 'brace/mode/json' import 'brace/theme/github' diff --git a/src/components/pages/IdentifyPage/IdentifyPageContainer.js b/src/components/pages/IdentifyPage/IdentifyPageContainer.js index 094c6b0..9c792f3 100644 --- a/src/components/pages/IdentifyPage/IdentifyPageContainer.js +++ b/src/components/pages/IdentifyPage/IdentifyPageContainer.js @@ -4,17 +4,18 @@ import { inputChangeWebcamIdentifyImage } from 'actions/webcam' import { detectFace, setDetectedFaces, identifyFace, resetIdentifyFace, setIdentifiedResults } from 'actions/face' import { setIdentifyGroup } from 'actions/group' import { requestListPersons, setPersons } from 'actions/person' +import get from 'lodash.get' const transformFacesToShapes = (facesArray, results, persons = []) => { return facesArray.map((face) => { const { faceId } = face const { left: x, top: y, width, height } = face.faceRectangle - const result = results.find((result) => result.faceId === faceId) || { candidates: [] } - const personId = result.candidates[0] ? result.candidates[0].personId : '' + const result = results.find((result) => result.faceId === faceId) + const personId = get(result, 'candidates[0].personId', '') const person = personId ? persons.find((person) => person.personId === personId) : {} const personName = person.name return { - topLabel: faceId.slice(0, 8) + '...', + topLabel: 'faceId: ' + faceId.slice(0, 8) + '...', dimension: { x, y, width, height }, bottomLabel: personName }