open source pkg v1
This commit is contained in:
20
pkg/OpenFace/matlab_runners/yt_prep/extract_pts.m
Normal file
20
pkg/OpenFace/matlab_runners/yt_prep/extract_pts.m
Normal file
@@ -0,0 +1,20 @@
|
||||
data_dir = 'E:\datasets\yt_celeb\';
|
||||
|
||||
dirs = dir(data_dir);
|
||||
dirs = dirs(3:end);
|
||||
|
||||
for i=1:numel(dirs)
|
||||
|
||||
|
||||
gt_labels = dir([data_dir dirs(i).name, '/*.pts']);
|
||||
curr = 0;
|
||||
labels = zeros(68, 2, numel(gt_labels));
|
||||
for g=1:numel(gt_labels)
|
||||
curr = curr+1;
|
||||
|
||||
gt_landmarks = dlmread([data_dir dirs(i).name, '/', gt_labels(g).name], ' ', 'A4..B71');
|
||||
|
||||
labels(:,:,curr) = gt_landmarks;
|
||||
end
|
||||
save([data_dir dirs(i).name], 'labels');
|
||||
end
|
||||
36
pkg/OpenFace/matlab_runners/yt_prep/extract_vids.py
Normal file
36
pkg/OpenFace/matlab_runners/yt_prep/extract_vids.py
Normal file
@@ -0,0 +1,36 @@
|
||||
__author__ = 'Tadas'
|
||||
|
||||
import cv2
|
||||
import numpy as np
|
||||
import glob
|
||||
|
||||
# where to find the results.mat:
|
||||
yt_dir = r"C:\Users\Tadas\Dropbox\AAM\test data\ytceleb_annotations_CVPR2014"
|
||||
|
||||
|
||||
vids = ["0035_02_003_adam_sandler",
|
||||
"0042_02_010_adam_sandler",
|
||||
"0292_02_002_angelina_jolie",
|
||||
"0293_02_003_angelina_jolie",
|
||||
"0294_02_004_angelina_jolie",
|
||||
"0502_01_005_bruce_willis",
|
||||
"0504_01_007_bruce_willis",
|
||||
"1198_01_012_julia_roberts",
|
||||
"1786_02_006_sylvester_stallone"]
|
||||
|
||||
for vid in vids:
|
||||
|
||||
img_dir = yt_dir + "/" + vid + "/"
|
||||
yt_imgs = glob.glob(img_dir + '*.png')
|
||||
fourcc = cv2.cv.CV_FOURCC('D','I','V','X')
|
||||
#fourcc = cv2.VideoWriter_fourcc(*'XVID')
|
||||
out = cv2.VideoWriter(yt_dir + "/" + vid + ".avi", -1, 30.0, (320,240))
|
||||
|
||||
for img in yt_imgs:
|
||||
img = cv2.imread(img)
|
||||
cv2.imshow("test", img)
|
||||
|
||||
cv2.waitKey(10)
|
||||
out.write(img)
|
||||
|
||||
out.release()
|
||||
Reference in New Issue
Block a user