Skip to content

Commit a332de2

Browse files
committed
2 new articles (tensorflow model, duolingo extract)
1 parent 65ea553 commit a332de2

28 files changed

+509
-104
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/.idea
1+
.idea/
22

33
_site
44
.sass-cache

.idea/melledijkstra.github.io.iml

-10
This file was deleted.

.idea/misc.xml

-6
This file was deleted.

.idea/modules.xml

-8
This file was deleted.

.idea/php.xml

-4
This file was deleted.

.idea/vcs.xml

-6
This file was deleted.

.idea/yii2settings.xml

-32
This file was deleted.

Gemfile.lock

+21-20
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ GEM
2626
ffi (>= 1.3.0)
2727
eventmachine (1.2.7)
2828
execjs (2.7.0)
29-
faraday (0.17.1)
29+
faraday (1.0.1)
3030
multipart-post (>= 1.2, < 3)
31-
ffi (1.11.3)
31+
ffi (1.13.0)
3232
forwardable-extended (2.6.0)
3333
gemoji (3.0.1)
34-
github-pages (203)
34+
github-pages (206)
3535
github-pages-health-check (= 1.16.1)
36-
jekyll (= 3.8.5)
36+
jekyll (= 3.8.7)
3737
jekyll-avatar (= 0.7.0)
3838
jekyll-coffeescript (= 1.1.1)
3939
jekyll-commonmark-ghpages (= 0.1.6)
4040
jekyll-default-layout (= 0.1.4)
4141
jekyll-feed (= 0.13.0)
4242
jekyll-gist (= 1.5.0)
43-
jekyll-github-metadata (= 2.12.1)
43+
jekyll-github-metadata (= 2.13.0)
4444
jekyll-mentions (= 1.5.1)
4545
jekyll-optional-front-matter (= 0.3.2)
4646
jekyll-paginate (= 1.1.0)
@@ -72,21 +72,21 @@ GEM
7272
mercenary (~> 0.3)
7373
minima (= 2.5.1)
7474
nokogiri (>= 1.10.4, < 2.0)
75-
rouge (= 3.13.0)
75+
rouge (= 3.19.0)
7676
terminal-table (~> 1.4)
7777
github-pages-health-check (1.16.1)
7878
addressable (~> 2.3)
7979
dnsruby (~> 1.60)
8080
octokit (~> 4.0)
8181
public_suffix (~> 3.0)
8282
typhoeus (~> 1.3)
83-
html-pipeline (2.12.3)
83+
html-pipeline (2.13.0)
8484
activesupport (>= 2)
8585
nokogiri (>= 1.4)
8686
http_parser.rb (0.6.0)
8787
i18n (0.9.5)
8888
concurrent-ruby (~> 1.0)
89-
jekyll (3.8.5)
89+
jekyll (3.8.7)
9090
addressable (~> 2.4)
9191
colorator (~> 1.0)
9292
em-websocket (~> 0.5)
@@ -117,8 +117,8 @@ GEM
117117
jekyll (>= 3.7, < 5.0)
118118
jekyll-gist (1.5.0)
119119
octokit (~> 4.2)
120-
jekyll-github-metadata (2.12.1)
121-
jekyll (~> 3.4)
120+
jekyll-github-metadata (2.13.0)
121+
jekyll (>= 3.4, < 5.0)
122122
octokit (~> 4.0, != 4.4.0)
123123
jekyll-mentions (1.5.1)
124124
html-pipeline (~> 2.3)
@@ -204,20 +204,21 @@ GEM
204204
jekyll-seo-tag (~> 2.1)
205205
minitest (5.14.1)
206206
multipart-post (2.1.1)
207-
nokogiri (1.10.8)
207+
nokogiri (1.10.9)
208208
mini_portile2 (~> 2.4.0)
209-
octokit (4.14.0)
209+
octokit (4.18.0)
210+
faraday (>= 0.9)
210211
sawyer (~> 0.8.0, >= 0.5.3)
211212
pathutil (0.16.2)
212213
forwardable-extended (~> 2.6)
213214
public_suffix (3.1.1)
214-
rb-fsevent (0.10.3)
215-
rb-inotify (0.10.0)
215+
rb-fsevent (0.10.4)
216+
rb-inotify (0.10.1)
216217
ffi (~> 1.0)
217-
rouge (3.13.0)
218-
ruby-enum (0.7.2)
218+
rouge (3.19.0)
219+
ruby-enum (0.8.0)
219220
i18n
220-
rubyzip (2.0.0)
221+
rubyzip (2.3.0)
221222
safe_yaml (1.0.5)
222223
sass (3.7.4)
223224
sass-listen (~> 4.0.0)
@@ -230,11 +231,11 @@ GEM
230231
terminal-table (1.8.0)
231232
unicode-display_width (~> 1.1, >= 1.1.1)
232233
thread_safe (0.3.6)
233-
typhoeus (1.3.1)
234+
typhoeus (1.4.0)
234235
ethon (>= 0.9.0)
235236
tzinfo (1.2.7)
236237
thread_safe (~> 0.1)
237-
unicode-display_width (1.6.0)
238+
unicode-display_width (1.7.0)
238239
zeitwerk (2.3.0)
239240

