diff --git a/README.MD b/README.MD index cd58251..5a94d5c 100755 --- a/README.MD +++ b/README.MD @@ -4,9 +4,10 @@ [![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/poly-glot/tensorflowjs-remove-background) [![Cypress.io Dashboard](https://img.shields.io/badge/cypress-dashboard-brightgreen.svg)](https://dashboard.cypress.io/projects/jp2thc/runs) [![DeepScan grade](https://deepscan.io/api/teams/8408/projects/10623/branches/149386/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=8408&pid=10623&bid=149386) +[![Maintainability](https://api.codeclimate.com/v1/badges/e9ab18c4667689e347de/maintainability)](https://codeclimate.com/github/poly-glot/tensorflowjs-remove-background/maintainability) [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/poly-glot/tensorflowjs-remove-background) -Remove Background from picture using WebAssembly & TensorFlow.js +Remove Background from the picture using WebAssembly & TensorFlow.js # Getting Started ``` @@ -14,51 +15,40 @@ npm install npm start ``` -## Manual Review Guidelines +# How it is pieced together +Flow diagram + +## Demonstration - - + + - - + + - - + + - - + + + + + + - - + + + + + +
CSSUse BEM naming convention CanvasHow to manipulate ImageData to build a new image.
JSPrefix DOM Element class name or ID with "js-" to indicate element is linked to JavascriptCanvasSave Canvas image.
JSUse Async/Await over promisesSEOExcluding Unwanted Text from the Google Index <!--googleoff: index-->
JSKeep Code branching to one level and reduce nested if/else statementsHTMLUse referrerpolicy="no-referrer" to disable hotlink protection.
HTMLUse accept attribute e.g. accept=".jpg,.png,.jpeg" to allow users to select required file type.
JSLeverage Modern Browser API's instead of bloated libraries or framework e.g. use fetch instead of axios
Handle events using Event Bubbling.
AccessibilityA small & Accessible Collapse implementation.
-# Local Development - -### Running Github Action -``` -# https://github.com/nektos/act -curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash -act pull_request -act --job ci -``` - -### Running Sonar -``` -docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 sonarqube -docker run -ti -v $(pwd)/src:/root/src --link sonarqube newtmitch/sonar-scanner -``` - -### Docker -``` -docker build -t tensorflowjs-remove-background . -docker run -it --rm -p 5000:5000 tensorflowjs-remove-background -``` - # Browser Support 2 most recent versions of Chrome, Firefox, Safari & MS Edge. diff --git a/docs/control-flow.drawio b/docs/control-flow.drawio new file mode 100644 index 0000000..b2dbdbf --- /dev/null +++ b/docs/control-flow.drawio @@ -0,0 +1 @@ +7VtZc9s2EP41nmkfmuEhHn6sHNv11Gk9lpM2Tx2IhCg0IMEBoau/vgAJigdAiTIlS06bmWS4i4PkfrvfLpbKlX0Tr+8pSOefSAjxlWWE6yv745VlXY9c/q9QbAqFY1qFIqIoLFRmpZigf6BUGlK7QCHMGhMZIZihtKkMSJLAgDV0gFKyak6bEdy8awoiqCgmAcCq9g8UsrnUmoZRDfwCUTSXt/YdOTAFwbeIkkUi73dl2bP8TzEcg3IvOT+bg5Csair79sq+oYSw4ipe30AsTFuarVh31zG6fW4KE9ZngedBN7j2Zua1GwLft3+SOywBXsDyFVzM9xozMOXmsdxICFvllHCM20qqaMK2ZqrM4Q+pTntHC4VSO1NnIqFv2jP3BrYpPTBboRiDhEvjOYsxV5r8MpgjHD6CDVkIdDPGva2UxlyiTIYSR90e524IBdBC2nqaEDCYQjze+uoNwYTyoYTkN8wYJd+2ji/uOyMJuwMxwiKev0AaggRItbyjz0WAUZTw64A7H6Tbt6p7Y+lekDK4rqmkd95DEkNGubmMcnQkI0UySSmuqrD0y6ic1yLSKyMSSCqItltX4cAvZET0jA5LiY6HJOXWt4wJWdAA9oRRgUo1VGdg7rectJSlWsp0dZayd1hK7v7MSRYkkfDXHdvbfXYHmPtGAhgcC8/LFDi2L/I6hK5VhGJO1pkwLyVLJAKC07Sw02QR8QGGSMIF7u0RZAp+VQwJ3FZzxOAkBYEYXfHM14L1IkKs02l7x5zVDDnT0XiSpcHaPUXI+XpAuWqRYgJqeH7OuEX+B1AF0NXgZ2rwG50CP1vB7wYkSyAC8omSAGYZS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z4JNbUIqzl5ZbefWCc7xWr9u8lo/12vNt6/9XfP5RfEERz3nWcP7CO+ennc2Fvc711HO/4c6V9tZyv7AaZ1lWKn2/TqLphLrOF+eLYmcJZlfVhLpPPLvLwDOkkC89idpZ3cCGRk75x/KCVysfqteTK/+P4B9+y8= \ No newline at end of file diff --git a/public/assets/diagram.svg b/public/assets/diagram.svg new file mode 100644 index 0000000..352d9aa --- /dev/null +++ b/public/assets/diagram.svg @@ -0,0 +1,3 @@ + + +




Input Source
Input Source
Images provided by Suggestion Widget
Images provided by Suggestion...
Image uploaded by User
Image uploaded by User
Canvas Processing
Canvas Processing
Remove Browser Sandbox Restriction by cloning file into IMG element
Remove Browser Sandbox Restri...
onImageLoaded
onImageLoaded
BackgroundImage Service
BackgroundImage Service
Remove()
Remove()
predict pixels of human body in provided image
predict pixels of human b...
Copy predicted pixels from original image input source to compose a new image
Copy predicted pixels fro...
TensorFlow
TensorFlow
_segmentPerson
_segmentPerson
Output Preview
Output Preview
UpdatePreview
UpdatePreview
Update Preview Image
Update Preview Image
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/public/assets/social.jpg b/public/assets/social.jpg new file mode 100644 index 0000000..c1d2005 Binary files /dev/null and b/public/assets/social.jpg differ diff --git a/public/index.html b/public/index.html index f1088c9..0b14557 100755 --- a/public/index.html +++ b/public/index.html @@ -3,31 +3,28 @@ - Usual title - + Remove Background from the picture using WebAssembly & TensorFlow.js + - - - + + + - - + - - - - - - + + + + @@ -37,7 +34,8 @@
diff --git a/src/component/core-css/site.css b/src/component/core-css/site.css index a095f83..3c4f23f 100644 --- a/src/component/core-css/site.css +++ b/src/component/core-css/site.css @@ -1,5 +1,7 @@ .site__header { border-bottom: 1px solid var(--borderColor); + display: flex; + justify-content: space-between; padding: 15px; }