-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Adding Video tests. #618
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
Comments
This is a very good idea, but I would like to precise a little bit the terminlogy you used. This is where your idea is excellent, it would be to change how graphical unit tests are implemented and to make them compare not only the last frame but a number n. |
Ohh, that is a great idea!
|
Why not, but I think that the main difficulty will be to know how to implement these tests, not how to create the control data :) |
This could be done very elegantly by writing some new renderers, like a SaveFrameDataRenderer and CompareFrameDataRenderer. Since |
I had the same idea in the past. Great minds or whatever. However, do you think this is a task for the renderer or a task for the FileWriter? |
@leotrs My opinion lends toward SaveFrameDataRender, as we don't want to write anything. By the way, I think if someone is going to implement this, it's the occasion to refactor a little bit these graphical units tests. |
Ah fair. |
@leotrs The FileWriter is held by the CairoRenderer so that would do the trick, but I don't know if there's a way to pass in a modified FileWriter right now. |
the time axis projected in one image could be also a good approach for videotests: #849 |
I don't think that the functionality proposed in #849 should be used for testing. The problem is that it could only be used to test moving mobjects. If the mobject doesn't move, then each frame will just be put on top of the other, and it will not be possible to know which pixel comes from which frame. I don't see how that is better than the original idea of saving different frames separately. |
Related to #1035 |
Animation tests (via rendering and storing multiple frames) exist since the refactor of the testing framework. Closing. |
I have the following idea of how to test videos in manim:
We generate a video with a very low frame rate, I would suggest 4 frames per second. This is not too low to overlook something that might go wrong and at the same time not too long to slow down the testing process drastically.
For a 5-second test video, this would result in an about 0.1 MB compressed numpy array.
Here is the script how to compress in this case dummy-data:
Then, we make a very similar script to this one:
manim/tests/helpers/graphical_units.py
Line 11 in e67a655
except, that the data is not only created once but multiple times for every 0.25 seconds.
Here is what I could come up right now
Note that matplotlib is only there for debugging and that this script only produces one frame.
Please leave your thoughts about this, @ManimCommunity/tests
The text was updated successfully, but these errors were encountered: