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

Get Image Frames same as CVat annotated #818

Closed
hasanahmedfaisal opened this issue Nov 6, 2019 · 14 comments
Closed

Get Image Frames same as CVat annotated #818

hasanahmedfaisal opened this issue Nov 6, 2019 · 14 comments
Assignees
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Milestone

Comments

@hasanahmedfaisal
Copy link

hasanahmedfaisal commented Nov 6, 2019

Hi @nmanovic ,

i have just started using Cvat , it is really amazing tool.Thanks for making it

I was able to upload a video and annotate it and download Cvat XML for videos format in dump annotation, itwas great

But my one doubt is now , How to get the image frames as a cvat frames with same fps , Is there a way to get image frames directly from cvat , same as "MASK ZIP 1.0" option in dump annotation , but instead of mask of image frame, it would be original rgb image frames of video

Or is there a way to find fps and use ffmpeg to extract frames , please please help me with this

Thank you

@nmanovic
Copy link
Contributor

nmanovic commented Nov 6, 2019

@hasanahmedfaisal ,

@zhiltsov-max is working on the feature: #813

For now you can use FFMPEG by yourself. You command can look like ffmpeg -i path/to/your/video -start_number 0 -b:v 10000k -vsync 0 -an -y -q:v 16 images/%d.jpg. FFMPEG version is 3.4.1 (sometime it can be important).

@nmanovic nmanovic added this to the 1.0.0 - Beta milestone Nov 6, 2019
@nmanovic nmanovic added duplicate This issue or pull request already exists enhancement New feature or request labels Nov 6, 2019
@hasanahmedfaisal
Copy link
Author

hasanahmedfaisal commented Nov 7, 2019

Hi @nmanovic ,

Thank you for the help , it works

Few thing i am assuming , please correct me if i am wrong

FPS is not fixed , and i think i need not worry about that , as above command would take frames same way as cvat and names the files with same frame no in xml , even if resolution of video or the length of the videos varies

Can i ask on what does Fps dependent on?

Thank you

@nmanovic
Copy link
Contributor

nmanovic commented Nov 7, 2019

@hasanahmedfaisal , you don't need to care about FPS. Use command above for now. If FFMPEG version is the same and the command is the same you have to get the right sequence of frames as in CVAT.

Internally we annotated a lot of videos. Thus you can be sure that the advice works. In the future we are going to improve UX only (provide you a way to download images together with annotations).

@hasanahmedfaisal
Copy link
Author

Hi @nmanovic , OK

Thank you for the amazing tool and all the help

@myounus96
Copy link

myounus96 commented Nov 14, 2019

@hasanahmedfaisal ,

@zhiltsov-max is working on the feature: #813

For now you can use FFMPEG by yourself. You command can look like ffmpeg -i path/to/your/video -start_number 0 -b:v 10000k -vsync 0 -an -y -q:v 16 images/%d.jpg. FFMPEG version is 3.4.1 (sometime it can be important).

It works,Thank you man.
And for getting file names same as cvat annotations there is need of little changes(the Bold part) in command.
ffmpeg -i path/to/your/video -start_number 0 -b:v 10000k -vsync 0 -an -y -q:v 16 images2/frame_%06d.jpg

@hasanahmedfaisal
Copy link
Author

hasanahmedfaisal commented Nov 15, 2019

Hi @m-younus , @nmanovic , thanks

is there any way instead of images2/frame_%06d.jpg

i can set targetdir = 'Imagedata'
and Videopath = 'path/to/your/video'
, this would be dynamically assigned in each loop

and so that i can write

ffmpeg -i Videopath -start_number 0 -b:v 10000k -vsync 0 -an -y -q:v 16
targetdir/frame_%06d.jpg

Presently i need to set path to the video and directory manually , how can i do it ,

please help me

@nmanovic
Copy link
Contributor

@hasanahmedfaisal , please use gitter channel for such questions. Actually I'm not sure that I can understand your question right.

@nmanovic nmanovic reopened this Nov 15, 2019
@hasanahmedfaisal
Copy link
Author

Thank you , sorry i asked here, i will ask in gitter

@ladykarel
Copy link

hi how can I hide the boxes on the next frame , please help .

@zhiltsov-max
Copy link
Contributor

@ladykarel
Copy link

ladykarel commented Mar 30, 2021 via email

@zhiltsov-max
Copy link
Contributor

@ladykarel, you can also try to use "Occluded" property, but this will only mean partial covering. What is wrong with outside?

@ladykarel
Copy link

ladykarel commented Mar 30, 2021 via email

@AnkushMalaker
Copy link

AnkushMalaker commented Aug 2, 2022

@hasanahmedfaisal ,

@zhiltsov-max is working on the feature: #813

For now you can use FFMPEG by yourself. You command can look like ffmpeg -i path/to/your/video -start_number 0 -b:v 10000k -vsync 0 -an -y -q:v 16 images/%d.jpg. FFMPEG version is 3.4.1 (sometime it can be important).

Is the FFMPEG version to be used in latest version of CVAT still the same?
There's a mismatch in the biggest frame number in the annotations file gotten through CVAT, and the number of frames I get using the command mentioned above. The number of frames through the command is the same I get if I use OpenCV to extract and save frames one by one.
Essentially, the annotations have more frames than I can extract using the ffmpeg. The video is large (>30 mins), so downloading through cvat UI gives me a StopIteration error after a while. Downloading annotations works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants