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'.
This commit is contained in:
Jiye Qian 2017-08-05 15:35:07 +08:00
parent 6958e69851
commit 6859657c36

View File

@ -1372,7 +1372,9 @@ def get_main_app(argv=[]):
# Tzutalin 201705+: Accept extra agruments to change predefined class file # Tzutalin 201705+: Accept extra agruments to change predefined class file
# Usage : labelImg.py image predefClassFile # Usage : labelImg.py image predefClassFile
win = MainWindow(argv[1] if len(argv) >= 2 else None, 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() win.show()
return app, win return app, win