From 5cfde7dff3473584210b1c14eef0b104d1d6024e Mon Sep 17 00:00:00 2001 From: julien Lengrand-Lambert Date: Tue, 24 Apr 2012 22:40:24 +0200 Subject: [PATCH] Adds context file for nice and robust imports --- test/context.py | 13 +++++++++++++ test/test_script.py | 27 +++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 test/context.py diff --git a/test/context.py b/test/context.py new file mode 100644 index 0000000..e2d1370 --- /dev/null +++ b/test/context.py @@ -0,0 +1,13 @@ +''' +Created on 24 avr. 2012 + +@author: jll +''' + +# Used to import the facemovie package in a painless way + +import os +import sys +sys.path.insert(0, os.path.abspath('..')) + +import facemovie \ No newline at end of file diff --git a/test/test_script.py b/test/test_script.py index ba1354c..80c123d 100644 --- a/test/test_script.py +++ b/test/test_script.py @@ -3,5 +3,28 @@ Created on 16 avr. 2012 @author: jll ''' -my_dict = {'a b c':1, 'b':2, 'c':3} -print my_dict['a b c'] \ No newline at end of file + +import os +from context import facemovie +from facemovie.facemovie import FaceMovie + +if __name__ == '__main__': + root_fo = "C:\Users\jll\perso\workspace\FaceMovie" + in_fo = os.path.join(root_fo, "data/input\Axel") + out_fo = os.path.join(root_fo, "data/output") + par_fo = os.path.join(root_fo, "facemovie/haarcascades") + + my_movie = FaceMovie(in_fo, out_fo, par_fo) + my_movie.list_guys() # find images in input folder + my_movie.search_faces() # search for images with faces + # I want to change images so that all faces have the same size + my_movie.normalize_faces() # sets all faces to the same size + # I want to know the size of the output frame, knowing initial conditions + my_movie.find_out_dims() # finds output minimal size to get all eyes in the same place + + #choose your final step + #my_movie.show_faces(1000) + #my_movie.save_faces("output") + my_movie.save_movie("output") + + print "Facemovie finished !" \ No newline at end of file