Skip to content

Commit 8f5ef71

Browse files
committed
pyenchant
1 parent 9ca8a7c commit 8f5ef71

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ load-plugins=pylint_pytest
77
[SPELLING]
88

99
max-spelling-suggestions=50
10-
spelling-dict=
10+
spelling-dict=en_US
1111
spelling-ignore-words=
1212
spelling-private-dict-file=
1313
spelling-store-unknown-words=no

superannotate/dataframe_filtering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def filter_images_by_tags(annotations_df, include=None, exclude=None):
7777
def filter_annotation_instances(annotations_df, include=None, exclude=None):
7878
"""Filter annotation instances from project annotations pandas DataFrame.
7979
80-
include and exclude rulses should be a list of rules of following type:
80+
include and exclude rules should be a list of rules of the following type:
8181
[{"className": "<className>", "type" : "<bbox, polygon,...>",
8282
"error": <True or False>, "attributes" : [{"name" : "<attribute_value>",
8383
"groupName" : "<attribute_group_name>"},...]},...]

superannotate/db/images.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,7 @@ def get_image_metadata(project, image_name):
141141
for image in images:
142142
if image["name"] == image_name:
143143
return image
144-
raise SABaseException(
145-
0, "Image " + image_name + " doesn't exist in the project " +
146-
project["name"]
147-
)
144+
raise SABaseException(0, "Image " + image_name + " doesn't exist.")
148145

149146

150147
def set_image_annotation_status(project, image_name, annotation_status):
@@ -499,28 +496,31 @@ def download_image(
499496
if not isinstance(project, dict):
500497
project = get_project_metadata_bare(project)
501498
img = get_image_bytes(project, image_name, variant=variant)
499+
filepath_save = image_name
502500
if variant == "lores":
503-
image_name += "___lores.jpg"
504-
filepath = Path(local_dir_path) / image_name
505-
with open(filepath, 'wb') as f:
501+
filepath_save += "___lores.jpg"
502+
filepath_save = Path(local_dir_path) / filepath_save
503+
with open(filepath_save, 'wb') as f:
506504
f.write(img.getbuffer())
507505
annotations_filepaths = None
508506
fuse_path = None
509507
if include_annotations:
510508
annotations_filepaths = download_image_annotations(
511509
project, image_name, local_dir_path
512510
)
513-
if include_fuse or include_overlay:
511+
if annotations_filepaths is not None and (
512+
include_fuse or include_overlay
513+
):
514514
classes = search_annotation_classes(project)
515515
fuse_path = create_fuse_image(
516-
filepath,
516+
filepath_save,
517517
classes,
518518
project["type"],
519519
output_overlay=include_overlay
520520
)
521-
logger.info("Downloaded image %s to %s.", image_name, filepath)
521+
logger.info("Downloaded image %s to %s.", image_name, filepath_save)
522522

523-
return (str(filepath), annotations_filepaths, fuse_path)
523+
return (str(filepath_save), annotations_filepaths, fuse_path)
524524

525525

526526
def delete_image(project, image_name):
@@ -789,7 +789,7 @@ def download_image_annotations(project, image_name, local_dir_path):
789789

790790
if annotation["annotation_json_filename"] is None:
791791
image = get_image_metadata(project, image_name)
792-
logger.info("No annotation found for image %s.", image["name"])
792+
logger.warning("No annotation found for image %s.", image["name"])
793793
return None
794794
return_filepaths = []
795795
json_path = Path(local_dir_path) / annotation["annotation_json_filename"]

0 commit comments

Comments
 (0)