Peen ๐Ÿฅบ ์—ฌ๋ถ€๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ๋นŒ์–ด ๋จน์„ ์•ฑ์„ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค.

์•„๋ฌด๋ž˜๋„, ์ฃผ์‹ํšŒ์‚ฌ ๋ฉ”์ดํฌ๋ฆฌ์˜ ์ฟ ๋กœ๊ฐ€๋ฏธ( @kokushing )๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค.
๋นŒ์–ด ๋จน์„ ์•ฑ 2 Advent Calendar 2020 18์ผ์งธ ๊ฒŒ์‹œ๋ฌผ์ž…๋‹ˆ๋‹ค.

๋งŒ๋“  ๊ฒƒ



์‚ฌ์ง„์— ์ฐํ˜€์žˆ๋Š” ์–ผ๊ตด์ด "ํ”ผ์—” ๐Ÿฅบ"์ธ์ง€ ์—ฌ๋ถ€๋ฅผ ํŒ๋‹จํ•˜๋Š” ๋นŒ์–ด ๋จน์„ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์ž…๋‹ˆ๋‹ค.

๐Ÿฅบ pi-checker

์ด๋ฏธ์ง€๋ฅผ ์„ ํƒํ•˜๋ฉด ์–ผ๊ตด์„ ๊ฐ์ง€ํ•˜๊ณ  ํ•„๊ธฐ ์—ฌ๋ถ€๋ฅผ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค.



ํ”ผ์—” ์Šค์ฝ”์–ด๊ฐ€ 90์„ ๋„˜์œผ๋ฉด ใ€ŒํŒŒ์˜จ๐Ÿ˜ใ€๊ฐ€ ๋ฉ๋‹ˆ๋‹ค.



ํŒ์ •์€ ๊ฝค ๊ฐ€๋ฐ”๊ฐ€๋ฐ”์ž…๋‹ˆ๋‹ค.

๊ฒฝ์œ„



์˜ฌํ•ด๋„ ์ž‘๋…„ ์— ์ด์–ด, face-api.js๋ผ๋Š” tensorflow.js๋ฅผ ์ด์šฉํ•œ JavaScript ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ด์šฉํ•˜๋ ค๊ณ  ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ํ™•์‹คํžˆ ์ƒ๊ฐํ•ด ์˜จ ๊ฒƒ์ด ์ด ๋นŒ์–ด ๋จน์„ ์•ฑ์ž…๋‹ˆ๋‹ค.

๋‚˜๋Š” 5 ์ดˆ ๋งŒ์— ์ƒ๊ฐํ–ˆ๋‹ค.
์ด ์ •๋„์˜ ์†๋„๊ฐ์ด ๋นŒ์–ด ๋จน์„ ์•ฑ ๊ฐœ๋ฐœ์—๋Š” ํ•„์š”ํ•˜๋„ค์š”(์ˆ˜์ˆ˜๊ป˜๋ผ)

์ฒ˜์Œ์—๋Š” ํ•„๊ธฐ HTML์—์„œ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ์จ์„œ ์›น ์‚ฌ์ดํŠธ๋ฅผ ๋งŒ๋“ค ์ˆ˜์žˆ๋Š” ๋นŒ์–ด ๋จน์„ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์„ ๋งŒ๋“ค๊ณ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค ๋งŒ, ๋„ˆ๋ฌด ์‹ฌ๊ฐํ•˜์ง€ ๋งˆ๋ผ ~๋ผ๊ณ  ์ƒ๊ฐ ์ „ํ–ฅํ–ˆ์Šต๋‹ˆ๋‹ค.

ํ•„๊ธฐ ํ…์ŠคํŠธ์—์„œ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๋นŒ์–ด ๋จน์„ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ ๋งŒ๋“ค๊ธฐ ํ”ผ c. ๋ผ๊ณ  r. ์ฝ” m / c2 ์—ฃ svCxH โ€” ์ฟ ๋กœ๊ฐ€๋ฏธ/makery, inc CEO (@kokushing) December 1, 2020


