Added support to export annotations #140
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The backend command supports sparse / dense annotations (as requested in #132) as and writes results in standard BeaverDam JSON format. Dense annotations are created between first and last keyframe using interpolation. Since BeaverDam uses html5 currentTime as timestamping mechanism, the command will need to know the fps of the video files. If not specified via command line, video files will automatically be probed using ffmpeg. This command should support local, remote video files and image lists.
Type
python manage.py export_annotations --help
for usage help.A simple annotation viewer using OpenCV can be found here
https://gist.github.com/cheind/9850e35bb08cfe12500942fb8b55531f
Dense annotations will be stored in a new JSON field ('frames' per default) that follows this structure
Note that BeaverDam uses HTML5
currentTime
to store keyframe times. These times vary between browsers and some browsers might even reduce the resolution of this field on purpose. Seehttps://stackoverflow.com/questions/32318333/html-5-currenttime-accuracy
https://bugs.chromium.org/p/chromium/issues/detail?id=555376
Therefore, the video probed FPS and hence computed frame times might not exactly match up the timestamps stored during browser annotation (except for image-lists where FPS is set to exactly 1).