Skip to content

Commit 334a970

Browse files
committed
Translate Export form
1 parent 9606b1a commit 334a970

12 files changed

Lines changed: 24791 additions & 23420 deletions

File tree

anylabeling/resources/resources.py

Lines changed: 23318 additions & 22783 deletions
Large diffs are not rendered by default.

anylabeling/resources/translations/en_US.ts

Lines changed: 454 additions & 200 deletions
Large diffs are not rendered by default.
4.72 KB
Binary file not shown.

anylabeling/resources/translations/vi_VN.ts

Lines changed: 466 additions & 186 deletions
Large diffs are not rendered by default.
3.65 KB
Binary file not shown.

anylabeling/resources/translations/zh_CN.ts

Lines changed: 468 additions & 188 deletions
Large diffs are not rendered by default.

anylabeling/services/auto_labeling/lru_cache.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Thread-safe LRU cache implementation."""
2+
23
from collections import OrderedDict
34
import threading
45

anylabeling/views/labeling/label_widget.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,7 @@ def __init__(
868868
)
869869
utils.add_actions(
870870
self.menus.tools,
871-
(
872-
export_annotations,
873-
),
871+
(export_annotations,),
874872
)
875873
utils.add_actions(
876874
self.menus.language,

anylabeling/views/labeling/utils/export_worker.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ def _export_yolo(self, json_files_by_split):
289289
output_img_name = osp.basename(image_path)
290290
if self.use_random_names:
291291
# Extract base_name from the output_path
292-
random_base = osp.splitext(osp.basename(output_path))[0]
292+
random_base = osp.splitext(osp.basename(output_path))[
293+
0
294+
]
293295
output_img_name = random_base + img_ext
294296

295297
if self.split_data:
@@ -301,7 +303,9 @@ def _export_yolo(self, json_files_by_split):
301303
)
302304
else:
303305
image_output_path = osp.join(
304-
self.output_dir, "images", output_img_name,
306+
self.output_dir,
307+
"images",
308+
output_img_name,
305309
)
306310
shutil.copy2(image_path, image_output_path)
307311

@@ -360,17 +364,17 @@ def _export_pascal_voc(self, json_files_by_split):
360364

361365
# Get file name and extension for the image
362366
img_name, img_ext = osp.splitext(osp.basename(image_path))
363-
367+
364368
# Generate a random name if requested
365369
output_img_name = osp.basename(image_path)
366370
if self.use_random_names:
367371
# Extract base_name from the output_path
368-
random_base = osp.splitext(osp.basename(output_path))[0]
372+
random_base = osp.splitext(osp.basename(output_path))[
373+
0
374+
]
369375
output_img_name = random_base + img_ext
370376

371-
image_output_path = osp.join(
372-
split_dir, output_img_name
373-
)
377+
image_output_path = osp.join(split_dir, output_img_name)
374378
shutil.copy2(image_path, image_output_path)
375379

376380
def _export_coco(self, json_files_by_split):
@@ -432,7 +436,7 @@ def _export_coco(self, json_files_by_split):
432436

433437
# Get file name and extension for the image
434438
img_name, img_ext = osp.splitext(osp.basename(image_path))
435-
439+
436440
# Generate a random name if requested
437441
output_img_name = osp.basename(image_path)
438442
if self.use_random_names:
@@ -441,9 +445,7 @@ def _export_coco(self, json_files_by_split):
441445
# Update the image path in all_image_paths for the export formats
442446
all_image_paths[-1] = output_img_name
443447

444-
image_output_path = osp.join(
445-
split_dir, output_img_name
446-
)
448+
image_output_path = osp.join(split_dir, output_img_name)
447449
shutil.copy2(image_path, image_output_path)
448450

449451
self.signals.progress.emit(
@@ -522,7 +524,7 @@ def _export_createml(self, json_files_by_split):
522524

523525
# Get file name and extension for the image
524526
img_name, img_ext = osp.splitext(osp.basename(image_path))
525-
527+
526528
# Generate a random name if requested
527529
output_img_name = osp.basename(image_path)
528530
if self.use_random_names:
@@ -531,9 +533,7 @@ def _export_createml(self, json_files_by_split):
531533
# Update the image path in all_image_paths for the export formats
532534
all_image_paths[-1] = output_img_name
533535

534-
image_output_path = osp.join(
535-
split_dir, output_img_name
536-
)
536+
image_output_path = osp.join(split_dir, output_img_name)
537537
shutil.copy2(image_path, image_output_path)
538538

539539
self.signals.progress.emit(

anylabeling/views/labeling/widgets/canvas.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""This module defines Canvas widget - the core component for drawing image labels"""
2+
23
import imgviz
34
from time import time
45
from PyQt5 import QtCore, QtGui, QtWidgets

0 commit comments

Comments
 (0)