162 Commits

Author SHA1 Message Date
nine
784144aa29
Fixes deleting an image (cf. #822) (#861)
Co-authored-by: Erwin Nindl <erwin@nindl.net>
2022-03-27 10:04:09 -07:00
PTA00
0bc7a462d9
[tested]Fixed open file dialog cancel error. (#856)
* 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.

* Fixed an error after opening a file to cancel

The cause of the error:
QFileDialog.getOpenFileName(...) second parameter required cannot be empty.
2022-03-08 21:53:45 -08:00
PTA00
9e4a4b711e
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.
2022-03-07 22:56:10 -08:00
tzutalin
d685e50269 fix missing imports 2022-02-22 22:23:10 -08:00
Paul Anton Letnes
ca3a3accdd
remove unused import statements (#845)
To reduce clutter, all unused imports were removed. On the affected
files, imports were also reordered to be PEP8 sorted.
2022-02-17 11:18:21 -08:00
Aditya Kumar
276f40f5e5
Modified the default label text box into a drop down (#824)
* Modified the default label text box into a drop down

* Unchecked the box at startup

* Removed commented code

* Removed unnecessary update method for the combobox

* Changed naming style for class
2022-01-26 08:18:13 -08:00
Paul Anton Letnes
c35efbd480
convert floating point values of zoom level to int (#840)
In some cases, arithmetic results (in particular from division) on zoom
levels return floats; however, the PyQt API requires int values to
function correctly. Therefore, explicit conversion to int or integer
division has been added for these cases.

A behavior bug causing sudden crashes was fixed. When a rectangular box
is dragged with the right mouse button, but the left mouse button is
touched prior to release of the right mouse button, the  program
crashed. The root cause seems to be that this deselects the dragged
object so it is no longer available (i.e. `self.canvas.selected_shape is
None`). The new behavior does nothing / cancels the operation if this
occurs.

Added a shortcut for switching file format (CTRL+Y) since I often use
this functionality.
2022-01-26 08:17:27 -08:00
Sam.An
98e88371ad
Fix opening next image error (#835)
* Fix draw annotations error

* Fix opening next image
2021-12-28 09:10:38 -08:00
Sam.An
5c38b6bcdd
Fix draw annotations error (#833) 2021-12-27 19:05:21 -08:00
HLiang
39ecb789a7
correct initial img_count (#817)
fixes issue https://github.com/tzutalin/labelImg/issues/816
2021-11-19 21:43:57 -08:00
Naelson Douglas C. Oliveira
e9dbbd80bc
removed a default mutable argument pitfall (#809) 2021-10-31 08:21:18 -07:00
Keito Tobichi
250de4bef8
Add Locale: Japanese (#756)
* [wip]japanese translation file.

* [wip]fixed japanese translation.

* create README.jp.rst

* add locale ja-JP.

* Removed Locale Data.
2021-06-27 14:42:27 -07:00
tzutalin
ff681f7054 Remove unused code and add short cut link 2021-05-11 09:39:28 -07:00
WEN Hao
91c23d0a9d
Use webbrowser instead of get_available_screencast_viewer (#745)
* improve opening tutorial

* improve show_tutorial_dialog

* improve show_tutorial_dialog

* remove not implemented

* remove unncessary package QtWebEngineWidgets

* remove commented import of QtWebEngineWidgets
2021-05-11 09:20:54 -07:00
Denis
4bf5c4528c
Fix deletion of image caused selection of the first image (#742)
Also removed the call to self.import_dir_images method that reloaded all
of the images in directory.
2021-04-28 07:22:14 -07:00
Denis
6b5c3c634b
Implement image counter. (#734)
* Introduced two new attributes of MainWindow:
  cur_img_idx - Index of current image in m_img_list.
  img_count   - Length of m_img_list.

* Implement counter_str method to get string representation of counter.

* Appended counter to window title.

* Based image switching logic on counter instead of local variables.

* Removed useless condition.
  current_index = self.m_img_list.index(ustr(item.text()))
  if current_index < len(self.m_img_list):
  list.index will raise ValueError if item doesn't exist.
2021-04-26 22:18:56 -07:00
tzutalin
ec23bb42ce Update unit test to fix error and fix icon issue 2021-04-10 08:34:55 -07:00
Denis
62585531ca
Fix incorrect path handling (#731)
* Fix incorrect save dir path handling for ML format.

Save dir path was split by incorrect os.dependent separator '/'
which was the cause of labels being saved to parent folder.

* Implement path normalization for command arguments.

Renamed 'predefined_classes_file' parameter to 'class_file'.
2021-04-07 22:01:55 -07:00
Cerno_b
c35f09747a
Pep 8 (#720)
* rename local variables in main file

* additional renaming of functions and variables

* Rename main file functions

* Rename functions and variables in canvas.py

* Rename functions and locals for remaining files

* Rename non-Qt derived class' members

* Rename members of Qt-derived classes

* Fix paint label issue
2021-03-14 16:56:14 -07:00
LiXiaolin
eb4857f834
Translate texts on menu bar (#695) 2021-01-09 09:30:04 -08:00
chenghsiung
5d6557f994
Adaptively adjust label size (#678)
* Adjust label font size based on image size

* Adjust the upper boundary of the painted label

* Set font size based on both image width & height
2021-01-01 11:54:27 -08:00
tzutalin
e1c67fc0c3 Bump to 1.8.4 2020-11-14 23:17:25 -08:00
tzutalin
a86093ca60 Updated README 2020-11-14 22:51:44 -08:00
tzutalin
e13d154ad8 Fixed Autosave did not work as it does not use a proper file path separator 2020-11-14 09:05:33 -08:00
enicck
31463497c8
Adds create-ml format support (#651)
* adds createMl reader & writer class

* adds getFormatMeta function to support more than two save_format

* adds CreateML read & write support

* adds format CreateML icon

* fixes negative height/width

* removes type hints

* fixes coordinate calculation

* adds unit test

* removes typehint
2020-10-02 06:56:07 -07:00
tzutalin
949e46cec4 change delete image hotkey 2020-09-26 11:15:30 -07:00
EuihyunLee
058d7a7e80
Read via QImageReader (#650)
* Now read via QImageReader

* Remove comment-out unused lines
2020-09-26 11:03:04 -07:00
tzutalin
08db03a36d rename functions 2020-09-12 10:59:57 -07:00
Crystal Silva Campos
12dadc67cd
Add ctrl+v hotkey to be able copy the bounding boxes from the previous image to the current (#627)
* Add previous bounding boxes code

* Create method to avoid repeated code

* Fix text in the action copyprevbounding

* Add description for different languages
2020-09-12 10:49:21 -07:00
Chris Rapson (AT)
39b0d68f09 Improve MessageBox when clicking Next/Prev without saving image 2020-09-12 00:15:20 -07:00
tzutalin
0e905160fe Changing format enables save button 2020-08-02 00:18:34 -07:00
tzutalin
f387c5932b use enum for label file formats 2020-08-02 00:14:18 -07:00
Laszlo Treszkai
196bd46828 Save used labeling format in settings 2020-08-01 23:44:36 -07:00
Laszlo Treszkai
b21b48e640 Parse command-line arguments using argparse 2020-08-01 23:44:36 -07:00
tzutalin
60ae6067ea Update zh translation and format code a little bit 2020-07-01 18:18:19 -07:00
Kirill Kalashnikov
9fca0b5e92 added delete image button 2020-07-01 17:16:18 -07:00
Hakan Karaoguz
e51bfce9a7 Added combobox to the main view for displaying unique labels individually 2020-01-10 08:51:12 -08:00
Eetu Silvennoinen
731735f187 Update labelImg.py
Fixed a comment typo.
2019-10-28 18:23:14 -07:00
Eduard Tamsa
157a4173f3 Add Silent option for openDirDialog
Add Silent option for openDirDialog to facilitate opening a directory at start up
    if the filePath provided is a directory without opening the file selector UI.
2019-10-04 20:30:42 -07:00
tzutalin
5b9d2bf9b6 Update setup.py 2019-05-25 14:29:16 -07:00
xdzhou
551fc7e00d Fix bug: An index error after select a directory when open a new file. 2019-05-22 15:02:20 -07:00
tzutalin
ca28daddec Rename lib.py to utils.py and add test cases for natural sort 2019-01-26 23:16:21 -08:00
Lieven Govaerts
054f63f6f9 Show the file list in natural sorted order ( f1->f8->f9->f10 instead of f1->f10->f8->f9 ).
* labelImg.py
  (natural_sort): New function, copied from S.O.:
  https://stackoverflow.com/questions/4836710/does-python-have-a-built-in-function-for-string-natural-sort?answertab=votes#tab-top
  (scanAllImages): Return the image file list in natural sorted order.
2019-01-26 22:21:14 -08:00
Lieven Govaerts
ba12d85798 Avoid crash on "Edit Label" when there's no bounding boxes left.
The scenario is:
1. Open an image
2. Delete all bounding boxes
3. Select "Edit Label".

* labelImg.py
  (editLabel): Avoid crash zhen there's no currently selected item.
2019-01-26 22:15:03 -08:00
Lieven Govaerts
4bb6be6986 Ensure a vertex always stays within the boundaries of the canvas. 2019-01-03 22:48:13 -08:00
Lieven Govaerts
40b30f1cee labelImg.py/loadLabels: correct shapes that are out of image bounds. 2018-12-28 09:28:14 -08:00
tzutalin
6db1dd500d FIx issue#403 2018-12-02 20:27:16 -08:00
tzutalin
eaac031404 Move icons to resource folder, fix the unicode issue, support zh-tw lang 2018-12-01 00:45:50 -08:00
Maxim Smirnov
13a700ad53 Fix program start when re-started without the second monitor.
When labelImg was closed on the second monitor, and later opened when it is disabled, it is impossible to see the app window.
2018-11-26 21:58:19 -08:00
Antoine Broyelle
4e278bb511 feature: draw square bounding boxes 2018-10-19 23:32:18 -07:00