Skip to content

Commit 9d5a748

Browse files
committed
Fix linter
1 parent 807b757 commit 9d5a748

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

labelbox/exporters/voc_exporter.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import json
66
import logging
77
import os
8+
from typing import Any, Sequence
9+
10+
from PIL import Image
811
import requests
912
from shapely import wkt
10-
from typing import Any, Sequence
1113

1214
from labelbox.exceptions import UnknownFormatError
1315
from labelbox.exporters.pascal_voc_writer import Writer as PascalWriter
14-
from PIL import Image
1516

1617

1718
def from_json(labeled_data, annotations_output_dir, images_output_dir,
@@ -61,7 +62,7 @@ def from_json(labeled_data, annotations_output_dir, images_output_dir,
6162
continue
6263

6364

64-
def write_label(
65+
def write_label( # pylint: disable-msg=too-many-arguments
6566
label_id: str, image_url: str, labels: Sequence[Any], label_format: str,
6667
images_output_dir: str, annotations_output_dir: str):
6768
"""Writes a single Pascal VOC formatted image and label pair to disk.
@@ -80,8 +81,9 @@ def write_label(
8081
response = requests.get(image_url, stream=True)
8182
response.raw.decode_content = True
8283
image = Image.open(response.raw)
83-
image_name = ('{img_id}.{ext}'.format(img_id=label_id, ext=image.format.lower()))
84-
image_fqn = os.path.join(images_output_dir, image_name)
84+
image_fqn = os.path.join(
85+
images_output_dir,
86+
'{img_id}.{ext}'.format(img_id=label_id, ext=image.format.lower()))
8587
image.save(image_fqn, format=image.format)
8688

8789
# generate image annotation in Pascal VOC

0 commit comments

Comments
 (0)