当前位置:网站首页>[Tanabata] Tanabata lonely little frog research edition? The final chapter of Tanabata Festival!

[Tanabata] Tanabata lonely little frog research edition? The final chapter of Tanabata Festival!

2022-07-28 14:33:00 Learning programming at the age of three

The strongest solution to Tanabata loneliness !!!

Remember the hot Tanabata lonely little frog in recent years ?

“ A good friend ” They rushed to order you a lonely frog

True friends are beyond doubt !

What is the strongest solution ?

You are still bombing lonely and don't feel funny ?

You're still not happy about the other party blocking you or deleting content ?

That's all right. ! Today I'll take you through the customized lonely video , Absolutely innovative !!!

You're still worried that your friend sent you a video and couldn't fight back ?

You are still unhappy about the large number of lonely bombing every year ?

That's all right. ! Today I will show you a video counterattack , Let everyone see your decision and perseverance to fight back !

I'm still helpless for the love of my friends ?

That's all right. ! Today, I have prepared rotten tools for you ! Arrange the troubles clearly !

Error scheme display

Lao Xu, you want a wife, not

https://www.bilibili.com/video/BV1HG4y1i7KV/

Pink memories

https://www.bilibili.com/video/BV14B4y1h7uS

What's wrong with me being single

https://www.bilibili.com/video/bv1jU4y1q7fp

Lonely frog

https://www.bilibili.com/video/bv1uN4y177Rr

Qingming crying version

https://www.bilibili.com/video/bv1HT411E7aH

Solution comparison table

Serial number Content Category
1 What a lonely frog Friend authentication
2 Live frog Friend authentication
3 Honey snow ice city version lonely Friend authentication
4 Lao Xu, you want a wife, not Friend authentication
5 What's wrong with me being single Counterattack is necessary
6 I'm single, I'm proud Counterattack is necessary
7 Pink memories Counterattack is necessary
8 Bao Qingtian version ( Qingming crying ) Counterattack is necessary

Usage method

https://aistudio.baidu.com/aistudio/projectdetail/4341437

Just upload a photo on the left first ( Straight face )

Choose the serial number you want

All the code running below can be input according to the prompt

reminder : If the serial number entered is incorrect, it will default to the first !

To upload pictures

Click the button in the file, then select the file and upload

 Please add a picture description

Click the button below to run the code

 Please add a picture description

Write the uploaded image and the required version in the first code content

 Please add a picture description

Information confirmation

import file

imgname = input(' Please enter the name of the photo you uploaded ( Take the suffix ) for example : handsome guy .jpg/ beauty .jpg')
imgpath = file.findfile(imgname)
if imgpath == None:
    print(" The picture cannot be queried , Please check whether it has been imported !!!")
try:
    genre = eval(input(" Please enter the serial number you are trying to use . for example :1"))
except:
    print(' Input error, please enter an integer !')

print(f' The location of your picture is :{
      imgpath}, The sequence number of trying to use the solution is {
      genre}')
 Please enter the name of the photo you uploaded ( Take the suffix ) for example : handsome guy .jpg/ beauty .jpg 1.jpg


 The file has been found 


 Please enter the serial number you are trying to use . for example :1 1


 The location of your picture is :./1.jpg, The sequence number of trying to use the solution is 1

Information processing

!unzip -oq ./data/data158349/QIXI.zip
form = {
    
    1 : './ Alone and widowed / Lonely frog frog version .mp3',
    2 : './ Alone and widowed / Lonely live version .mp3',
    3 : './ Alone and widowed / Honey snow ice city version lonely .mp3',
    4 : './ Alone and widowed / Lao Xu wants a wife, not .mp3',
    5 : './ Alone and widowed / What's wrong with me being single .mp3',
    6 : './ Alone and widowed / I am single and proud .mp3',
    7 : './ Alone and widowed / Pink memories .mp3',
    8 : './ Alone and widowed / Bao Qingtian version .mp3',
}
import file
%cd /home/aistudio/

