Uploads new video.

Updates README accordingly

Adds choice of frame per second in output video feature.

TODO :
Big work on documentation
This commit is contained in:
2012-05-26 20:34:39 +02:00
parent d5defe4bcf
commit 5e3a496f81
5 changed files with 24 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
#Take one picture of yourself a day, simply get the results!
#Take one picture of yourself a day, automatically generate a movie!
**[FaceMovie](http://www.youtube.com/watch?v=JueOY7EtXrQ)** is a simple project that aims at helping you create videos of yourself over time, using photos as input.
@@ -8,7 +8,7 @@ I started this project for a friend currently [travelling around the world](http
The main idea is simple. The software takes a batch of images as input. The images are assumed to be named by date (so that an alphabetical order is also the chronological order).
The output is a video containing each image, where the face is always placed in the same position. This way, people can actually see the face change over time.
**[You can check out the last results in video here !](http://www.youtube.com/watch?v=JueOY7EtXrQ)**
**[You can check out the last results in video here !](http://www.youtube.com/watch?v=2pUHK7Sf23I)**
**In progress: **

View File

@@ -233,7 +233,7 @@ class FaceMovie(object):
return out_im
def show_faces(self, mytime=1000, equalize=True):
def show_faces(self, mytime=1000):
"""
Show all faces that have been found for the guys.
The time for which each image will be displayed can be chosen.
@@ -264,7 +264,7 @@ class FaceMovie(object):
out_im = self.crop_im(out_im)
self.save_result(out_im, a_guy.name, out_folder, im_format)
def save_movie(self, out_folder, equalize=True):
def save_movie(self, out_folder, fps=3):
"""
Creates a movie with all faces found in the inputs.
Guy is skipped if no face is found.
@@ -275,7 +275,6 @@ class FaceMovie(object):
"""
filename = os.path.join(out_folder, "output.avi")
fourcc = cv.CV_FOURCC('C', 'V', 'I', 'D')
fps = 3 # not taken into account
if self.crop:
width = self.width

View File

@@ -86,6 +86,13 @@ class Facemoviefier():
choices='ne',
help='Choose which way images are sorted. Can be either using file name (n) or exif metadata (e). Default is n' ,
default='n')
# Number of frames per second in saved image
parser.add_argument('--fps',
choices=range(2, 20),
type=int,
help='Choose the number of frames per second in the output video (between 2 and 20). Default is 3' ,
default=3)
args = vars(parser.parse_args())
return args
@@ -120,7 +127,6 @@ class Facemoviefier():
if self.args['crop']:
if self.args['cropdims']:
self.facemovie.set_crop_dims(float(self.args['cropdims'][0]), float(self.args['cropdims'][1]))
# TODO : do we need something else than pixel here ? It stinks due to face normalization. Change to number of face size
self.facemovie.find_crop_dims() # finds output minimal size to get all eyes in the same place
#choose your final step
@@ -129,7 +135,7 @@ class Facemoviefier():
elif self.args['type'] == 'i':
self.facemovie.save_faces(self.args['output'])
elif self.args['type'] == 'v':
self.facemovie.save_movie(self.args['output'])
self.facemovie.save_movie(self.args['output'], self.args['fps'])
if __name__ == '__main__':
my_job = Facemoviefier()

11
run_windows.sh Normal file
View File

@@ -0,0 +1,11 @@
#! /bin/sh
## Used through bash using git bash
echo "Running FaceMovie from Script !"
ROOT="./dist"
IN_DATA="data/input/sample"
OUT_DATA="data/output"
${ROOT}/Facemoviefier.exe -r $ROOT -i $IN_DATA -o $OUT_DATA

View File

@@ -55,7 +55,6 @@ setup(
url = "https://github.com/jlengrand/FaceMovie",
download_url = "https://github.com/jlengrand/FaceMovie", # FIXME : To be updated
packages=['facemovie', 'facemovie.lib', 'facemovie.haarcascades'],
#package_data={'facemovie': ['haarcascades/*.xml']}, # Adds xml files to the lib
long_description=read('README.markdown'),
classifiers=[
"Development Status :: 3 - Alpha",
@@ -67,9 +66,8 @@ setup(
"Operating System :: Microsoft",
"Programming Language :: Python :: 2 :: Only",
],
platforms ={"Linux"},
data_files = haar_files,
options = {'py2exe': {'bundle_files': 1, # do not include Python together with the executable
options = {'py2exe': {'bundle_files': 1, # 3 dont bundle, 2 bundle but python interpreter, 1 bundle everything
'includes': ['numpy'] } },
console=['facemovie/Facemoviefier.py'],
zipfile = None,