From 6859657c361a98cccdce680c2988e6098f03aaed Mon Sep 17 00:00:00 2001 From: Jiye Qian Date: Sat, 5 Aug 2017 15:35:07 +0800 Subject: [PATCH] Enhance compatibility Adding the path to 'data' folder, this is especailly useful for Mac OSX. Then we can put the 'data' folder into 'MacOS' folder within 'labelImg.app'. --- labelImg.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/labelImg.py b/labelImg.py index 59e90837..6303a319 100755 --- a/labelImg.py +++ b/labelImg.py @@ -1372,7 +1372,9 @@ def get_main_app(argv=[]): # Tzutalin 201705+: Accept extra agruments to change predefined class file # Usage : labelImg.py image predefClassFile win = MainWindow(argv[1] if len(argv) >= 2 else None, - argv[2] if len(argv) >= 3 else os.path.join('data', 'predefined_classes.txt')) + argv[2] if len(argv) >= 3 else os.path.join( + os.path.dirname(sys.argv[0]), + 'data', 'predefined_classes.txt')) win.show() return app, win