mirror of
https://github.com/jlengrand/Ivolution.git
synced 2026-03-10 08:21:18 +00:00
Adds running options. Facemovie should not be ran directly any more
This commit is contained in:
24
facemovie.py
24
facemovie.py
@@ -180,26 +180,4 @@ class FaceMovie(object):
|
||||
"""
|
||||
Simply returns the number of guys in the current to-be movie
|
||||
"""
|
||||
return len(self.guys)
|
||||
|
||||
if __name__ == "__main__":
|
||||
# quick and dirty tests
|
||||
root_fo = "C:\Users\jll\perso\workspace\FaceMovie"
|
||||
in_fo = os.path.join(root_fo, "input\Axel")
|
||||
out_fo = os.path.join(root_fo, "output")
|
||||
par_fo = os.path.join(root_fo, "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 !"
|
||||
return len(self.guys)
|
||||
40
main_file.py
40
main_file.py
@@ -3,27 +3,39 @@ Created on 29 mars 2012
|
||||
|
||||
@author: jll
|
||||
'''
|
||||
import cv
|
||||
import os
|
||||
|
||||
import facemovie
|
||||
|
||||
import sys
|
||||
if __name__ == '__main__':
|
||||
# Main test file to test current application
|
||||
root_fo = "C:\Users\jll\perso\FaceMovie"
|
||||
#in_fo = os.path.join(root_fo, "input\Axel_tsts")
|
||||
in_fo = os.path.join(root_fo, "input\Axel")
|
||||
out_fo = os.path.join(root_fo, "output")
|
||||
par_fo = os.path.join(root_fo, "haarcascades")
|
||||
print sys.argv
|
||||
#We need input_folder, output_folder, param_folder for now
|
||||
if len(sys.argv) == 1:
|
||||
print "Setting up the parameters!"
|
||||
in_fo = raw_input("indicate input folder:")
|
||||
out_fo = raw_input("indicate output folder:")
|
||||
par_fo = raw_input("indicate parameters folder:")
|
||||
elif len(sys.argv) == 2:
|
||||
print "I trust your inputs!"
|
||||
[in_fo, out_fo, par_fo] = sys.argv[1, :]
|
||||
else :
|
||||
print "Chosen automatic way!"
|
||||
root_fo = "C:\Users\jll\perso\workspace\FaceMovie"
|
||||
in_fo = os.path.join(root_fo, "input\Axel")
|
||||
out_fo = os.path.join(root_fo, "output")
|
||||
par_fo = os.path.join(root_fo, "haarcascades")
|
||||
|
||||
my_movie = FaceMovie(in_fo, out_fo, par_fo)
|
||||
my_movie.list_guys()
|
||||
my_movie.search_faces()
|
||||
my_movie = facemovie.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()
|
||||
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", debug=False)
|
||||
my_movie.save_movie("output", debug=False)
|
||||
#my_movie.save_faces("output")
|
||||
my_movie.save_movie("output")
|
||||
|
||||
print "Facemovie finished !"
|
||||
Reference in New Issue
Block a user