<script async=""src="https://platform.twitter.com/widgets.js"/>

๋‚˜์ค‘์— ์—ฌ๋‹ด์ž…๋‹ˆ๋‹ค๋งŒ, December 5, 2020 ์˜ ๋Œ€์ƒ์€ ใ€Œํ”ผ์—”ใ€๋‹ต์Šต๋‹ˆ๋‹ค. ๋ณด๊ณ ์‹ถ๋‹ค.



๊ตฌํ˜„



React.js, TypeScript, face-api.js, react-dropzone, styled-components์—์„œ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฏธ์ง€ ๋‹ค์šด๋กœ๋“œ์—๋Š” html2canvas๋ผ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ด์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ธํ”„๋ผ๋Š” Netlify ์„ ๋ฐฐ. Vercel ์„ ๋ฐฐ๋„ ์‹ ๊ฒฝ์ด ์“ฐ์ด๊ธฐ ๋•Œ๋ฌธ์— ์ด๋ฒˆ์— ์‹œ๋„ํ•ฉ๋‹ˆ๋‹ค.



์ด ๋นŒ์–ด ๋จน์„ ์•ฑ์˜ ์ž‘๋™ ๋ฐฉ์‹์€ ๊ฐ„๋‹จํ•˜๋ฉฐ react-dropzone์—์„œ ๋ฐ›์€ ์ด๋ฏธ์ง€ ๋ฐ์ดํ„ฐ๋ฅผ face-api.js๋กœ ๋ถ„์„ํ•˜์—ฌ ์–ผ๊ตด ํ‘œ์ •์„ ์ˆซ์ž๋กœ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.



๋‹ค์Œ์€ ์ˆ˜์น˜์— ์˜ํ•ด ๊ฒฐ๊ณผ๋ฅผ ๋ฐ”๊ฟ€ ๋ฟ. ๊ฐ„๋‹จํ•˜๋„ค์š”.



์Šฌํ”ˆ ์–ผ๊ตด ์ˆ˜์น˜๋ฅผ ์–ป์œผ๋ ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์“ฐ๋ฉด ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.



(async () => {
  const inputEl = document.getElementById("input") as HTMLImageElement;
  const MODEL_URL = `${process.env.PUBLIC_URL}/models`;
  await faceapi.nets.tinyFaceDetector.load(MODEL_URL);
  await faceapi.nets.faceExpressionNet.load(MODEL_URL);

  const detectionsWithExpressions = await faceapi
    .detectAllFaces(inputEl, new faceapi.TinyFaceDetectorOptions())
    .withFaceExpressions();

  const score =
    detectionsWithExpressions.length > 0
      ? detectionsWithExpressions[0].expressions.sad
      : -1;

  console.log(score); // ๆ‚ฒใ—ใฟใฎๆ•ฐๅ€คใ‚’ๅ–ๅพ—
})();


ํ›„๊ธฐ



์ง„์งœ๋Š” OGํ™”์ƒ์ด๋ผ๋“ ์ง€ SSRํ•ด์„œ Twitter๋กœ ์‰์–ดํ•  ์ˆ˜ ์žˆ๋„๋ก(๋“ฏ์ด) ํ•˜๊ณ  ์‹ถ์—ˆ์Šต๋‹ˆ๋‹ค๋งŒ, ์‹œ๊ฐ„์˜ ์‚ฌ์ •์œผ๋กœ ๋‹จ๋…ํ–ˆ์Šต๋‹ˆ๋‹ค.



ํ”ผ์—” ๐Ÿฅบ



Photo by



์‚ผ์„ฑ๋‹น ์‚ฌ์ „์„ ์งœ๋Š” ์‚ฌ๋žŒ์ด ์„ ํƒํ•˜๋Š” ใ€Œ์˜ฌํ•ด์˜ ์‹ ์–ด 2020ใ€

ํŒŒ์ฟ ํƒ€์†Œ


์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