38 | 39 |
Select your photo
43 |├── .gitignore ├── LICENSE ├── README.md └── docs ├── css └── style.css ├── emotion_tensorspace.html ├── images └── face_classification_og.png ├── index.html ├── js ├── face-min.js ├── index.js ├── model_emotion.js ├── model_gender.js ├── tracking-min.js ├── util.js ├── video.js └── webcam.js ├── model ├── emotion │ ├── group1-shard1of1 │ ├── group10-shard1of1 │ ├── group11-shard1of1 │ ├── group12-shard1of1 │ ├── group13-shard1of1 │ ├── group14-shard1of1 │ ├── group15-shard1of1 │ ├── group16-shard1of1 │ ├── group17-shard1of1 │ ├── group18-shard1of1 │ ├── group19-shard1of1 │ ├── group2-shard1of1 │ ├── group20-shard1of1 │ ├── group21-shard1of1 │ ├── group22-shard1of1 │ ├── group23-shard1of1 │ ├── group24-shard1of1 │ ├── group25-shard1of1 │ ├── group26-shard1of1 │ ├── group27-shard1of1 │ ├── group28-shard1of1 │ ├── group29-shard1of1 │ ├── group3-shard1of1 │ ├── group30-shard1of1 │ ├── group31-shard1of1 │ ├── group32-shard1of1 │ ├── group33-shard1of1 │ ├── group34-shard1of1 │ ├── group35-shard1of1 │ ├── group36-shard1of1 │ ├── group37-shard1of1 │ ├── group38-shard1of1 │ ├── group39-shard1of1 │ ├── group4-shard1of1 │ ├── group40-shard1of1 │ ├── group41-shard1of1 │ ├── group42-shard1of1 │ ├── group43-shard1of1 │ ├── group44-shard1of1 │ ├── group45-shard1of1 │ ├── group46-shard1of1 │ ├── group47-shard1of1 │ ├── group48-shard1of1 │ ├── group49-shard1of1 │ ├── group5-shard1of1 │ ├── group50-shard1of1 │ ├── group51-shard1of1 │ ├── group52-shard1of1 │ ├── group53-shard1of1 │ ├── group54-shard1of1 │ ├── group55-shard1of1 │ ├── group6-shard1of1 │ ├── group7-shard1of1 │ ├── group8-shard1of1 │ ├── group9-shard1of1 │ └── model.json ├── emotion_space │ ├── encModel.json │ └── encModel.weights.bin └── gender │ ├── group1-shard1of1 │ ├── group10-shard1of1 │ ├── group11-shard1of1 │ ├── group12-shard1of1 │ ├── group13-shard1of1 │ ├── group14-shard1of1 │ ├── group15-shard1of1 │ ├── group16-shard1of1 │ ├── group17-shard1of1 │ ├── group18-shard1of1 │ ├── group19-shard1of1 │ ├── group2-shard1of1 │ ├── group20-shard1of1 │ ├── group21-shard1of1 │ ├── group22-shard1of1 │ ├── group23-shard1of1 │ ├── group24-shard1of1 │ ├── group25-shard1of1 │ ├── group26-shard1of1 │ ├── group27-shard1of1 │ ├── group28-shard1of1 │ ├── group29-shard1of1 │ ├── group3-shard1of1 │ ├── group30-shard1of1 │ ├── group31-shard1of1 │ ├── group32-shard1of1 │ ├── group33-shard1of1 │ ├── group34-shard1of1 │ ├── group35-shard1of1 │ ├── group36-shard1of1 │ ├── group37-shard1of1 │ ├── group38-shard1of1 │ ├── group39-shard1of1 │ ├── group4-shard1of1 │ ├── group40-shard1of1 │ ├── group41-shard1of1 │ ├── group42-shard1of1 │ ├── group43-shard1of1 │ ├── group44-shard1of1 │ ├── group45-shard1of1 │ ├── group46-shard1of1 │ ├── group47-shard1of1 │ ├── group48-shard1of1 │ ├── group49-shard1of1 │ ├── group5-shard1of1 │ ├── group50-shard1of1 │ ├── group51-shard1of1 │ ├── group52-shard1of1 │ ├── group53-shard1of1 │ ├── group54-shard1of1 │ ├── group55-shard1of1 │ ├── group6-shard1of1 │ ├── group7-shard1of1 │ ├── group8-shard1of1 │ ├── group9-shard1of1 │ └── model.json ├── video.html └── webcam.html /.gitignore: -------------------------------------------------------------------------------- 1 | ### macOS ### 2 | *.DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | 6 | # Icon must end with two \r 7 | Icon 8 | 9 | # Thumbnails 10 | ._* 11 | 12 | # Files that might appear in the root of a volume 13 | .DocumentRevisions-V100 14 | .fseventsd 15 | .Spotlight-V100 16 | .TemporaryItems 17 | .Trashes 18 | .VolumeIcon.icns 19 | .com.apple.timemachine.donotpresent 20 | 21 | # Directories potentially created on remote AFP share 22 | .AppleDB 23 | .AppleDesktop 24 | Network Trash Folder 25 | Temporary Items 26 | .apdisk 27 | .tags 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 tupleblog 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # face-classification-js 2 | 3 | Repository for gender and emotion classification using [TensorFlow.js](https://js.tensorflow.org/). 4 | The original repository can be seen at [oarriaga/face_classification](https://github.com/oarriaga/face_classification). 5 | We train [MobileNet](https://www.tensorflow.org/api_docs/python/tf/keras/applications/MobileNet) 6 | to classify gender and emotion of the face based on FER2013 and IMDB datasets. 7 | The face tracking part is done by using [`trackingjs`](https://trackingjs.com/), 8 | lightweight JavaScript core for computer vision. 9 | 10 | You can see more details of analysis and examples on [tupleblog](https://tupleblog.github.io/). 11 | 12 | 13 | ## demo 14 | 15 | Try out the image classification demo at 16 | [tupleblog.github.io/face-classification-js](http://tupleblog.github.io/face-classification-js/). 17 | You can also try webcam real-time video classification on web browser at 18 | [tupleblog.github.io/face-classification-js/webcam.html](https://tupleblog.github.io/face-classification-js/webcam.html) 19 | 20 | 21 | ## contributors 22 | 23 | - [kittinan](https://github.com/kittinan) 24 | - [titipata](https://github.com/titipata) 25 | - [bluenex](https://github.com/bluenex/) 26 | 27 | from [tupleblog](https://tupleblog.github.io/) 28 | -------------------------------------------------------------------------------- /docs/css/style.css: -------------------------------------------------------------------------------- 1 | /* sticky footer */ 2 | * { 3 | margin: 0; 4 | } 5 | 6 | html, body { 7 | height: 100%; 8 | font-family: 'CMUSansSerifMedium', serif; 9 | } 10 | 11 | .wrapper { 12 | min-height: 100%; 13 | height: auto !important; 14 | height: 100%; 15 | margin: 0 auto -5em; 16 | } 17 | 18 | .footer, .push { 19 | height: 5em; 20 | color: rgba(255,255,255,0.8); 21 | } 22 | 23 | /* center footer */ 24 | .flex-container { 25 | display: flex; 26 | align-items: center; 27 | justify-content: center; 28 | } 29 | 30 | .flex-item { 31 | text-align: center; 32 | } 33 | 34 | /* images */ 35 | #card-item-container { 36 | visibility: hidden; 37 | } 38 | 39 | #image-container { 40 | position: relative; 41 | padding: 10px; 42 | } 43 | 44 | #show-img { 45 | max-width: 100%; 46 | } 47 | 48 | .face-frame { 49 | border: 2px solid #ff0000; 50 | position: absolute; 51 | } 52 | 53 | .canvas-face { 54 | display: none; 55 | } 56 | .chart-result-profile canvas { 57 | border-radius: 50px; 58 | } 59 | 60 | #head-container { 61 | font-size: 2.1rem; 62 | } 63 | 64 | #webcam { 65 | width: 100%; 66 | } 67 | #canvas_webcam { 68 | width: 100%; 69 | position: absolute; 70 | top: 10px; 71 | left: 10px; 72 | } 73 | #webcam_frame { 74 | width: 100%; 75 | position: absolute; 76 | top: 0; 77 | left: 0; 78 | border: 2px solid #ff0000; 79 | } 80 | #btn-share { 81 | display: none; 82 | } 83 | #btn-manual { 84 | display: none; 85 | } 86 | .cropper-modal { 87 | opacity: 0.05; 88 | } 89 | #main-container { 90 | font-family: Roboto, sans-serif; 91 | } 92 | 93 | @media only screen and (max-width: 992px) { 94 | #head-container { 95 | text-align: center; 96 | font-size: 1.8rem; 97 | } 98 | } 99 | 100 | @media only screen and (max-width: 640px) { 101 | #head-container { 102 | text-align: center; 103 | font-size: 1.5rem; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /docs/emotion_tensorspace.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |Select your photo
43 |Select your photo
43 |=this.REGIONS_OVERLAP&&h/(f*(k/f))>=this.REGIONS_OVERLAP&&t.union(n,a)}}for(var u={},l=0;l Select your video
37 |
38 |
39 |
37 |
38 |
39 |