if int(genre)<1 and int(genre)>8:
    genre = 1

musicpath = './music.mp3'
photopatch = './photo.jpg'
file.copyfile(form[genre], musicpath)
file.copyfile(imgpath, photopatch)
/home/aistudio

Environmental installation

#  Current directory in : /home/aistudio/,  This directory is also the directory where the files and folders on the left are located 
#  Clone the latest PaddleGAN Warehouse to current directory 
# !git clone https://github.com/PaddlePaddle/PaddleGAN.git
#  If from github Download slow, you can download from gitee clone:
!git clone https://gitee.com/paddlepaddle/PaddleGAN.git
%cd /home/aistudio/PaddleGAN/
!pip install -v -e .
#  install PaddleGAN Of pip package , You can use api How to predict 
!pip install --upgrade ppgan
!pip install dlib==19.22.0 -i https://pypi.douban.com/simple

The entrance of the second dimension

# Generate animated avatars 
from ppgan.apps import Photo2CartoonPredictor
%cd /home/aistudio
p2c = Photo2CartoonPredictor(output_path='/home/aistudio/result/')
p2c.run('./photo.jpg')

Let the picture move ~

%cd /home/aistudio/PaddleGAN/applications/
!export PYTHONPATH=$PYTHONPATH:/home/aistudio/PaddleGAN && python -u tools/first-order-demo.py  --driving_video ~/2.MOV  --source_image /home/aistudio/result/p2c_cartoon.png --relative --adapt_scale --output  ~/work

Make the video clearer

%cd /home/aistudio/PaddleGAN/applications/
!python tools/video-enhance.py --input /home/aistudio/work/result.mp4 \
                               --process_order EDVR \
                               --output output_dir

Let the video sing ~

%cd /home/aistudio/PaddleGAN/applications
!export PYTHONPATH=$PYTHONPATH:/home/aistudio/work/PaddleGAN && python tools/wav2lip.py --face /home/aistudio/PaddleGAN/applications/output_dir/EDVR/target_edvr_out.mp4 --audio /home/aistudio/music.mp3 --outfile /home/aistudio/target.mp4
%cd /home/aistudio/

file.copyfile('./target.mp4', ' The strongest solution .mp4')
!rm -f photo.jpg
!rm -f music.mp3
.mp3
!rm -f target.mp4
/home/aistudio

Operation guide and troubleshooting

Use guide :

Input the data of the corresponding user-defined module
The final result will appear in the home directory , The file named The strongest solution .mp4

Troubleshooting :

1、 Want videos of multiple schemes

You can run all of them again or just run Information confirmation Information processing Let the video sing The module can

2、 The image processing part reports an error , No avatar is recognized

Change your avatar , It may be that the code has no eyes , I can't find your beautiful face in the golden age ~ Come back and tell me I will beat it !

3、dlib The library cannot be loaded

Use the advanced version V100 32GB Read in the above environment

4、 Other unknown errors and problems

You can leave a message behind the project to ask , Will take time to answer !

In particular

This project should be the last episode of this series , There are no new plans and plans at present , I hope everyone can do it and cherish it ~~~~

Author's brief introduction

author : Three years old
experience : self-taught python, Now it's in paddle Community , I hope to start from the foundation with you , Learning together Paddle
csdn Address :https://blog.csdn.net/weixin_45623093/article/list/3
I am here AI Studio Gain the supreme level on , Lighten up 9 A badge , Let's talk to each other ~ https://aistudio.baidu.com/aistudio/personalcenter/thirdview/284366

The legendary flying oar community is the most famous person , Let's work together !
remember : Three year old products must be high-quality products ( Shameless series )

Bless the single friends in " Don't eat too much when you are full ", As soon as possible to take off the list !!!!

I wish other friends

while(True):  

   print(9, end='')
原网站

版权声明
本文为[Learning programming at the age of three]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/209/202207281340045506.html