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

Feature requests: Don't Export un-annotated frames option #1251

Closed
AhmadM-DL opened this issue Mar 12, 2020 · 6 comments
Closed

Feature requests: Don't Export un-annotated frames option #1251

AhmadM-DL opened this issue Mar 12, 2020 · 6 comments

Comments

@AhmadM-DL
Copy link

Hello,

First, I want to thank the entire CVAT team for the useful software they are building. AND for opening it for the public as open source.

I have a feature in mind that I want to request.

During building an annotated Dataset.
Sometimes, the uploaded videos contains so much frames with some having significant redundancy.
For example 30 or 40 frames with no significant changes. Those frames won't add any value for the model to be trained.

Hence, I personally leave many frames unannotated. I only annotate valuable frames.

The problem is that when I export the data set ALL the frames are exported including empty ones.

It takes me some time to clean out and remove un-annotated frames.

While outputting un-annotated frames might be useful sometimes - works as negative samples for an object detection model. Other times a dataset developer would be interested in not outputting/exporting them.

Therefore, It would be great if there is a setting/configuration in which one can choose whether to export empty frames or not.

Thank you.

@AhmadM-DL AhmadM-DL changed the title Feature requests: Don't Exported un-annotated frames option Feature requests: Don't Export un-annotated frames option Mar 12, 2020
@zhiltsov-max
Copy link
Contributor

zhiltsov-max commented Mar 12, 2020

@AhmadM-DL, thanks for the suggestion. While this is not supported in UI, you can do this with command-line tool Datumaro. You would need to:

  • export the task as Datumaro dataset in UI, extract the archive, go to the unpack directory
  • install Datumaro as described in README (pip install datumaro[default])
  • do datum project export -e '/item/annotation' --filter-mode 'i+a' -f <your_target_format> -- --save-images.

@AhmadM-DL
Copy link
Author

@zhiltsov-max , Thanks for pointing this out!
I will check datumaro.

@AhmadM-DL
Copy link
Author

After applying the steps, I am getting the following error.

2020-03-14 16:09:39,387 INFO: Loading the project...
2020-03-14 16:09:39,388 ERROR: 'cvat_rest_api_task_images'
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Program Files\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\*\*\.venv\Scripts\datum.exe\__main__.py", line 7, in <module>
  File "c:\users\*\*\.venv\lib\site-packages\datumaro\cli\__main__.py", line 156, in main
    return args.command(args)
  File "c:\users\*\*\.venv\lib\site-packages\datumaro\cli\contexts\project\__init__.py", line 347, in export_command
    dataset = project.make_dataset()
  File "c:\users\*\*\.venv\lib\site-packages\datumaro\components\project.py", line 762, in make_dataset
    return ProjectDataset(self)
  File "c:\users\*\*\.venv\lib\site-packages\datumaro\components\project.py", line 473, in __init__
    url, **options)
  File "c:\users\*\*\.venv\lib\site-packages\datumaro\components\project.py", line 274, in make_extractor
    return self.extractors.get(name)(*args, **kwargs)
  File "c:\users\*\*\.venv\lib\site-packages\datumaro\components\project.py", line 64, in get
    return self.items[key] # returns a class / ctor
KeyError: 'cvat_rest_api_task_images'

I tried to figure out the problem with no results.

@AhmadM-DL
Copy link
Author

Moved to #1263

@vinimadu
Copy link

Any news about this option in cvat UI? It will be very useful.

@ariyapour
Copy link

Hello,

First, I want to thank the entire CVAT team for the useful software they are building. AND for opening it for the public as open source.

I have a feature in mind that I want to request.

During building an annotated Dataset. Sometimes, the uploaded videos contains so much frames with some having significant redundancy. For example 30 or 40 frames with no significant changes. Those frames won't add any value for the model to be trained.

Hence, I personally leave many frames unannotated. I only annotate valuable frames.

The problem is that when I export the data set ALL the frames are exported including empty ones.

It takes me some time to clean out and remove un-annotated frames.

While outputting un-annotated frames might be useful sometimes - works as negative samples for an object detection model. Other times a dataset developer would be interested in not outputting/exporting them.

Therefore, It would be great if there is a setting/configuration in which one can choose whether to export empty frames or not.

Thank you.

Best approach in my opinion is to extract the frames manually. You can write a script to load the videos and play them. While the video is playing you can press a certain key(Like "s" or "space") to save the current frame as an image on the disk. Like this you could choose only the frames that seem reasonable to you. I had similar situation. I tried to take frames from videos each 3 seconds (or any duration) and it did not work as good as myself looking at videos and saving the good frames. Maybe CVAT could provide such a functionality too.

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

No branches or pull requests

4 participants