[pycaffe] make classify.py print input + output file paths
authorariandyy <ariandyy@gmail.com>
Tue, 4 Nov 2014 15:48:02 +0000 (16:48 +0100)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Sun, 8 Mar 2015 08:16:26 +0000 (00:16 -0800)
...and fix up detector quote convention.

python/classify.py
python/detect.py

index 81d0636..da383e6 100755 (executable)
@@ -103,16 +103,21 @@ def main(argv):
             channel_swap=channel_swap)
 
     if args.gpu:
-        print('GPU mode')
+        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)
 
 
index d395bd9..d2c612b 100755 (executable)
@@ -119,7 +119,7 @@ def main(argv):
 
     # Load input.
     t = time.time()
-    print('Loading input...')
+    print("Loading input...")
     if args.input_file.lower().endswith('txt'):
         with open(args.input_file) as f:
             inputs = [_.strip() for _ in f.readlines()]