|
4 | 4 | [](https://percy.io/poly-glot/tensorflowjs-remove-background) |
5 | 5 | [](https://dashboard.cypress.io/projects/jp2thc/runs) |
6 | 6 | [](https://deepscan.io/dashboard#view=project&tid=8408&pid=10623&bid=149386) |
| 7 | +[](https://codeclimate.com/github/poly-glot/tensorflowjs-remove-background/maintainability) |
7 | 8 | [](https://gitpod.io/#https://github.com/poly-glot/tensorflowjs-remove-background) |
8 | 9 |
|
9 | | -Remove Background from picture using WebAssembly & TensorFlow.js |
| 10 | +Remove Background from the picture using WebAssembly & TensorFlow.js |
10 | 11 |
|
11 | 12 | # Getting Started |
12 | 13 | ``` |
13 | 14 | npm install |
14 | 15 | npm start |
15 | 16 | ``` |
16 | 17 |
|
17 | | -## Manual Review Guidelines |
| 18 | +# How it is pieced together |
| 19 | +<img src="https://removebg.junaid.eu/assets/diagram.svg" alt="Flow diagram" /> |
| 20 | + |
| 21 | +## Demonstration |
18 | 22 | <table width="100%"> |
19 | 23 | <tr> |
20 | | - <td width="100">CSS</td> |
21 | | - <td>Use BEM naming convention </td> |
| 24 | + <td width="100">Canvas</td> |
| 25 | + <td>How to manipulate <a href="https://developer.mozilla.org/en-US/docs/Web/API/ImageData" target="_blank">ImageData</a> to build a new image.</td> |
22 | 26 | </tr> |
23 | 27 | <tr> |
24 | | - <td width="100">JS</td> |
25 | | - <td>Prefix DOM Element class name or ID with "js-" to indicate element is linked to Javascript</td> |
| 28 | + <td width="100">Canvas</td> |
| 29 | + <td><a href="https://github.com/poly-glot/tensorflowjs-remove-background/blob/00b6333c660ea1ecf7d1562dae56b68eea137041/src/component/output/events.js#L42" target="_blank">Save Canvas image.</a></td> |
26 | 30 | </tr> |
27 | 31 | <tr> |
28 | | - <td width="100">JS</td> |
29 | | - <td>Use Async/Await over promises</td> |
| 32 | + <td width="100">SEO</td> |
| 33 | + <td><a href="https://support.google.com/gsa/answer/6329153?hl=en#82542">Excluding Unwanted Text from the Google Index</a> <code><!--googleoff: index--></code></td> |
30 | 34 | </tr> |
31 | 35 | <tr> |
32 | | - <td width="100">JS</td> |
33 | | - <td>Keep Code branching to one level and reduce nested if/else statements</td> |
| 36 | + <td width="100">HTML</td> |
| 37 | + <td>Use <code>referrerpolicy="no-referrer"</code> to disable hotlink protection.</td> |
34 | 38 | </tr> |
| 39 | + <tr> |
| 40 | + <td width="100">HTML</td> |
| 41 | + <td>Use accept attribute e.g. <code>accept=".jpg,.png,.jpeg"</code> to allow users to select required file type.</td> |
| 42 | + </tr> |
35 | 43 | <tr> |
36 | 44 | <td width="100">JS</td> |
37 | | - <td>Leverage Modern Browser API's instead of bloated libraries or framework e.g. use fetch instead of axios</td> |
38 | | - </tr> |
| 45 | + <td>Handle events using <a href="https://javascript.info/bubbling-and-capturing">Event Bubbling</a>.</td> |
| 46 | + </tr> |
| 47 | + <tr> |
| 48 | + <td width="100">Accessibility</td> |
| 49 | + <td>A small & Accessible Collapse implementation.</td> |
| 50 | + </tr> |
39 | 51 | </table> |
40 | 52 |
|
41 | | -# Local Development |
42 | | - |
43 | | -### Running Github Action |
44 | | -``` |
45 | | -# https://github.com/nektos/act |
46 | | -curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash |
47 | | -act pull_request |
48 | | -act --job ci |
49 | | -``` |
50 | | - |
51 | | -### Running Sonar |
52 | | -``` |
53 | | -docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube |
54 | | -docker run -ti -v $(pwd)/src:/root/src --link sonarqube newtmitch/sonar-scanner |
55 | | -``` |
56 | | - |
57 | | -### Docker |
58 | | -``` |
59 | | -docker build -t tensorflowjs-remove-background . |
60 | | -docker run -it --rm -p 5000:5000 tensorflowjs-remove-background |
61 | | -``` |
62 | | - |
63 | 53 | # Browser Support |
64 | 54 | 2 most recent versions of Chrome, Firefox, Safari & MS Edge. |
0 commit comments