AI makes children's paintings move - a must-have for programmers with children

Project effect demonstration

0f8b7083e4e523667dc082f36c443143.jpeg

project description

Many children have created many creative works in the process of learning painting. So how to make these works move or even interact with the captured videos? The project shared today can perfectly solve this problem.


Project address
http: //www.fairanimateddrawings.com
github: https://github.com/facebookresearch/AnimatedDrawings


Installation environment
This project has been tested on macOS Ventura 13.2.1 and Ubuntu 18.04. If you install on other operating systems, you may encounter problems.
We strongly recommend activating the Python virtual environment before installing Animated Drawings. Miniconda by Conda is a good choice.


Installation steps
# create and activate the virtual environment
conda create --name animated_drawings python=3.8.13
conda activate animated_drawings

# clone AnimatedDrawings and use pip to install
git clone https://github.com/facebookresearch/AnimatedDrawings.git
cd AnimatedDrawings
pip install -e .
Now that everything is set up, let's animate some drawings! First, follow these steps:
Open a terminal and activate the animated_drawings conda environment:
~ % conda activate animated_drawings
Make sure you are in the root directory of AnimatedDrawings:
(animated_drawings) ~ % cd {location of AnimatedDrawings on your computer}
Start the Python interpreter:
( animated_drawings) AnimatedDrawings % python
Copy and paste the following two lines into the interpreter:
from animated_drawings import render
render.start('./examples/config/mvc/interactive_window_example.yaml')
If everything is installed correctly, an interactive window should appear on the screen. (Use the space bar to pause/unpause the scene, the arrow keys to move forward and backward in time, and q to turn off the screen.)

831ae314218ea937e3b771316d573586.jpeg

There's a lot going on behind the scenes here. Characters, actions, scenes, etc. are all controlled by configuration files, such as
interactive_window_example.yaml. Below, we show how to achieve different effects by changing the configuration file. You can learn more about configuration files here.


Exporting MP4 Video
Suppose you want to save the animation as a video file rather than view it directly in a window. Specify a different example configuration by copying these lines into the Python interpreter:
from animated_drawings import render
render.start('./examples/config/mvc/export_mp4_example.yaml')
The animation is not saved in the interactive window, but Save to the file video.mp4, which is located in the same directory as the script.

Export transparent.gif

Maybe you want a transparent .gif instead of an .mp4? Copy these lines in the Python interpreter:
from animated_drawings import render
render.start('./examples/config/mvc/export_gif_example.yaml')


Headless rendering
If you want to generate the video headless (for example on a remote server accessed via ssh), you need to specify USE_MESA: True in the view configuration file section.
view:
USE_MESA: True
adds multiple characters to the scene

42b1c70164fc6965f151e83e14f66106.jpeg

Multiple characters can be added to the video by specifying multiple entries in the "ANIMATED_CHARACTERS" list of the configuration scene. To see it for yourself, run the following command from the Python interpreter in the root directory of AnimatedDrawings: from

animated_drawings import render
render.start('./examples/config/mvc/multiple_characters_example.yaml')
Adding a Background Image
Suppose you want to add a background to your animation . You can do this by specifying the image path in the configuration. Run the following command from the Python interpreter in the root directory of AnimatedDrawings:

74684ee8efe2d422f65a7738b567dbce.jpeg

from animated_drawings import render
render.start('./examples/config/mvc/background_example.yaml')
Interested friends, please act quickly.

Guess you like

Origin blog.csdn.net/specssss/article/details/132431403