240241
PLATFORMS
@@ -248,4 +249,4 @@ DEPENDENCIES
248249
jekyll-sitemap
249250

250251
BUNDLED WITH
251-
2.0.2
252+
2.1.4

_data/stories.yml

-16
This file was deleted.
Loading
Loading
Loading
Binary file not shown.

run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
bundle exec jekyll serve --host=0.0.0.0
2+
bundle exec jekyll serve # --host=0.0.0.0

sketches/person-no-person/index.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Are you a person or not?</title>
6+
</head>
7+
<body>
8+
<h1>Are you a person or not?</h1>
9+
<label for="candidate">Upload candidate</label><br />
10+
<input id="candidate" type="file" name="candidate">
11+
<p id="output">...</p>
12+
13+
<img id="image" src="." alt="candidate"/>
14+
15+
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script>
16+
<script type="module" src="main.js"></script>
17+
</body>
18+
</html>

sketches/person-no-person/main.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
(function () {
2+
let result = document.getElementById('output');
3+
// let fileInput = document.getElementById('candidate');
4+
// let img = document.getElementById("image");
5+
//
6+
// fileInput.onchange = makePrediction;
7+
8+
async function loadModel() {
9+
result.innerText = 'Loading model... ⏳';
10+
const m = await tf.loadLayersModel('model/model.json');
11+
result.innerText = 'Model loaded! 😎';
12+
return m;
13+
}
14+
15+
const model = loadModel();
16+
console.log(model);
17+
18+
// function getImageData(img) {
19+
// let canvas = document.createElement("canvas");
20+
// let ctx = canvas.getContext("2d");
21+
// let imageData;
22+
// ctx.drawImage(img, 0, 0);
23+
// imageData = ctx.getImageData(0, 0, img.width, img.height).data;
24+
// console.log("image data:", imageData);
25+
//
26+
// const pixels = tf.browser.fromPixels(img);
27+
// //const example = tf.fromPixels(); // for example
28+
// const prediction = model.predict(pixels);
29+
//
30+
// console.log(prediction);
31+
// }
32+
//
33+
// function showImage(fileReader) {
34+
// img.onload = () => getImageData(img);
35+
// img.src = fileReader.result;
36+
// }
37+
//
38+
// function makePrediction(event) {
39+
// console.log(event);
40+
// if (model) {
41+
// let tgt = event.target || window.event.srcElement,
42+
// files = tgt.files;
43+
//
44+
// // FileReader support
45+
// if (FileReader && files && files.length) {
46+
// let fr = new FileReader();
47+
// fr.onload = () => showImage(fr);
48+
// fr.readAsDataURL(files[0]);
49+
// }
50+
// }
51+
// }
52+
})();
53+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)