29 Mon
GARIGO : Face Mosaic Project
๋ชจ๋ธ ์ธ์ ์ค์
face locations
face_locations = face_recognition.face_locations(
face, number_of_times_to_upsample=1, model='cnn')
number_of_times_to_upsample
detectํ ์ผ๊ตด์ด ์์ผ๋ฉด location ํ๋๋ฐ ์ด๋ ค์์ด ์๊ธฐ ๋๋ฌธ์ ์์ ์ผ๊ตด๋ค์ ๋ํด upsample ํ ์ ์๋๋ก ํ๋ค.
detect๋ ํ์ง ๋ชปํ ์ ๋๋ก ์ผ๊ตด์ด ์์ ๊ฒฝ์ฐ์ ๋ฌธ์ ๋ ์ฝ๊ฒ ํด๊ฒฐํ ์ ์๋ ๋ถ๋ถ์ ์๋๋ค.
์ฐจ๋ผ๋ฆฌ tiny ๋ชจ๋ธ์ ์จ์ ํฉ์ฑ์ ํ๋๊ฒ ๋์ ์ ๋.
๋งค๋ฒ ๋ชจ๋ ์ด๋ฏธ์ง๋ฅผ ํ๋ ์ฒ๋ฆฌํ๊ธฐ์๋ ๋๋ฌด ๋ง์ ์์์ด ๋ค๊ธฐ ๋๋ฌธ์ด๋ค.
์ด๋ฏธ์ง๋ฅผ k๋ฐฐ ํ๋ํ ์๋ก ์๊ฐ๋ k๋ฐฐ ๋๋ค. ๊ทผ๋ฐ ๊ทธ์ ๋นํด ์ฑ๋ฅ์ด k๋ฐฐ ์ข์์ง์ง๋ ์๋๋ค. ์ฑ๋ฅ์ ๋นํด ์๊ฐ์ด ๋๋ฌด ๋ง์ด ์์๋์ ๋๋ฌด ์์ ์ด๋ฏธ์ง์ ๋ํด์๋ง ์งํํ ํ์๋ ์๋ค.

model='cnn'
cnn
๊ณผhog
๋ฒ์ ์ด ์๋ค.cnn์ landmarks 68 ๋ฐฉ์์, hog๋ landmarks 5 ๋ฐฉ์์ ์ฌ์ฉํ๋ฉฐ tradeoff์ ๊ด๊ณ๋ผ๊ณ ์๊ฐํ๋ฉด ๋๋ค.
face encodings
face_encodings = face_recognition.face_encodings(
img_raw, face_locations, num_jitters=5, model="large")
num_jitters
encoding์ ๋ช๋ฒ์ ๋ฐ๋ณตํด์ ํ ์ง ๊ฒฐ์ ํ๋ ์ธ์์ด๋ค.
ํ์คํ๋ ๋ชจ๋ฅด๊ฒ ์ง๋ง, ์ข ๋ ์ธ๋ฐํ๊ฒ recognize ํ๋ ๊ฒ ๊ฐ๋ค.
upsample๊ณผ ๋ง์ฐฌ๊ฐ์ง๋ก k๋ฒ ํ ์๋ก ์๊ฐ์ k๋ฐฐ ๋๋ค. ํ์ง๋ง, ์ฒด๊ฐ ์๊ฐ์ด ๊ทธ๋ ๊ฒ ํฌ์ง ์์์ 5์ ๋๋ก ๋์๋ค.
model='large'
small
๊ณผlarge
๊ฐ ์๋ค.encoding ๋ฐฉ์์ ๋ํ ๋ถ๋ถ์ด๊ณ location์์
cnn
๋ชจ๋ธ์ผ ๊ฒฝ์ฐ encoding์large
๋ฅผ ์ฌ์ฉํ๋ค.์ฃผ์์ด default๊ฐ
large
๋ผ๊ณ ํ๋ฉด์ ์ค์ ์ฝ๋๋small
๋ก ๋์ด์๋ค.
compare_faces
matches = face_recognition.compare_faces(
known[person_name], face_encoding, tolerance=thresh)
tolerance
์ฌ๊ธฐ์๋ ์ค๋ ์๊ฐ์ ๊ณ ์ ํด์ ์ฌ์ฉํ๋๋ฐ, ๊ฐ ์ ๋ง๋ค ๋ค๋ฅด๊ฒ ํ ํ์ฉ์ฑ์ ๋๋๋ค.
๋ ์ผ๊ตด๊ฐ์ ์ธ์ฝ๋ฉ ๊ฐ ์ฐจ์ด๊ฐ ์ผ์ ์ค๋ ์ ๊ฐ ์ดํ์ฌ์ผ๋ง ๋์ผ ์ผ๊ตด๋ก ํ๋จํ๋ค.
ํ๋ก์ ํธ์์๋ 0.45~0.6 ์ ๋๊ฐ ์ ๋นํ๋๋ฐ, ์ ๋ง๋ค ๋ค๋ฅด๋ค.
0.6์ ์ข ์ข ์ฌํ๊ฒ ๋ค๋ฅธ ์ธ๋ฌผ์ ๋์ผ ์ธ๋ฌผ๋ก ๊ฐ์ฃผํ๋ค.


Last updated
Was this helpful?