diff --git a/README.markdown b/README.markdown index d865244..2482bb0 100644 --- a/README.markdown +++ b/README.markdown @@ -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: ** diff --git a/facemovie/Facemovie.py b/facemovie/Facemovie.py index 2db4ef6..6c596e3 100644 --- a/facemovie/Facemovie.py +++ b/facemovie/Facemovie.py @@ -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 diff --git a/facemovie/Facemoviefier.py b/facemovie/Facemoviefier.py index d9c5a63..213a06a 100644 --- a/facemovie/Facemoviefier.py +++ b/facemovie/Facemoviefier.py @@ -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() diff --git a/run_windows.sh b/run_windows.sh new file mode 100644 index 0000000..a0e232f --- /dev/null +++ b/run_windows.sh @@ -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 diff --git a/setup.py b/setup.py index 6c388c4..7c4a538 100644 --- a/setup.py +++ b/setup.py @@ -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,