Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 0ff041db authored by ariandyy's avatar ariandyy
Browse files

Update classify.py

Added some more verbose information, useful when loading a lot of files
parent 30651a2a
......@@ -104,15 +104,20 @@ def main(argv):
if args.gpu:
print 'GPU mode'
else:
print 'CPU mode'
# Load numpy array (.npy), directory glob (*.jpg), or image file.
args.input_file = os.path.expanduser(args.input_file)
if args.input_file.endswith('npy'):
print "Loading file: %s" %s args.input_file
inputs = np.load(args.input_file)
elif os.path.isdir(args.input_file):
print "Loading folder: %s" % args.input_file
inputs =[caffe.io.load_image(im_f)
for im_f in glob.glob(args.input_file + '/*.' + args.ext)]
else:
print "Loading file: %s" % args.input_file
inputs = [caffe.io.load_image(args.input_file)]
print "Classifying %d inputs." % len(inputs)
......@@ -123,6 +128,7 @@ def main(argv):
print "Done in %.2f s." % (time.time() - start)
# Save
print "Saving results into %s" % args.output_file
np.save(args.output_file, predictions)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment