diff --git a/classifier.py b/classifier.py index d04bf40..a6848be 100644 --- a/classifier.py +++ b/classifier.py @@ -10,6 +10,8 @@ from sklearn import preprocessing import pickle import os +#Python 2 and 3 +from __future__ import print_function project_root = '/home/laranjeira/projects/peixe-babel/simple-recognition/' features_dir = 'features/' diff --git a/extractFeatures.py b/extractFeatures.py index 2f23351..308db00 100644 --- a/extractFeatures.py +++ b/extractFeatures.py @@ -9,6 +9,8 @@ import caffe import matplotlib.pyplot as plt import os +#Python 2 and 3 +from __future__ import print_function project_root = '/home/laranjeira/projects/peixe-babel/simple-recognition/' features_dir = project_root + 'features/' @@ -80,7 +82,7 @@ def saveNewClass(class_name, label): saveNewClass(str(class_dir), k) image_files = sorted(os.listdir(os.path.join(dataset_root, images_dir, class_dir))) createLabelsFile(len(image_files), str(class_dir), k) - print str(class_dir) # Status feedback on screen + print(str(class_dir)) # Status feedback on screen for image in image_files: features = extractFeatures( str( os.path.abspath(os.path.join(dataset_root, images_dir, class_dir, image)) )) storeFeatures(features, str(class_dir))