Skip to content

Commit

Permalink
Update remote images extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max committed Feb 13, 2020
1 parent dfcb227 commit 1f69e56
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
SchemaBuilder as _SchemaBuilder,
)
import datumaro.components.extractor as datumaro
from datumaro.util.image import lazy_image, load_image
from datumaro.util.image import lazy_image, load_image, Image

from cvat.utils.cli.core import CLI as CVAT_CLI, CVAT_API_V1

Expand Down Expand Up @@ -103,8 +103,11 @@ def __init__(self, url):
items = []
for entry in image_list:
item_id = entry['id']
item = datumaro.DatasetItem(
id=item_id, image=self._make_image_loader(item_id))
size = None
if entry.get('height') and entry.get('width'):
size = (entry['height'], entry['width'])
image = Image(data=self._make_image_loader(item_id), size=size)
item = datumaro.DatasetItem(id=item_id, image=image)
items.append((item.id, item))

items = sorted(items, key=lambda e: int(e[0]))
Expand Down

0 comments on commit 1f69e56

Please sign in to comment.