Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rest api task extractor, add job export function #1972

Merged
merged 4 commits into from
Aug 5, 2020
Merged

Conversation

zhiltsov-max
Copy link
Contributor

@zhiltsov-max zhiltsov-max commented Jul 31, 2020

Motivation and context

  • Fixed REST API extractor for Datumaro format export
  • Added job annotations export function

How has this been tested?

Manual testing

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

@coveralls
Copy link

coveralls commented Jul 31, 2020

Pull Request Test Coverage Report for Build 6790

  • 3 of 11 (27.27%) changed or added relevant lines in 1 file are covered.
  • 152 unchanged lines in 6 files lost coverage.
  • Overall coverage increased (+0.005%) to 69.066%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cvat/apps/dataset_manager/task.py 3 11 27.27%
Files with Coverage Reduction New Missed Lines %
cvat/apps/engine/urls.py 5 76.67%
cvat/apps/engine/media_extractors.py 6 75.81%
cvat/apps/authentication/views.py 8 64.29%
datumaro/datumaro/plugins/coco_format/converter.py 19 89.76%
datumaro/datumaro/components/extractor.py 33 90.92%
cvat/apps/engine/views.py 81 78.64%
Totals Coverage Status
Change from base Build 6698: 0.005%
Covered Lines: 11143
Relevant Lines: 15631

💛 - Coveralls

@nmanovic
Copy link
Contributor

nmanovic commented Aug 4, 2020

@azhavoro , could you please look at the PR and test it?

@azhavoro
Copy link
Contributor

azhavoro commented Aug 4, 2020

@zhiltsov-max I'm faced with the following error:

datum project export -o /tmp/t1 -f voc -- --save-images
2020-08-04 17:03:37,496 INFO: Loading the project...
2020-08-04 17:03:37,543 INFO: Exporting the project...
2020-08-04 17:03:37,544 ERROR: 'cvat_rest_api_task_images' object has no attribute '_session'
Traceback (most recent call last):
  File "/home/andrey/Downloads/datum/.venv/bin/datum", line 11, in <module>
    load_entry_point('datumaro', 'console_scripts', 'datum')()
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/cli/__main__.py", line 114, in main
    return args.command(args)
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/cli/contexts/project/__init__.py", line 357, in export_command
    **filter_args)
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/components/project.py", line 741, in export_project
    converter(dataset, save_dir)
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/cli/contexts/project/__init__.py", line 345, in converter_proxy
    return converter.convert(extractor, save_dir, **extra_args)
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/components/converter.py", line 37, in convert
    return converter.apply()
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/plugins/voc_format/converter.py", line 109, in apply
    self.save_subsets()
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/plugins/voc_format/converter.py", line 172, in save_subsets
    osp.join(self._images_dir, image_filename))
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/components/converter.py", line 65, in _save_image
    image = item.image.data
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/util/image.py", line 221, in data
    return self._data()
  File "/home/andrey/workspace/intel/cvat_yg_disk/datumaro/datumaro/util/image.py", line 178, in __call__
    image = self.loader(self.path)
  File "/home/andrey/Downloads/datum/.datumaro/plugins/cvat_rest_api_task_images.py", line 33, in <lambda>
    lambda item_id: self._image_loader(item_id, self))
  File "/home/andrey/Downloads/datum/.datumaro/plugins/cvat_rest_api_task_images.py", line 62, in _image_loader
    extractor._download_image(item_id)
  File "/home/andrey/Downloads/datum/.datumaro/plugins/cvat_rest_api_task_images.py", line 39, in _download_image
    self._connect()
  File "/home/andrey/Downloads/datum/.datumaro/plugins/cvat_rest_api_task_images.py", line 45, in _connect
    if self._session is not None:
AttributeError: 'cvat_rest_api_task_images' object has no attribute '_session'

@nmanovic nmanovic merged commit 953e3da into develop Aug 5, 2020
@nmanovic nmanovic deleted the zm/dm-fixes2 branch August 5, 2020 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants