Problems found while packaging as binaries.Has been tested. (#855)
* Fix Error "IndexError: list index out of range" occurs when there is no "predefined_classes.txt". * Fix an error when default label is null. Error "IndexError: list index out of range" occurs when there is no "/data/predefined_classes.txt". * Update README.rst ADD: Package as a separate exe file method.
This commit is contained in:
parent
0f111e643a
commit
9e4a4b711e
@ -119,6 +119,15 @@ Open cmd and go to the `labelImg <#labelimg>`__ directory
|
||||
python labelImg.py
|
||||
python labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]
|
||||
|
||||
If you want to package it into a separate EXE file
|
||||
|
||||
.. code:: shell
|
||||
|
||||
Install pyinstaller and execute:
|
||||
|
||||
pip install pyinstaller
|
||||
pyinstaller --hidden-import=pyqt5 --hidden-import=lxml -F -n "labelImg" -c labelImg.py -p ./libs -p ./
|
||||
|
||||
Windows + Anaconda
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -109,7 +109,10 @@ class MainWindow(QMainWindow, WindowMixin):
|
||||
# Load predefined classes to the list
|
||||
self.load_predefined_classes(default_prefdef_class_file)
|
||||
|
||||
if self.label_hist:
|
||||
self.default_label = self.label_hist[0]
|
||||
else:
|
||||
print("Not find:/data/predefined_classes.txt (optional)")
|
||||
|
||||
# Main widgets and related state.
|
||||
self.label_dialog = LabelDialog(parent=self, list_item=self.label_hist)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user