First, use pip
to download the opencv-python
and pillow
package.
conda create ztt python=3.10
conda activate ztt
pip install -r requirements.txt
Then, run the following command to extract all the frames from target video, e.g., the following video:
default.mp4
python scripts/extract_frames.py videos/捏我脸.mp4
Run the following command to generate GIFs based on extracted frames:
python scripts/create_gif.py output/捏我脸/捏我脸_{0173..0240}.png --fps 30
- Integrate FaceRate.ai, an AI tool for evaluating facial attractiveness, to rank the extracted frames. This will involve using the FaceRate.ai API to analyze each frame and assign a score based on facial features.
- Automatically identify the emoji that best matches the extracted frame’s portrait and insert it into the frame.