From 042bc444687a0b3bae16bc85d04b6cf80a28fec9 Mon Sep 17 00:00:00 2001 From: AirballTest Date: Tue, 22 May 2012 08:06:03 +0200 Subject: [PATCH] Enhances setup.py to prepare shipping to pipy. Creates proper installer for Windows. To be checked on several machines. TODO : remove pictures from source folder, move to GDrive (leave one sample though). Add ant script to ease compilation. Ship application with --- TODO | 2 -- facemovie/FaceParams.py | 2 +- facemovie/Facemovie.py | 4 ++-- facemovie/Facemoviefier.py | 29 +++++++++++++++-------------- facemovie/haarcascades/__init__.py | 0 setup.py | 23 ++++++++++++++++++++++- test/__init__.py | 0 7 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 facemovie/haarcascades/__init__.py create mode 100644 test/__init__.py diff --git a/TODO b/TODO index 46e66b0..e69de29 100644 --- a/TODO +++ b/TODO @@ -1,2 +0,0 @@ -Files in input folder are process randomly. -=> Should insert a sort input method to order chronologically diff --git a/facemovie/FaceParams.py b/facemovie/FaceParams.py index d8d5d39..1285cce 100644 --- a/facemovie/FaceParams.py +++ b/facemovie/FaceParams.py @@ -6,7 +6,7 @@ Created on 30 mars 2012 import cv import os -import training_types +from facemovie import training_types class FaceParams(object): ''' diff --git a/facemovie/Facemovie.py b/facemovie/Facemovie.py index 3c9feff..2db4ef6 100644 --- a/facemovie/Facemovie.py +++ b/facemovie/Facemovie.py @@ -7,9 +7,9 @@ import os import sys import cv -import lib.exif as exif +from facemovie.lib import exif -import Guy +from facemovie import Guy class FaceMovie(object): diff --git a/facemovie/Facemoviefier.py b/facemovie/Facemoviefier.py index 1ff6eb5..0fbd5cb 100644 --- a/facemovie/Facemoviefier.py +++ b/facemovie/Facemoviefier.py @@ -9,9 +9,9 @@ import os import sys import argparse -import Facemovie -import FaceParams -import training_types +from facemovie import Facemovie +from facemovie import FaceParams +from facemovie import training_types class Facemoviefier(): """ @@ -25,7 +25,7 @@ class Facemoviefier(): def init_facemovie(self): # FIXME : par folder should be known (contained somewhere in the installation) - par_fo = os.path.join(self.args['root'], "haarcascades") + par_fo = os.path.join(self.args['root'], "haarcascades") self.face_params = FaceParams.FaceParams(par_fo, self.args['param']) self.facemovie = Facemovie.FaceMovie(self.args['input'], self.args['output'], self.face_params) @@ -35,6 +35,16 @@ class Facemoviefier(): """ parser = argparse.ArgumentParser(description="Creates a movie from a bunch of photos containing a Face.") + # TODO: Integrate face params file choice, with list of possibilities. (ncurses) + # First to check if user asks for information + params = training_types.simple_set.keys() + params.append('?') + parser.add_argument('-p', + '--param', + choices=params, + help='Choose the desired file for training the recognition phaze. Should be chosen depending on the face presentation (profile, whole body, ...)', + default='frontal_face') + # --- Arguments to be processed (for now) --- #input folder parser.add_argument('-i', '--input', help='Input folder of the images', required=True) @@ -76,16 +86,7 @@ class Facemoviefier(): '--sort', 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') - - # TODO: Integrate face params file choice, with list of possibilities. - params = training_types.simple_set.keys() - params.append('?') - parser.add_argument('-p', - '--param', - choices=params, - help='Choose the desired file for training the recognition phaze. Should be chosen depending on the face presentation (profile, whole body, ...)', - default='frontal_facee') + default='n') args = vars(parser.parse_args()) return args diff --git a/facemovie/haarcascades/__init__.py b/facemovie/haarcascades/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py index 792f72a..e70c80f 100644 --- a/setup.py +++ b/setup.py @@ -6,11 +6,32 @@ Created on 19 avr. 2012 # creating executable here from distutils.core import setup import py2exe, sys, os +import facemovie sys.argv.append('py2exe') +# Utility function to read the README file. +def read(fname): + return open(os.path.join(os.path.dirname(__file__), fname)).read() + setup( + name = "Facemovie", + version = "0.4", + author = "Julien Lengrand-Lambert", + author_email = "jlengrand@gmail.com", + description = ("An application aiming at creating a video of faces for people taking 'one picture a day' of themselves"), + license = "BSD", + keywords = "image_processing computer_vision one_picture_a_day photography", + url = "https://github.com/jlengrand/FaceMovie", + packages=['facemovie', 'facemovie.lib', 'facemovie.haarcascades'], + long_description=read('README.markdown'), + classifiers=[ + "Development Status :: 3 - Alpha", + "Topic :: Utilities", + "Environment :: Console", + "License :: OSI Approved :: BSD License", + ], options = {'py2exe': {'bundle_files': 1, 'includes': ['numpy'] } }, - console=['facemovie.py'], + console=['facemovie/Facemoviefier.py'], zipfile = None, ) \ No newline at end of file diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29