Over the limit
[AI] Facial Expression Recognition ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฐ ๋ฐ์ดํฐ์ ๋ถ์ ๋ณธ๋ฌธ
[AI] Facial Expression Recognition ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ฐ ๋ฐ์ดํฐ์ ๋ถ์
ellapk 2022. 9. 12. 16:36https://paperswithcode.com/paper/challenges-in-representation-learning-a#code
Papers with Code - Challenges in Representation Learning: A report on three machine learning contests
๐ SOTA for Facial Expression Recognition on FER2013 (Accuracy metric)
paperswithcode.com
์ฌ์ฉ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ dataset ์ ๊ฐ๊ฐ ๋ถ์ํด๋ณด์.
๋ผ์ด๋ธ๋ฌ๋ฆฌ
1. ResidualMaskingNetwork [PyTorch]
https://github.com/phamquiluan/ResidualMaskingNetwork
GitHub - phamquiluan/ResidualMaskingNetwork: ICPR 2020: Facial Expression Recognition using Residual Masking Network
ICPR 2020: Facial Expression Recognition using Residual Masking Network - GitHub - phamquiluan/ResidualMaskingNetwork: ICPR 2020: Facial Expression Recognition using Residual Masking Network
github.com
ํด๋น ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ ์ฌ๋ ๊ฐ์ ๋ถ์ AI ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๊ฐ์ด, ์ด๋ฏธ์ง์ ์ ๋ฃ์ผ๋ฉด ๊ทธ ๊ฐ์ ์ด ๋ถ์๋๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์.
์ฌ์ฉ ๋ฐฉ๋ฒ ๋ํ install ํ,
from rmn import RMN
m = RMN()
m.video_demo()
# or
image = cv2.imread("some-image-path.png")
results = m.detect_emotion_for_single_frame(image)
print(results)
image = m.draw(image, results)
cv2.imwrite("output.png", image)
๋ค์๊ณผ ๊ฐ์ด ํ์ด์ฌ ๋ด์ ํ์ผ์ ๋ฃ์ด์ค์ผ๋ก์จ ๋ถ์์ด ๋ฐ๋ก ๊ฐ๋ฅํ๋ค.
PyTorch ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์์๋ ๊ทธ๋๋ง ์ฌ์ฉ๋ฅ ์ด ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ค.
2. fer [TenserFlow]
https://github.com/justinshenk/fer
GitHub - justinshenk/fer: Facial Expression Recognition with a deep neural network as a PyPI package
Facial Expression Recognition with a deep neural network as a PyPI package - GitHub - justinshenk/fer: Facial Expression Recognition with a deep neural network as a PyPI package
github.com
1๋ฒ์์ ์๊ฐํ python ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ณด๋จ ์กฐ๊ธ ๋ ์์ธํ output ์ ๊ณต์ด ์ด๋ฃจ์ด์ง๋ค.
Sample output:
[{'box': [277, 90, 48, 63], 'emotions': {'angry': 0.02, 'disgust': 0.0, 'fear': 0.05, 'happy': 0.16, 'neutral': 0.09, 'sad': 0.27, 'surprise': 0.41}]
์ด๋ฏธ์ง ์ฌ์ฉ๋ฒ์ 1๋ฒ๊ณผ ๊ฐ์๋ฐ, ์ข ๋ ๋ค๋ฅธ ํน์ง์ด๋ผ ํจ์ Video ๋ถ์ ์ ๊ณต๋ ๊ฐ๋ฅํ๋ค๋ ์ ?!
from fer import Video
from fer import FER
video_filename = "tests/woman2.mp4"
video = Video(video_filename)
# Analyze video, displaying the output
detector = FER(mtcnn=True)
raw_data = video.analyze(detector, display=True)
df = video.to_pandas(raw_data)
๋ฐ์ดํฐ์
FER2013
https://paperswithcode.com/dataset/fer2013
Papers with Code - FER2013 Dataset
Fer2013 contains approximately 30,000 facial RGB images of different expressions with size restricted to 48×48, and the main labels of it can be divided into 7 types: 0=Angry, 1=Disgust, 2=Fear, 3=Happy, 4=Sad, 5=Surprise, 6=Neutral. The Disgust expressio
paperswithcode.com
fer2013 ๋ฐ์ดํฐ์ ์ ๋๋ต 3๋ง๊ฐ์ 48x48 RGB์ด๋ฏธ์ง๋ค์ ๋ถ์ํด์
0=Angry, 1=Disgust, 2=Fear, 3=Happy, 4=Sad, 5=Surprise, 6=Neutral. ์ 7 type์ผ๋ก ๋ถ๋ฅํจ.
์ผ๊ตด ์ฌ์ง๋ค์ ์๋์ผ๋ก ์ค์ ์ ๋ ฌํ๋ค๋ ์ฌ์ฉ์ ๋ฒ๊ฑฐ๋ก์ด ๊ณผ์ ์ ์์ ๋ฏ ํ๋ค.
train.csv ๊ฐ์ ๊ฒฝ์ฐ๋ ํ ์ด๋ฏธ์ง๋ฅผ emotion๊ณผ pixel์ด๋ผ๊ณ ๋๊ฐ๋ก colum์ ๋๋ ์ ํ์ํจ.
+) ๊ฐ์ธ์ ๊ฒฌํด
๋ด๊ฐ ๋ถ์ํ Model๋ค๋ณด๋ค ํด๋น ์ฌ์ดํธ์ ๋์์๋ ๋ค๋ฅธ Model๋ค์ ํธ๋ ๋๋ ์ ํ๋๊ฐ ๋ ๋๋ค.
๋ฐ์ดํฐ์ ์ ๋ณดํต FER2013์ ๋์ผํ๊ฒ ๋ง์ด ์ฌ์ฉํ๋ ๊ฒ์ ๋ณด๋, ์๊ฐํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ค์ ์ ๋ขฐ๋๊ฐ
๊ฒฝ์๋ ฅ ์ธก๋ฉด์์ ๋จ์ด์ง๋ ๋ฏ ํ๋ค. ์ต์ ํ ๋๊ณ ์ ํ๋๊ฐ ๋์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ ํ์ํด ๋ณผ ํ์๊ฐ ์๋ค๊ณ ๋ด.
'Etc > AI' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[AI] ํผ์ ํธ๋ก ? ๋ ผ๋ฆฌํ๋ก? (0) | 2022.06.03 |
---|