-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
How to test videos? #34
Comments
Until you take into account compression and stuff, at which point something this simple becomes pretty ridiculous |
@yoshiask you raise a good point. Can manim currently output bitmap formats? If it were able to output a bitmap (which is basically an array), then we don't need to worry about compression. This could be an option used only during testing, but that's OK because if the bitmap version is good, then we don't really need to test the compression step. |
Actually there is EDIT : There is also |
Excellent! It shouldn't be too hard to put together a proof-of-concept example test using this idea of testing individual frames. |
Ok, I will try to do that. We could even use that method of testing instead of the one which have been described in #22. |
Yes, #22 was supposed to be a quick temporary patch. I still think we should keep those sample scenes tho! |
Here is an example of a test. Basically it compares a frame with another saved previously. We could have like a folder with some .npy files of frames of a bunch of scenes, and run some tests comparing with them. What do you think ? |
If the But the |
Just to clarify, your example test didn't really do this, right? It is testing a newly-rendered scene with itself, after loading it using numpy. This is more like testing numpy's save/load functions. If we compare to a previously-rendered frame, then I'm all for this test! |
@leotrs No, my example compares a previously-rendered frame. This line Sorry, that was unclear |
As @yoshiask isn't the "compression and stuff" an issue if we use that ? |
Oh I missed the commented line. This looks good to me. Are you volunteering a PR? :) |
Yes, it is. We'd have to compare the raw output (byte arrays) to what we'd expect the raw output to be. I doubt we can reliably use any image format. |
Yup. I will do that asap. I will do that in |
I found some articles on the topic that make it seem pretty doable. |
In the future, we will need to check the videos generated by manim for correctness.
One way to go about it, is to write tests in such a way that they output a single frame in PNG format. And then we can load that PNG in python and check everything, even pixel by pixel if needed. For example, it would be fairly easy to write a test that checks for "this PNG/frame contains a red square of such and such size over a black background".
The text was updated successfully, but these errors were encountered: