larroy commented on a change in pull request #9808: [MXNET-267] Ssd camera demo
URL: https://github.com/apache/incubator-mxnet/pull/9808#discussion_r179960162
 
 

 ##########
 File path: example/ssd/demo.py
 ##########
 @@ -156,3 +209,22 @@ def parse_data_shape(data_shape_str):
     # run detection
     detector.detect_and_visualize(image_list, args.dir, args.extension,
                                   class_names, args.thresh, args.show_timer)
+
+def main():
+    logging.getLogger().setLevel(logging.INFO)
+    logging.basicConfig(format='%(asctime)-15s %(message)s')
+    args = parse_args()
+    if args.cpu:
+        ctx = mx.cpu()
+    else:
+        ctx = mx.gpu(args.gpu_id)
+
+    if args.camera:
+        run_camera(args, ctx)
+    else:
+        run_images(args, ctx)
+    return 0
+
+if __name__ == '__main__':
+    sys.exit(main())
 
 Review comment:
   to return the error code to the OS. Is there another way? I always do it 
like this.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to