Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,23 @@ Run
```

## Troubleshooting Setup
Try using the Docker container.
If you don't want to, make sure you're using Node 10 LTS.

If you have problems running the setup steps related to node-gyp, then you might need to set Python 2.7 to be your default (just during the installation).
Recommendation: Temporarily set up a Python 2.7 Conda environment (just for the installation) and activate it:
```bash
conda create --name python2 python=2
conda activate python2
```

You might also need to do:
```bash
export NODE_GYP_FORCE_PYTHON=`which python`
```

If you get issues with `git` when running the setup or `yarn install`, then running `git config --global url."https://".insteadOf git://` might help.

## Docker Setup
1. Clone this repo.

Expand Down Expand Up @@ -132,6 +142,8 @@ Run:
yarn client
```

Go to http://localhost:3000 in your browser to interact with the models.

## Troubleshooting Deployment
### Blockchain Issues
Run `yarn clean` to delete your local blockchain and cached contracts. This will delete any transactions done but should make everything work again.
Expand Down
16 changes: 11 additions & 5 deletions demo/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/react-dom": "^16.9.9",
"axios": "^0.21.2",
"blueimp-load-image": "^2.24.0",
"canvas": "^2.6.0",
"canvas": "^2.9.1",
"dotenv": "^8.2.0",
"immutability-helper": "^3.0.1",
"moment": "^2.29.4",
Expand All @@ -31,10 +31,10 @@
"react-scripts": "^3.4.4",
"react-spinners": "^0.6.1",
"serve": "^11.2.0",
"truffle": "^5.1.50",
"typescript": "^3.7.3",
"web3": "^1.3.0",
"web3-eth-contract": "^1.3.0"
"truffle": "^5.5.18",
"typescript": "^4.7.4",
"web3": "^1.7.4",
"web3-eth-contract": "^1.7.4"
},
"scripts": {
"start": "bash deploy_client.sh",
Expand All @@ -54,7 +54,13 @@
"devDependencies": {
"@tensorflow/tfjs-node": "^1.3.2",
"fake-indexeddb": "^3.0.0",
"mocha": "^4.1.0",
"node-fetch": "^2.6.7",
"ts-node": "^9.1.1"
},
"resolutions": {
"//": "truffle pulls in a later version of emittery that doesn't work with Node < 12, but we need Node 10, otherwise node-gyp doesn't work.",
"emittery": "^0.8.1",
"mocha": "^4.1.0"
}
}
2 changes: 1 addition & 1 deletion demo/client/src/components/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ class Model extends React.Component {
// Correct the orientation.
loadImage(`data:${file.type};base64,${btoa(binaryStr)}`, (canvas) => {
const imgElement = document.getElementById('input-image')
imgElement.src = canvas.toDataURL()
imgElement.src = canvas.src
}, { orientation: true })
}
reader.readAsBinaryString(file)
Expand Down
Loading