forked from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from kookmin-sw/feature/face-shape
Feature/face shape 얼굴형 검출 전용 디렉토리
- Loading branch information
Showing
25 changed files
with
65 additions
and
44 deletions.
There are no files selected for viewing
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
import controller | ||
from shape_detect import shape_detect | ||
|
||
train_path = "./train" | ||
test_path = "./test" | ||
|
||
shape_detect.run_label(test_path) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from shape_detect.utils import landmark, line, norm, ratio, vector | ||
import cv2 | ||
import pandas as pd | ||
import os | ||
|
||
def get_vector(img_path): | ||
|
||
display_img, pos = landmark.get_landmark(img_path)#사진 랜드마크 처리 | ||
|
||
distances = line.get_line(display_img, pos)#랜드마크간 특징 거리 추출 | ||
|
||
norm_distances = norm.get_norm(distances) #거리정보 정규화 | ||
|
||
vectors = vector.get_vector(pos)#각도 산출을 위한 벡터 추출 | ||
|
||
angles = vector.get_angles(vectors) #각도 추출 | ||
|
||
rations = ratio.get_ratio(distances) #길이 간 비율 정보 | ||
|
||
|
||
# print("norm: ", norm_distances, "\n\n") | ||
# print("angle: ", angles, "\n\n") | ||
# print("ratio: ", rations, "\n\n") | ||
|
||
# cv2.imshow("Face Landmark", display_img) | ||
# cv2.waitKey(0) | ||
|
||
return norm_distances, angles, rations | ||
|
||
def list_files(directory): | ||
file_names = [] | ||
print(directory) | ||
for root, _, files in os.walk(directory): | ||
print(files) | ||
for file in files: | ||
file_names.append(os.path.join(root, file)) | ||
return file_names | ||
|
||
def make_label(data): | ||
row = ["D1","D2","D3","D4","D5","D6","D7","R1","R2","R3","R4","R5","R6","R7","R8","R9","R10","A1","A2","A3"] | ||
df = pd.DataFrame(data, columns = row) | ||
df.to_csv("./test.csv") | ||
print(df) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import shape_detect.controller as controller | ||
|
||
def run_label(path): | ||
data_set_directory = controller.list_files(path) | ||
vectors = [] | ||
for path in data_set_directory: | ||
norm_distances, angles, rations = controller.get_vector(path) | ||
vectors.append(norm_distances + rations + angles) | ||
|
||
controller.make_label(vectors) |
Binary file renamed
BIN
+605 Bytes
utils/__pycache__/angle.cpython-312.pyc → ...t/utils/__pycache__/angle.cpython-312.pyc
Binary file not shown.
Binary file renamed
BIN
+510 Bytes
utils/__pycache__/distance.cpython-312.pyc → ...tils/__pycache__/distance.cpython-312.pyc
Binary file not shown.
Binary file renamed
BIN
+2.48 KB
utils/__pycache__/landmark.cpython-312.pyc → ...tils/__pycache__/landmark.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+393 Bytes
utils/__pycache__/norm.cpython-312.pyc → ...ct/utils/__pycache__/norm.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
,D1,D2,D3,D4,D5,D6,D7,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,A1,A2,A3 | ||
0,0.18925852735638332,0.15909147190070777,0.25902758173236456,0.09989648802183161,0.15701627961111192,0.08964434472955639,0.04606530664804442,0.8406039829377437,0.7306500956022944,0.614187380497132,1.2053433429013027,0.5709238873292749,1.1143646408839778,0.47366079606416667,0.9869559803250108,0.636217392675772,0.5138674033149172,55.00117175299869,68.94829220934821,34.385443504740294 | ||
1,0.19009156487794346,0.15493472929296562,0.2548705679181133,0.09787308040559582,0.16071524941984924,0.09234440866598308,0.049170399419549427,0.815053152897385,0.7458356860530773,0.6078957274609448,1.182784866800985,0.5745839862696814,1.0598701298701299,0.4857890918267563,1.0373093892716154,0.6089844041489442,0.5324675324675324,53.16379875419142,67.65019622075658,35.386029506161094 | ||
2,0.19424137033619607,0.1585515887098682,0.2496037097499231,0.09794875434736318,0.1621714339792273,0.09003477890552913,0.04744836397189296,0.8162606577344702,0.7781990521327014,0.6352132701421801,1.1977533007513312,0.5551827266759063,1.0878990934174222,0.46352009744214373,1.0228307095426397,0.603982785031731,0.5270003941663381,53.124855247662765,64.32924645581284,35.05652754431111 |
Binary file not shown.
Binary file not shown.
Binary file not shown.